dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1998993
)
Check result of preg_match_all in Parser.php
author
umherirrender
<umherirrender_de.wp@web.de>
Tue, 12 May 2015 18:43:59 +0000
(20:43 +0200)
committer
Umherirrender
<umherirrender_de.wp@web.de>
Fri, 29 May 2015 05:16:08 +0000
(
05:16
+0000)
preg_match_all can return false on failure, which than results in
undefined index access.
Check the result and just keep it as nothing found by processing an
empty array
Change-Id: I1f11894240dc6869506d68d3513715abdc3abb5d
includes/parser/Parser.php
patch
|
blob
|
history
diff --git
a/includes/parser/Parser.php
b/includes/parser/Parser.php
index
27de039
..
4ea68fc
100644
(file)
--- a/
includes/parser/Parser.php
+++ b/
includes/parser/Parser.php
@@
-4446,7
+4446,9
@@
class Parser {
$tocraw = array();
$refers = array();
- foreach ( $matches[3] as $headline ) {
+ $headlines = $numMatches !== false ? $matches[3] : array();
+
+ foreach ( $headlines as $headline ) {
$isTemplate = false;
$titleText = false;
$sectionIndex = false;