Switch from abs(intval()) to absint(). See #4762.

git-svn-id: https://develop.svn.wordpress.org/trunk@6682 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood
2008-01-29 18:48:38 +00:00
parent 890a2f8ed7
commit 4f1971cfdb
6 changed files with 7 additions and 7 deletions

View File

@@ -369,7 +369,7 @@ function wp_get_archives($args = '') {
$type = 'monthly';
if ( '' != $limit ) {
$limit = abs(intval($limit));
$limit = absint($limit);
$limit = ' LIMIT '.$limit;
}

View File

@@ -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;

View File

@@ -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'];
}