Index: trunk/extensions/NativePreprocessor/mediawiki_preprocessor.c |
— | — | @@ -137,5 +137,14 @@ |
138 | 138 | DEBUG("Constructed with text «%s» of length %d, flags %d", wikitext, wikitext_len, flags ); |
139 | 139 | preprocessed = preprocessToObj( wikitext, wikitext_len, flags, Z_ARRVAL_P(array), &preprocessed_len ); |
140 | 140 | |
| 141 | + if ( !preprocessed ) { |
| 142 | + /* Preprocessing failed. The error code is given in preprocessed_len */ |
| 143 | + if ( preprocessed_len == 1 ) { |
| 144 | + zend_throw_exception(zend_exception_get_default(), "Non-strings found in the parser strip list", 1 TSRMLS_CC); |
| 145 | + } else { |
| 146 | + zend_throw_exception(zend_exception_get_default(), "Unknown error preprocessing", 1 TSRMLS_CC); |
| 147 | + } |
| 148 | + } |
| 149 | + |
141 | 150 | RETURN_STRINGL( preprocessed, preprocessed_len, 0 ); |
142 | 151 | } |