Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2278,4 +2278,14 @@ |
2279 | 2279 | } |
2280 | 2280 | } |
2281 | 2281 | |
2282 | | - |
| 2282 | +/** |
| 2283 | + * Get the path to a specified script file, respecting file |
| 2284 | + * extensions; this is a wrapper around $wgScriptExtension etc. |
| 2285 | + * |
| 2286 | + * @param string $script Script filename, sans extension |
| 2287 | + * @return string |
| 2288 | + */ |
| 2289 | +function wfScript( $script = 'index' ) { |
| 2290 | + global $wgScriptPath, $wgScriptExtension; |
| 2291 | + return "{$wgScriptPath}/{$script}{$wgScriptExtension}"; |
| 2292 | +} |
\ No newline at end of file |
Index: trunk/phase3/includes/api/ApiFormatBase.php |
— | — | @@ -85,6 +85,7 @@ |
86 | 86 | function initPrinter($isError) { |
87 | 87 | $isHtml = $this->getIsHtml(); |
88 | 88 | $mime = $isHtml ? 'text/html' : $this->getMimeType(); |
| 89 | + $script = wfScript( 'api' ); |
89 | 90 | |
90 | 91 | // Some printers (ex. Feed) do their own header settings, |
91 | 92 | // in which case $mime will be set to null |
— | — | @@ -104,14 +105,14 @@ |
105 | 106 | <?php |
106 | 107 | |
107 | 108 | |
108 | | - if (!$isError) { |
| 109 | + if( !$isError ) { |
109 | 110 | ?> |
110 | 111 | <br/> |
111 | 112 | <small> |
112 | | -You are looking at the HTML representation of the <?=$this->mFormat?> format.<br/> |
| 113 | +You are looking at the HTML representation of the <?php echo( $this->mFormat ); ?> format.<br/> |
113 | 114 | HTML is good for debugging, but probably is not suitable for your application.<br/> |
114 | 115 | See <a href='http://www.mediawiki.org/wiki/API'>complete documentation</a>, or |
115 | | -<a href='api.php'>API help</a> for more information. |
| 116 | +<a href='<?php echo( $script ); ?>'>API help</a> for more information. |
116 | 117 | </small> |
117 | 118 | <?php |
118 | 119 | |