Page MenuHomePhabricator

Parser: Fix "Undefined offset in Sanitizer.php on line 584"
Closed, ResolvedPublicPRODUCTION ERROR

Description

2014-11-16 14:10:48 mw1215 frwiki: [6f585032] /w/index.php?title=Trait%C3%A9_de_Saint-Germain-en-Laye_(1624)&action=edit&redlink=1 ErrorException from line 584 of /sr
v/mediawiki/php-1.25wmf7/includes/Sanitizer.php: Undefined offset: 5
2014-11-16 14:10:48 mw1215 frwiki: [1ac8f7a1] /w/index.php?title=Trait%C3%A9_de_Saint-Germain-en-Laye_(1624)&action=edit&redlink=1 ErrorException from line 584 of /sr
v/mediawiki/php-1.25wmf7/includes/Sanitizer.php: Undefined offset: 4
2014-11-16 14:10:48 mw1215 frwiki: [24139ec3] /w/index.php?title=Trait%C3%A9_de_Saint-Germain-en-Laye_(1624)&action=edit&redlink=1 ErrorException from line 584 of /sr
v/mediawiki/php-1.25wmf7/includes/Sanitizer.php: Undefined offset: 3
2014-11-16 14:10:48 mw1215 frwiki: [c70e563f] /w/index.php?title=Trait%C3%A9_de_Saint-Germain-en-Laye_(1624)&action=edit&redlink=1 ErrorException from line 584 of /sr
v/mediawiki/php-1.25wmf7/includes/Sanitizer.php: Undefined offset: 2
2014-11-16 14:10:48 mw1215 frwiki: [f2c7bad0] /w/index.php?title=Trait%C3%A9_de_Saint-Germain-en-Laye_(1624)&action=edit&redlink=1 ErrorException from line 584 of /sr
v/mediawiki/php-1.25wmf7/includes/Sanitizer.php: Undefined offset: 1

				preg_match(
					'/^(\\/?)(\\w+)([^>]*?)(\\/{0,1}>)([^<]*)$/',
					$x,
					$regs
				);

				wfSuppressWarnings();
				list( /* $qbar */, $slash, $t, $params, $brace, $rest ) = $regs;
				wfRestoreWarnings();

I note this is still being logged even though we're suppressing warnings. I guess that's a different bug. But this code should be checking if preg_match even worked....


Version: 1.25-git
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:47 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz73487.
bzimport added a subscriber: Unknown Object (MLST).

Change 192070 had a related patch set uploaded (by Umherirrender):
Check return value of preg_match in Sanitizer.php

https://gerrit.wikimedia.org/r/192070

Patch-For-Review

Change 192070 merged by jenkins-bot:
Check return value of preg_match in Sanitizer.php

https://gerrit.wikimedia.org/r/192070

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:12 PM