r61836 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61835‎ | r61836 | r61837 >
Date:00:44, 2 February 2010
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
Allow external URLs (e.g. http://bits.wikimedia.org/foo) in OutputPage::addScript()
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -186,7 +186,7 @@
187187 */
188188 public function addScriptFile( $file ) {
189189 global $wgStylePath, $wgStyleVersion;
190 - if( substr( $file, 0, 1 ) == '/' ) {
 190+ if( substr( $file, 0, 1 ) == '/' || substr( $file, 0, 7 ) == 'http://' ) {
191191 $path = $file;
192192 } else {
193193 $path = "{$wgStylePath}/common/{$file}";

Follow-up revisions

RevisionCommit summaryAuthorDate
r61837wmf-deployment: Merge r61836 from trunkcatrope00:48, 2 February 2010
r62994follow-up r61836 - allow any URLmah02:41, 26 February 2010

Comments

#Comment by Simetrical (talk | contribs)   17:44, 2 February 2010

Maybe allow https also?

#Comment by Bryan (talk | contribs)   21:51, 25 February 2010

Maybe just check for :// ?

#Comment by Simetrical (talk | contribs)   22:02, 25 February 2010

Or '#^[a-z]*://#i', to be a little more careful. But we'd hopefully never put something with such an exotic name in $wgStylePath anywhere, so it should be safe either way.  :)

#Comment by MarkAHershberger (talk | contribs)   02:42, 26 February 2010

see r62994

Status & tagging log