(bug 16019) Make WebRequest::interpolateTitle() do nothing when run from api.php
This commit is contained in:
parent
11f3ca1305
commit
75086e9f35
3 changed files with 9 additions and 3 deletions
|
|
@ -33,6 +33,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
|
|||
* Page existence is now not revealed (in the colour of the tabs) to users who
|
||||
cannot read the page in question.
|
||||
* (bug 19006) {{REVISIONUSER}} no longer acts like {{CURRENTUSER}} in some cases
|
||||
* (bug 16019) $wgArticlePath = "/$1" no longer breaks API edit/watch actions
|
||||
|
||||
=== API changes in 1.18 ===
|
||||
|
||||
|
|
|
|||
6
api.php
6
api.php
|
|
@ -34,6 +34,9 @@
|
|||
* in the URL.
|
||||
*/
|
||||
|
||||
// So extensions (and other code) can check whether they're running in API mode
|
||||
define( 'MW_API', true );
|
||||
|
||||
// Initialise common code
|
||||
require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
|
||||
|
||||
|
|
@ -99,9 +102,6 @@ if ( $wgCrossSiteAJAXdomains && isset( $_SERVER['HTTP_ORIGIN'] ) ) {
|
|||
}
|
||||
}
|
||||
|
||||
// So extensions can check whether they're running in API mode
|
||||
define( 'MW_API', true );
|
||||
|
||||
// Set a dummy $wgTitle, because $wgTitle == null breaks various things
|
||||
// In a perfect world this wouldn't be necessary
|
||||
$wgTitle = Title::makeTitle( NS_MAIN, 'API' );
|
||||
|
|
|
|||
|
|
@ -65,6 +65,11 @@ class WebRequest {
|
|||
public function interpolateTitle() {
|
||||
global $wgUsePathInfo;
|
||||
|
||||
// bug 16019: title interpolation on API queries is useless and possible harmful
|
||||
if ( defined( 'MW_API' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $wgUsePathInfo ) {
|
||||
// PATH_INFO is mangled due to http://bugs.php.net/bug.php?id=31892
|
||||
// And also by Apache 2.x, double slashes are converted to single slashes.
|
||||
|
|
|
|||
Loading…
Reference in a new issue