r34886 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34885‎ | r34886 | r34887 >
Date:19:42, 15 May 2008
Author:brion
Status:old
Tags:
Comment:
Revert r34877 -- duplicates wfExpandUrl()
Modified paths:
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)
  • /trunk/phase3/includes/SpecialFilepath.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -129,12 +129,12 @@
130130 $thumb = $f->getThumbnail($this->urlwidth, $this->urlheight);
131131 if($thumb)
132132 {
133 - $vals['thumburl'] = Http::makeFullUrl( $thumb->getURL() );
 133+ $vals['thumburl'] = $thumb->getURL();
134134 $vals['thumbwidth'] = $thumb->getWidth();
135135 $vals['thumbheight'] = $thumb->getHeight();
136136 }
137137 }
138 - $vals['url'] = Http::makeFullUrl( $f->getURL() );
 138+ $vals['url'] = $f->getURL();
139139 }
140140 if($this->fld_comment)
141141 $vals['comment'] = $f->getDescription();
Index: trunk/phase3/includes/SpecialFilepath.php
@@ -13,8 +13,7 @@
1414 } else {
1515 $file = wfFindFile( $title );
1616 if ( $file && $file->exists() ) {
17 - // Force a real 30x so the real url is always exposed
18 - $wgOut->redirect( Http::makeFullURL( $file->getURL() ) );
 17+ $wgOut->redirect( $file->getURL() );
1918 } else {
2019 $wgOut->setStatusCode( 404 );
2120 $cform = new FilepathForm( $title );
Index: trunk/phase3/includes/HttpFunctions.php
@@ -117,20 +117,4 @@
118118 }
119119 return false;
120120 }
121 -
122 - /*
123 - * Return the full url of something relative to $wgScriptPath or root
124 - */
125 - static function makeFullURL( $url ) {
126 - global $wgServer, $wgScriptPath;
127 -
128 - // This is a full url
129 - if ( strpos( $url, '://' ) !== false ) return $url;
130 -
131 - // This is a relative path
132 - if ( substr( $url, 0, 1 ) != '/' )
133 - $url = $wgScriptPath.'/'.$url;
134 -
135 - return $wgServer.$url;
136 - }
137121 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r34877Force output of a full URL in Special:Filepath and ApiQueryImageInfo in case ...btongminh18:33, 15 May 2008

Status & tagging log