Browse code

includes/characterlist.php: remove the duplicate isNumber() - two identical top-level declarations are a parse-time fatal (Cannot redeclare) in every PHP version, so the file cannot run with both copies present

Danilo Stern-Sapad authored on 2026/11/12 11:31:34
Showing 1 changed files
... ...
@@ -14,14 +14,6 @@ function isNumber($num) {
14 14
 	return (preg_match("/^[0-9]+$/", $num) || $num == "-1" ? true : false);
15 15
 }
16 16
 
17
-// Checks that the given $num is actually a number.  Used to help prevent XSS attacks.
18
-// Peculiar... Leaving both copies of the same exact function in this file prevents
19
-// breakage of the character list when using the category list for tinyMCE 4.x and newer...
20
-function isNumber($num) {
21
-	if(empty($num)) return false;
22
-	return (preg_match("/^[0-9]+$/", $num) || $num == "-1" ? true : false);
23
-}
24
-
25 17
 $catid = isset($_GET['catid']) ? explode(",", $_GET['catid']) : array(-1);
26 18
 $catid = array_filter($catid, "isNumber");
27 19
 $characters = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_characters WHERE ".(count($catid) > 1 ? "FIND_IN_SET(catid, '".implode(",", $catid)."') > 0" : "catid = '".$catid[0]."'")." ORDER BY charname");