viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]
diff --git a/src/controllers/AdminController.php b/src/controllers/AdminController.php index 09b58ff48..aa00d64f9 100755 --- a/src/controllers/AdminController.php +++ b/src/controllers/AdminController.php @@ -383,7 +383,7 @@ class AdminController extends Controller implements CrawlConstants $_SESSION['HIDE_ACTIVITIES'] = (empty( $_SESSION['HIDE_ACTIVITIES'])) ? true : false; if (!empty($_SESSION['USER_ID']) && - L\positiveInt($_SESSION['USER_ID'])) { + L\isPositiveInteger($_SESSION['USER_ID'])) { $this->model("user")->setUserSession($_SESSION['USER_ID'], $_SESSION); } diff --git a/src/controllers/Controller.php b/src/controllers/Controller.php index e7353fe95..4701a8f9c 100755 --- a/src/controllers/Controller.php +++ b/src/controllers/Controller.php @@ -1034,7 +1034,8 @@ abstract class Controller public function recordViewSession($page_id, $sub_path, $media_name) { $hash_id = L\crawlHash($page_id . $media_name . $sub_path); - if (empty($_SESSION['USER_ID'])||!L\positiveInt($_SESSION['USER_ID'])|| + if (empty($_SESSION['USER_ID'])|| + !L\isPositiveInteger($_SESSION['USER_ID']) || $_SESSION['USER_ID'] == C\PUBLIC_USER_ID || !empty($_REQUEST['t'])){ return; } diff --git a/src/controllers/GroupController.php b/src/controllers/GroupController.php index 7ccb4951b..64a8da6a3 100644 --- a/src/controllers/GroupController.php +++ b/src/controllers/GroupController.php @@ -142,7 +142,7 @@ class GroupController extends Controller implements CrawlConstants } $_SESSION['HIDE_ACTIVITIES'] = false; if (!empty($_SESSION['USER_ID']) && - L\positiveInt($_SESSION['USER_ID'])) { + L\isPositiveInteger($_SESSION['USER_ID'])) { $this->model("user")->setUserSession($_SESSION['USER_ID'], $_SESSION); } diff --git a/src/controllers/SettingsController.php b/src/controllers/SettingsController.php index 9fce52ce1..9d7a5c6a4 100755 --- a/src/controllers/SettingsController.php +++ b/src/controllers/SettingsController.php @@ -136,7 +136,7 @@ class SettingsController extends Controller $data['its'] = $crawl_model->getCurrentIndexDatabaseName(); } if ($changed_settings_flag) { - if (L\positiveInt($user)) { + if (L\isPositiveInteger($user)) { $this->model("user")->setUserSession($user, $_SESSION); } return $this->redirectWithMessage( diff --git a/src/library/LocaleFunctions.php b/src/library/LocaleFunctions.php old mode 100755 new mode 100644 diff --git a/src/library/Utility.php b/src/library/Utility.php index 99f5c7666..4eb6a62cd 100755 --- a/src/library/Utility.php +++ b/src/library/Utility.php @@ -2374,7 +2374,7 @@ function bchexdec($hex) * @param mixed $input * @return bool whether $input can be parsed to a positive integer. */ -function positiveInt($input) +function isPositiveInteger($input) { return (is_int($input) && $input > 0) || (is_string($input) &&