r34749 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34748‎ | r34749 | r34750 >
Date:18:38, 13 May 2008
Author:david
Status:old
Tags:
Comment:
Fixed NOTICE by checking array size.
Modified paths:
  • /trunk/extensions/SpecialForm/SpecialForm.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SpecialForm/SpecialForm.body.php
@@ -288,9 +288,9 @@
289289 $field->setName($matches[1]);
290290 $field->setLabel($matches[2]);
291291 $field->setFieldType($matches[3]);
292 - if ($matches[4]) {
 292+ if (count($matches) > 4 && $matches[4]) {
293293 $field->setDescription($matches[5]);
294 - if ($matches[6]) {
 294+ if (count($matches) > 6 && $matches[6]) {
295295 $rawOptions = explode(',', $matches[7]);
296296 foreach ($rawOptions as $rawOption) {
297297 if (preg_match('/^(\w+)=(.+)/', $rawOption, $optMatches)) {

Status & tagging log