Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -156,7 +156,8 @@ |
157 | 157 | * (bug 32168) Add wfAssembleUrl for use in wfExpandUrl. |
158 | 158 | * (bug 32168) fixed - wfExpandUrl expands dot segments now. |
159 | 159 | * (bug 31535) Upload comments now truncated properly, and don't have brackets. |
160 | | -* (bug 32450) Scripts pages in MediaWiki: namespace parse [[Category:#]] links. |
| 160 | +* (bug 32858) Do not register links, categories, etc. from CSS/JS pages in the |
| 161 | + database. |
161 | 162 | * (bug 32086) Special:PermanentLink now show an error message when no subpage |
162 | 163 | was specified. |
163 | 164 | * (bug 30368) Special:Newpages now shows the new page name for moved pages. |
Index: trunk/phase3/tests/parser/parserTests.txt |
— | — | @@ -8993,28 +8993,6 @@ |
8994 | 8994 | |
8995 | 8995 | !! end |
8996 | 8996 | |
8997 | | -!! test |
8998 | | -Bug 32450: MediaWiki: js pages should ignore Category syntax |
8999 | | -!! options |
9000 | | -title=[[MediaWiki:bug32450.js]] |
9001 | | -!! input |
9002 | | -var foo = "[[Category:bug32450]]" |
9003 | | -!! result |
9004 | | -<p>var foo = "[[Category:bug32450]]" |
9005 | | -</p> |
9006 | | -!! end |
9007 | | - |
9008 | | -!! test |
9009 | | -Bug 32450: MediaWiki: css pages should ignore Category syntax |
9010 | | -!! options |
9011 | | -title=[[MediaWiki:bug32450.css]] |
9012 | | -!! input |
9013 | | -/** Css comment: "[[Category:bug32450]]" */ |
9014 | | -!! result |
9015 | | -<p>/** Css comment: "[[Category:bug32450]]" */ |
9016 | | -</p> |
9017 | | -!! end |
9018 | | - |
9019 | 8997 | TODO: |
9020 | 8998 | more images |
9021 | 8999 | more tables |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -1643,12 +1643,6 @@ |
1644 | 1644 | * @private |
1645 | 1645 | */ |
1646 | 1646 | function replaceInternalLinks( $s ) { |
1647 | | - if( $this->getTitle()->isCssOrJsPage() ) { |
1648 | | - # bug 32450 : js and script pages in MediaWiki: namespace do not want |
1649 | | - # to get their code or comments altered. Think about js string: |
1650 | | - # var foobar = "[[Category:" + $catname + "]]; |
1651 | | - return $s; |
1652 | | - } |
1653 | 1647 | $this->mLinkHolders->merge( $this->replaceInternalLinks2( $s ) ); |
1654 | 1648 | return $s; |
1655 | 1649 | } |
Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -2018,7 +2018,18 @@ |
2019 | 2019 | $edit->newText = $text; |
2020 | 2020 | $edit->pst = $wgParser->preSaveTransform( $text, $this->mTitle, $user, $popts ); |
2021 | 2021 | $edit->popts = $this->makeParserOptions( 'canonical' ); |
2022 | | - $edit->output = $wgParser->parse( $edit->pst, $this->mTitle, $edit->popts, true, true, $revid ); |
| 2022 | + |
| 2023 | + // Bug 32858: For a CSS/JS page, put a blank parser output into the |
| 2024 | + // prepared edit, so that links etc. won't be registered in the |
| 2025 | + // database. We could have set $edit->output to false or something if |
| 2026 | + // we thought of this bug earlier, but now that would break the |
| 2027 | + // interface with AbuseFilter etc. |
| 2028 | + if ( $this->mTitle->isCssOrJsPage() || $this->getTitle()->isCssJsSubpage() ) { |
| 2029 | + $input = ''; |
| 2030 | + } else { |
| 2031 | + $input = $edit->pst; |
| 2032 | + } |
| 2033 | + $edit->output = $wgParser->parse( $input, $this->mTitle, $edit->popts, true, true, $revid ); |
2023 | 2034 | $edit->oldText = $this->getRawText(); |
2024 | 2035 | |
2025 | 2036 | $this->mPreparedEdit = $edit; |