r105538 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105537‎ | r105538 | r105539 >
Date:11:10, 8 December 2011
Author:yuvipanda
Status:deferred
Tags:
Comment:
Fixed minor Regex issue
Modified paths:
  • /trunk/extensions/SelectionSifter/AssessmentsExtractor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SelectionSifter/AssessmentsExtractor.php
@@ -24,7 +24,8 @@
2525 * @return array Assessments
2626 */
2727 public function extractAssessments() {
28 - $regex = '/<span data-project-name="(?P<project>.*)" data-importance="(?P<importance>.*)" data-quality="(?P<quality>.*)"\s*>/';
 28+ // Am going to a special level in hell for using Regex to parse HTML, am I not?
 29+ $regex = '/<span data-project-name="(?P<project>.*)" data-importance="(?P<importance>\w*)" data-quality="(?P<quality>\w*)"\s*>/';
2930 $matches = array();
3031 preg_match_all($regex, $this->mText, $matches, PREG_SET_ORDER);
3132

Status & tagging log