diff options
author | Simon Rettberg | 2017-12-16 18:33:16 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-12-16 18:33:16 +0100 |
commit | cd55ead3e2810e209b726faca12fa749f6875d0f (patch) | |
tree | 94b2f29b023e8a0c5100e1d06c974c3c04f890fd /modules-available/sysconfig/addmodule_branding.inc.php | |
parent | Merge branch 'permission-manager' of openslx.org:openslx-ng/slx-admin into pe... (diff) | |
download | slx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.tar.gz slx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.tar.xz slx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.zip |
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.
Diffstat (limited to 'modules-available/sysconfig/addmodule_branding.inc.php')
-rw-r--r-- | modules-available/sysconfig/addmodule_branding.inc.php | 6 |
1 files changed, 4 insertions, 2 deletions
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('#<title>([^<]*)</title>#i', $content, $tout)) + if ($title === false && preg_match('#<title>([^<]*)</title>#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; |