From 3511711008cc2de1e4964ca0454c71e4235627da Mon Sep 17 00:00:00 2001 From: jgen Date: Thu, 12 Mar 2015 23:12:06 -0700 Subject: [PATCH] Should be consistent about using the int_escape method. --- core/event.class.php | 2 +- ext/arrowkey_navigation/main.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/event.class.php b/core/event.class.php index 5012ca30..c06ff99d 100644 --- a/core/event.class.php +++ b/core/event.class.php @@ -118,7 +118,7 @@ class PageRequestEvent extends Event { * @return int */ public function count_args() { - return (int)($this->arg_count - $this->part_count); + return int_escape($this->arg_count - $this->part_count); } /* diff --git a/ext/arrowkey_navigation/main.php b/ext/arrowkey_navigation/main.php index b808c90f..356e1ec6 100644 --- a/ext/arrowkey_navigation/main.php +++ b/ext/arrowkey_navigation/main.php @@ -69,13 +69,13 @@ class ArrowkeyNavigation extends Extension { // if there are no tags, use default if ($event->get_arg(1) == null){ $prefix = ""; - $page_number = (int)$event->get_arg(0); + $page_number = int_escape($event->get_arg(0)); $total_pages = ceil($database->get_one( "SELECT COUNT(*) FROM images") / $images_per_page); } else { // if there are tags, use pages with tags $prefix = $event->get_arg(0)."/"; - $page_number = (int)$event->get_arg(1); + $page_number = int_escape($event->get_arg(1)); $total_pages = ceil($database->get_one( "SELECT count FROM tags WHERE tag=:tag", array("tag"=>$event->get_arg(0))) / $images_per_page);