are now remembered between successive clicks.
* (bug 26069) Page title is no longer "Error" for all error pages
* (bug 39297) Show warning if thumbnail of animated image will not be animated.
+* (bug 38249) Parser will throw an exception instead of outputting gibberish if
+ PCRE is compiled without support for unicode properties.
=== API changes in 1.20 ===
* (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
/**
* Environment check for the PCRE module.
+ *
+ * @note If this check were to fail, the parser would
+ * probably throw an exception before the result
+ * of this check is shown to the user.
* @return bool
*/
protected function envCheckPCRE() {
}
wfSuppressWarnings();
$regexd = preg_replace( '/[\x{0430}-\x{04FF}]/iu', '', '-АБВГД-' );
+ // Need to check for \p support too, as PCRE can be compiled
+ // with utf8 support, but not unicode property support.
+ // check that \p{Zs} (space separators) matches
+ // U+3000 (Ideographic space)
+ $regexprop = preg_replace( '/\p{Zs}/u', '', "-\xE3\x80\x80-" );
wfRestoreWarnings();
- if ( $regexd != '--' ) {
+ if ( $regexd != '--' || $regexprop != '--' ) {
$this->showError( 'config-pcre-no-utf8' );
return false;
}
wfProfileIn( __METHOD__ );
$bits = preg_split( $this->mExtLinkBracketedRegex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
+ if ( $bits === false ) {
+ throw new MWException( "PCRE needs to be compiled with --enable-unicode-properties in order for MediaWiki to function" );
+ }
$s = array_shift( $bits );
$i = 0;