diff --git a/classes/util.php b/classes/util.php index c4f2051c..1934a270 100644 --- a/classes/util.php +++ b/classes/util.php @@ -8,12 +8,17 @@ * @param string $Str * @return true if $Str numeric */ -function is_number($Str) { - $Return = true; - if ($Str < 0) { $Return = false; } - // We're converting input to a int, then string and comparing to original - $Return = ($Str == strval(intval($Str)) ? true : false); - return $Return; +if (PHP_INT_SIZE === 4) { + function is_number($Str) { + if ($Str[0] == '-' || $Str[0] == '+') { // Leading plus/minus signs are ok + $Str[0] = 0; + } + return ltrim($Str, "0..9") === ''; + } +} else { + function is_number($Str) { + return $Str == strval(intval($Str)); + } } diff --git a/sections/torrents/browse2.php b/sections/torrents/browse2.php index dea2a80e..4df16363 100644 --- a/sections/torrents/browse2.php +++ b/sections/torrents/browse2.php @@ -535,18 +535,17 @@ function header_link($SortKey,$DefaultWay="desc") { } /** End run search query and collect results **/ +$HideFilter = isset($LoggedUser['ShowTorFilter']) && $LoggedUser['ShowTorFilter'] == 0; // This is kinda ugly, but the enormous if paragraph was really hard to read $AdvancedSearch = !empty($_GET['action']) && $_GET['action'] == "advanced"; $AdvancedSearch |= !empty($LoggedUser['SearchType']) && (empty($_GET['action']) || $_GET['action'] == "advanced"); $AdvancedSearch &= check_perms('site_advanced_search'); if ($AdvancedSearch) { - $Debug->log_var(1, 'Advanced search'); $Action = 'action=advanced'; $HideBasic = ' hidden'; $HideAdvanced = ''; } else { - $Debug->log_var(1, 'Basic search'); $Action = 'action=basic'; $HideBasic = ''; $HideAdvanced = ' hidden'; @@ -561,7 +560,7 @@ function header_link($SortKey,$DefaultWay="desc") {