r78209 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78208‎ | r78209 | r78210 >
Date:22:39, 10 December 2010
Author:vyznev
Status:ok
Tags:
Comment:
(bug 16019) Make WebRequest::interpolateTitle() do nothing when run from api.php
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/api.php (modified) (history)
  • /trunk/phase3/includes/WebRequest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WebRequest.php
@@ -65,6 +65,11 @@
6666 public function interpolateTitle() {
6767 global $wgUsePathInfo;
6868
 69+ // bug 16019: title interpolation on API queries is useless and possible harmful
 70+ if ( defined( 'MW_API' ) ) {
 71+ return;
 72+ }
 73+
6974 if ( $wgUsePathInfo ) {
7075 // PATH_INFO is mangled due to http://bugs.php.net/bug.php?id=31892
7176 // And also by Apache 2.x, double slashes are converted to single slashes.
Index: trunk/phase3/api.php
@@ -34,6 +34,9 @@
3535 * in the URL.
3636 */
3737
 38+// So extensions (and other code) can check whether they're running in API mode
 39+define( 'MW_API', true );
 40+
3841 // Initialise common code
3942 require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
4043
@@ -99,9 +102,6 @@
100103 }
101104 }
102105
103 -// So extensions can check whether they're running in API mode
104 -define( 'MW_API', true );
105 -
106106 // Set a dummy $wgTitle, because $wgTitle == null breaks various things
107107 // In a perfect world this wouldn't be necessary
108108 $wgTitle = Title::makeTitle( NS_MAIN, 'API' );
Index: trunk/phase3/RELEASE-NOTES
@@ -33,6 +33,7 @@
3434 * Page existence is now not revealed (in the colour of the tabs) to users who
3535 cannot read the page in question.
3636 * (bug 19006) {{REVISIONUSER}} no longer acts like {{CURRENTUSER}} in some cases
 37+* (bug 16019) $wgArticlePath = "/$1" no longer breaks API edit/watch actions
3738
3839 === API changes in 1.18 ===
3940

Follow-up revisions

RevisionCommit summaryAuthorDate
r78210followup r78209: fix typo, better word choicevyznev22:42, 10 December 2010
r784371.17: Merge tagged revisions from trunk: r77878, r77981, r77982, r77994, r780...catrope14:14, 15 December 2010

Status & tagging log