r41330 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41329‎ | r41330 | r41331 >
Date:01:46, 28 September 2008
Author:nad
Status:old
Tags:
Comment:
bug fix: broke if treated as title, but bad or nonexistent
Modified paths:
  • /trunk/extensions/CSS/CSS.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CSS/CSS.php
@@ -13,7 +13,7 @@
1414
1515 if (!defined('MEDIAWIKI')) die('Not an entry point.');
1616
17 -define('CSS_VERSION', '1.0.4, 2008-06-01');
 17+define('CSS_VERSION', '1.0.5, 2008-09-28');
1818
1919 $wgCSSMagic = "css";
2020 $wgExtensionFunctions[] = 'wfSetupCSS';
@@ -57,9 +57,12 @@
5858
5959 } else {
6060
61 - # Article
62 - $url = Title::newFromText($css)->getLocalURL('action=raw&ctype=text/css');
63 - $url = str_replace("&", "&", $url);
 61+ # Article?
 62+ $title = Title::newFromText($css)
 63+ if (is_object($title)) {
 64+ $url = $tite->getLocalURL('action=raw&ctype=text/css');
 65+ $url = str_replace("&", "&", $url);
 66+ }
6467 }
6568 if ($url) $wgOut->addScript("<link rel=\"stylesheet\" type=\"text/css\" href=\"$url\" />");
6669 return '';

Status & tagging log