From cd55ead3e2810e209b726faca12fa749f6875d0f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sat, 16 Dec 2017 18:33:16 +0100 Subject: Fix A LOT of type problems, logic flaws, uninitialized variables etc. Most of them were found by phpstorm, so I put in some time and went through the list, fixing quite a bunch of them. --- modules-available/sysconfig/addmodule_branding.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules-available/sysconfig/addmodule_branding.inc.php') diff --git a/modules-available/sysconfig/addmodule_branding.inc.php b/modules-available/sysconfig/addmodule_branding.inc.php index c2f9e690..6e628926 100644 --- a/modules-available/sysconfig/addmodule_branding.inc.php +++ b/modules-available/sysconfig/addmodule_branding.inc.php @@ -116,8 +116,10 @@ class Branding_ProcessFile extends AddModule_Base // [wikipedia] Try to be nice and detect links that might give a hint where the svg can be found if (preg_match_all('#href="([^"]*upload.wikimedia.org/[^"]*/[^"]*/[^"]*\.svg|[^"]+/[^"]+:[^"]+\.svg[^"]*)"#', $content, $out, PREG_PATTERN_ORDER)) { - if ($title === false && preg_match('#([^<]*)#i', $content, $tout)) + if ($title === false && preg_match('#([^<]*)#i', $content, $tout)) { $title = trim(preg_replace('/\W*Wikipedia.*/', '', $tout[1])); + } + $new = false; foreach ($out[1] as $res) { if (strpos($res, 'action=edit') !== false) continue; @@ -125,7 +127,7 @@ class Branding_ProcessFile extends AddModule_Base if ($new !== $url) break; } - if ($new === $url) + if ($new === $url || $new === false) break; $url = $new; continue; -- cgit v1.2.3-55-g7522