From 520d17d7f0d23af218f00eda964efaaf1ef3df59 Mon Sep 17 00:00:00 2001 From: westi Date: Tue, 29 Jan 2008 18:48:38 +0000 Subject: [PATCH] Switch from abs(intval()) to absint(). See #4762. git-svn-id: http://svn.automattic.com/wordpress/trunk@6682 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/import/btt.php | 2 +- wp-admin/import/jkw.php | 2 +- wp-includes/general-template.php | 2 +- wp-includes/pluggable.php | 2 +- wp-includes/query.php | 4 ++-- wp-settings.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-admin/import/btt.php b/wp-admin/import/btt.php index 9a2dacf6b..8ddabd42b 100644 --- a/wp-admin/import/btt.php +++ b/wp-admin/import/btt.php @@ -29,7 +29,7 @@ class BunnyTags_Import { if ( empty($_GET['step']) ) $step = 0; else - $step = abs(intval($_GET['step'])); + $step = absint($_GET['step']); // load the header $this->header(); diff --git a/wp-admin/import/jkw.php b/wp-admin/import/jkw.php index c9bffd2a3..16012bf62 100644 --- a/wp-admin/import/jkw.php +++ b/wp-admin/import/jkw.php @@ -33,7 +33,7 @@ class JeromesKeyword_Import { if ( empty($_GET['step']) ) $step = 0; else - $step = abs(intval($_GET['step'])); + $step = absint($_GET['step']); // load the header $this->header(); diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index ff6ad6402..c06c27dbd 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -369,7 +369,7 @@ function wp_get_archives($args = '') { $type = 'monthly'; if ( '' != $limit ) { - $limit = abs(intval($limit)); + $limit = absint($limit); $limit = ' LIMIT '.$limit; } diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 181846138..f1901eacf 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -120,7 +120,7 @@ if ( !function_exists('get_userdata') ) : function get_userdata( $user_id ) { global $wpdb; - $user_id = abs(intval($user_id)); + $user_id = absint($user_id); if ( $user_id == 0 ) return false; diff --git a/wp-includes/query.php b/wp-includes/query.php index 02d96bec1..f6bf038e8 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1196,7 +1196,7 @@ class WP_Query { // Paging if ( empty($q['nopaging']) && !$this->is_singular ) { - $page = abs(intval($q['paged'])); + $page = absint($q['paged']); if (empty($page)) { $page = 1; } @@ -1206,7 +1206,7 @@ class WP_Query { $pgstrt = (intval($page) -1) * $q['posts_per_page'] . ', '; $limits = 'LIMIT '.$pgstrt.$q['posts_per_page']; } else { // we're ignoring $page and using 'offset' - $q['offset'] = abs(intval($q['offset'])); + $q['offset'] = absint($q['offset']); $pgstrt = $q['offset'] . ', '; $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page']; } diff --git a/wp-settings.php b/wp-settings.php index 5fc0cf53c..8732710ff 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -12,7 +12,7 @@ if ( !defined('WP_MEMORY_LIMIT') ) define('WP_MEMORY_LIMIT', '32M'); -if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) ) +if ( function_exists('memory_get_usage') && ( (int) @ini_get('memory_limit') < absint(WP_MEMORY_LIMIT) ) ) @ini_set('memory_limit', WP_MEMORY_LIMIT); /**