* (bug 4571) Partial fix hack for {{fulllurl:}} in action=render

Quick hack to do the same check in getFullUrl() that happens in getLocalUrl()
and if it matches *don't* add a duplicate URL prefix.
However anything is still broken that expects it, such as {{localurl:}} and it feels generally hacky.
Also switched from getText() which does expensive encoding checks to getVal()
This commit is contained in:
Brion Vibber 2006-01-12 10:06:54 +00:00
parent 3481441d1a
commit e1ecb47aab
2 changed files with 13 additions and 4 deletions

View file

@ -465,6 +465,7 @@ fully support the editing toolbar, but was found to be too confusing.
* (bug 4104) Added OutputPageBeforeHTML hook for tweaking primary wiki output
HTML on final output (cached or not)
* Avoid PHP notice on command-line scripts if empty argument is passed ('')
* (bug 4571) Partial fix hack for {{fulllurl:}} in action=render
=== Caveats ===

View file

@ -665,10 +665,16 @@ class Title {
* @access public
*/
function getFullURL( $query = '' ) {
global $wgContLang, $wgServer;
global $wgContLang, $wgServer, $wgRequest;
if ( '' == $this->mInterwiki ) {
$url = $wgServer . $this->getLocalUrl( $query );
$url = $this->getLocalUrl( $query );
// Ugly quick hack to avoid duplicate prefixes (bug 4571 etc)
// Correct fix would be to move the prepending elsewhere.
if ($wgRequest->getVal('action') != 'render') {
$url = $wgServer . $url;
}
} else {
$baseUrl = $this->getInterwikiLink( $this->mInterwiki );
@ -732,8 +738,10 @@ class Title {
$url = "{$wgScript}?title={$dbkey}&{$query}";
}
}
if ($wgRequest->getText('action') == 'render') {
// FIXME: this causes breakage in various places when we
// actually expected a local URL and end up with dupe prefixes.
if ($wgRequest->getVal('action') == 'render') {
$url = $wgServer . $url;
}
}