Index: trunk/extensions/SemanticForms/includes/SF_FormClasses.php |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | |
125 | 125 | // First, look for "arraymap" parser function calls |
126 | 126 | // that map a property onto a list. |
127 | | - if ( preg_match_all( '/{{#arraymap:{{{([^|}]*:?[^|}]*)[^\[]*\[\[([^:]*:?[^:]*)::/mis', $templateText, $matches ) ) { |
| 127 | + if ( $ret = preg_match_all( '/{{#arraymap:{{{([^|}]*:?[^|}]*)[^\[]*\[\[([^:]*:?[^:]*)::/mis', $templateText, $matches ) ) { |
128 | 128 | foreach ( $matches[1] as $i => $field_name ) { |
129 | 129 | if ( ! in_array( $field_name, $fieldNamesArray ) ) { |
130 | 130 | $propertyName = $matches[2][$i]; |
— | — | @@ -131,6 +131,12 @@ |
132 | 132 | $fieldNamesArray[] = $field_name; |
133 | 133 | } |
134 | 134 | } |
| 135 | + } elseif ( $ret === false ) { |
| 136 | + // There was an error in the preg_match_all() |
| 137 | + // call - let the user know about it. |
| 138 | + if ( preg_last_error() == PREG_BACKTRACK_LIMIT_ERROR ) { |
| 139 | + print 'Semantic Forms error: backtrace limit exceeded during parsing! Please increase the value of <a href="http://www.php.net/manual/en/pcre.configuration.php#ini.pcre.backtrack-limit">pcre.backtrack-limit</a> in the PHP settings.'; |
| 140 | + } |
135 | 141 | } |
136 | 142 | |
137 | 143 | // Second, look for normal property calls. |