Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -3960,14 +3960,14 @@ |
3961 | 3961 | if ( $isTemplate ) { |
3962 | 3962 | # Put a T flag in the section identifier, to indicate to extractSections() |
3963 | 3963 | # that sections inside <includeonly> should be counted. |
3964 | | - $editlinkArgs = array( $titleText, "T-$sectionIndex", null ); |
| 3964 | + $editlinkArgs = array( $titleText, "T-$sectionIndex"/*, null */ ); |
3965 | 3965 | } else { |
3966 | 3966 | $editlinkArgs = array( $this->mTitle->getPrefixedText(), $sectionIndex, $headlineHint ); |
3967 | 3967 | } |
3968 | 3968 | // We use nearly the same structure as uniqPrefix and the marker stuffix (besides there being nothing random) |
3969 | 3969 | // However the this is output into the parser output itself not replaced early, so we hardcode this in case |
3970 | 3970 | // the constants change in a different version of MediaWiki, which would break this code. |
3971 | | - $editlink = "{$this->mUniqPrefix}-editsection-" . serialize($editlinkArgs) . self::MARKER_SUFFIX; |
| 3971 | + $editlink = "{$this->mUniqPrefix}-editsection-" . implode('|', array_map('urlencode', $editlinkArgs)) . self::MARKER_SUFFIX; |
3972 | 3972 | } else { |
3973 | 3973 | // Output edit section links directly as markup like we used to |
3974 | 3974 | if ( $isTemplate ) { |
Index: trunk/phase3/includes/parser/ParserOutput.php |
— | — | @@ -149,8 +149,11 @@ |
150 | 150 | */ |
151 | 151 | function replaceEditSectionLinksCallback( $m ) { |
152 | 152 | global $wgUser, $wgLang; |
153 | | - $args = unserialize($m[1]); |
| 153 | + $args = array_map('urldecode', explode('|', $m[1], 3)); |
154 | 154 | $args[0] = Title::newFromText( $args[0] ); |
| 155 | + if ( !is_object($args[0]) ) { |
| 156 | + throw new MWException("Bad parser output text."); |
| 157 | + } |
155 | 158 | $args[] = $wgLang->getCode(); |
156 | 159 | $skin = $wgUser->getSkin(); |
157 | 160 | return call_user_func_array( array( $skin, 'doEditSectionLink' ), $args ); |