浏览代码

Empty Strings Don't Need Cleanup

PHP 8.1 is a real stickler about this.
Andy 3 年之前
父节点
当前提交
474f469a4a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      include/init.php

+ 2 - 1
include/init.php

@@ -520,7 +520,8 @@ switch (PAGE_NAME) {
 
         // sanitize just in case...
         //
-        $templateid = preg_replace('/(\.\.\/){1,}/', '', $templateid);
+        if (!empty($templateid))
+            $templateid = preg_replace('/(\.\.\/){1,}/', '', $templateid);
 
         // make sure given template actually is available
         //