Index: trunk/phase3/includes/Preprocessor_DOM.php |
— | — | @@ -979,7 +979,7 @@ |
980 | 980 | $titleText = $this->title->getPrefixedDBkey(); |
981 | 981 | $this->parser->mHeadings[] = array( $titleText, $headingIndex ); |
982 | 982 | $serial = count( $this->parser->mHeadings ) - 1; |
983 | | - $marker = "{$this->parser->mUniqPrefix}-h-$serial-{$this->parser->mMarkerSuffix}"; |
| 983 | + $marker = "{$this->parser->mUniqPrefix}-h-$serial-" . Parser::MARKER_SUFFIX; |
984 | 984 | $count = $contextNode->getAttribute( 'level' ); |
985 | 985 | $s = substr( $s, 0, $count ) . $marker . substr( $s, $count ); |
986 | 986 | $this->parser->mStripState->general->setPair( $marker, '' ); |
Index: trunk/phase3/includes/Parser.php |
— | — | @@ -82,14 +82,17 @@ |
83 | 83 | const OT_WIKI = 2; |
84 | 84 | const OT_PREPROCESS = 3; |
85 | 85 | const OT_MSG = 3; |
86 | | - |
| 86 | + |
| 87 | + // Marker Suffix needs to be accessible staticly. |
| 88 | + const MARKER_SUFFIX = "-QINU\x7f"; |
| 89 | + |
87 | 90 | /**#@+ |
88 | 91 | * @private |
89 | 92 | */ |
90 | 93 | # Persistent: |
91 | 94 | var $mTagHooks, $mTransparentTagHooks, $mFunctionHooks, $mFunctionSynonyms, $mVariables, |
92 | | - $mImageParams, $mImageParamsMagicArray, $mStripList, $mMarkerSuffix, $mMarkerIndex, |
93 | | - $mExtLinkBracketedRegex, $mPreprocessor, $mDefaultStripList, $mVarCache, $mConf; |
| 95 | + $mImageParams, $mImageParamsMagicArray, $mStripList, $mMarkerIndex, $mPreprocessor, |
| 96 | + $mExtLinkBracketedRegex, $mDefaultStripList, $mVarCache, $mConf; |
94 | 97 | |
95 | 98 | |
96 | 99 | # Cleared with clearState(): |
— | — | @@ -124,7 +127,6 @@ |
125 | 128 | $this->mFunctionHooks = array(); |
126 | 129 | $this->mFunctionSynonyms = array( 0 => array(), 1 => array() ); |
127 | 130 | $this->mDefaultStripList = $this->mStripList = array( 'nowiki', 'gallery' ); |
128 | | - $this->mMarkerSuffix = "-QINU\x7f"; |
129 | 131 | $this->mExtLinkBracketedRegex = '/\[(\b(' . wfUrlProtocols() . ')'. |
130 | 132 | '[^][<>"\\x00-\\x20\\x7F]+) *([^\]\\x0a\\x0d]*?)\]/S'; |
131 | 133 | $this->mVarCache = array(); |
— | — | @@ -526,7 +528,7 @@ |
527 | 529 | $inside = $p[4]; |
528 | 530 | } |
529 | 531 | |
530 | | - $marker = "$uniq_prefix-$element-" . sprintf('%08X', $n++) . $this->mMarkerSuffix; |
| 532 | + $marker = "$uniq_prefix-$element-" . sprintf('%08X', $n++) . self::MARKER_SUFFIX; |
531 | 533 | $stripped .= $marker; |
532 | 534 | |
533 | 535 | if ( $close === '/>' ) { |
— | — | @@ -618,7 +620,7 @@ |
619 | 621 | * @private |
620 | 622 | */ |
621 | 623 | function insertStripItem( $text ) { |
622 | | - $rnd = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}-{$this->mMarkerSuffix}"; |
| 624 | + $rnd = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}-" . self::MARKER_SUFFIX; |
623 | 625 | $this->mMarkerIndex++; |
624 | 626 | $this->mStripState->general->setPair( $rnd, $text ); |
625 | 627 | return $rnd; |
— | — | @@ -3185,7 +3187,7 @@ |
3186 | 3188 | $attrText = !isset( $params['attr'] ) ? null : $frame->expand( $params['attr'] ); |
3187 | 3189 | $content = !isset( $params['inner'] ) ? null : $frame->expand( $params['inner'] ); |
3188 | 3190 | |
3189 | | - $marker = "{$this->mUniqPrefix}-$name-" . sprintf('%08X', $this->mMarkerIndex++) . $this->mMarkerSuffix; |
| 3191 | + $marker = "{$this->mUniqPrefix}-$name-" . sprintf('%08X', $this->mMarkerIndex++) . self::MARKER_SUFFIX; |
3190 | 3192 | |
3191 | 3193 | if ( $this->ot['html'] ) { |
3192 | 3194 | $name = strtolower( $name ); |
— | — | @@ -3378,7 +3380,7 @@ |
3379 | 3381 | $prevlevel = 0; |
3380 | 3382 | $toclevel = 0; |
3381 | 3383 | $prevtoclevel = 0; |
3382 | | - $markerRegex = "{$this->mUniqPrefix}-h-(\d+)-{$this->mMarkerSuffix}"; |
| 3384 | + $markerRegex = "{$this->mUniqPrefix}-h-(\d+)-" . self::MARKER_SUFFIX; |
3383 | 3385 | $baseTitleText = $this->mTitle->getPrefixedDBkey(); |
3384 | 3386 | $tocraw = array(); |
3385 | 3387 | |
— | — | @@ -4822,12 +4824,12 @@ |
4823 | 4825 | break; |
4824 | 4826 | } else { |
4825 | 4827 | $out .= call_user_func( $callback, substr( $s, $i, $markerStart - $i ) ); |
4826 | | - $markerEnd = strpos( $s, $this->mMarkerSuffix, $markerStart ); |
| 4828 | + $markerEnd = strpos( $s, self::MARKER_SUFFIX, $markerStart ); |
4827 | 4829 | if ( $markerEnd === false ) { |
4828 | 4830 | $out .= substr( $s, $markerStart ); |
4829 | 4831 | break; |
4830 | 4832 | } else { |
4831 | | - $markerEnd += strlen( $this->mMarkerSuffix ); |
| 4833 | + $markerEnd += strlen( self::MARKER_SUFFIX ); |
4832 | 4834 | $out .= substr( $s, $markerStart, $markerEnd - $markerStart ); |
4833 | 4835 | $i = $markerEnd; |
4834 | 4836 | } |
Index: trunk/phase3/includes/Preprocessor_Hash.php |
— | — | @@ -928,7 +928,7 @@ |
929 | 929 | $titleText = $this->title->getPrefixedDBkey(); |
930 | 930 | $this->parser->mHeadings[] = array( $titleText, $bits['i'] ); |
931 | 931 | $serial = count( $this->parser->mHeadings ) - 1; |
932 | | - $marker = "{$this->parser->mUniqPrefix}-h-$serial-{$this->parser->mMarkerSuffix}"; |
| 932 | + $marker = "{$this->parser->mUniqPrefix}-h-$serial-" . Parser::MARKER_SUFFIX; |
933 | 933 | $s = substr( $s, 0, $bits['level'] ) . $marker . substr( $s, $bits['level'] ); |
934 | 934 | $this->parser->mStripState->general->setPair( $marker, '' ); |
935 | 935 | $out .= $s; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -136,6 +136,7 @@ |
137 | 137 | * Trackback display formatting fixed |
138 | 138 | * Don't die when single-element arrays are passed to SQL query constructors |
139 | 139 | that have an array index other than 0 |
| 140 | +* (bug 13522) Fix fatal error in Parser::extractTagsAndParams |
140 | 141 | |
141 | 142 | |
142 | 143 | === API changes in 1.13 === |