r43493 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43492‎ | r43493 | r43494 >
Date:13:03, 14 November 2008
Author:daniel
Status:resolved (Comments)
Tags:
Comment:
strip quotes from parameter values given io parameter function. quotes become optional, like with tags
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryTree.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryTree/CategoryTree.php
@@ -290,7 +290,7 @@
291291 foreach ( $params as $p ) {
292292 if ( preg_match('/^\s*(\S.*?)\s*=\s*(.*?)\s*$/', $p, $m) ) {
293293 $k = $m[1];
294 - $v = $m[2];
 294+ $v = preg_replace('/^"\s*(.*?)"\s*$/', '$1', $m[2]); //strip any quotes enclusing the value
295295 }
296296 else {
297297 $k = trim($p);

Follow-up revisions

RevisionCommit summaryAuthorDate
r43511Tweak to r43493 -- trim whitespace on the inside right side of the quote as w...brion23:40, 14 November 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   23:40, 14 November 2008

Whitespace stripping tweaked in r43511.

Status & tagging log