Make WordPress Core

Ticket #13317: 13317-better-not-propagate-absint.patch

File 13317-better-not-propagate-absint.patch, 26.5 KB (added by hakre, 15 years ago)
  • wordpress/wp-admin/includes/comment.php

     
    123123                if ( empty($pending) )
    124124                        return 0;
    125125                else
    126                         return absint($pending[0]['num_comments']);
     126                        return abs( (int)$pending[0]['num_comments']);
    127127        }
    128128
    129129        $pending_keyed = array();
     
    134134
    135135        if ( !empty($pending) )
    136136                foreach ( $pending as $pend )
    137                         $pending_keyed[$pend['comment_post_ID']] = absint($pend['num_comments']);
     137                        $pending_keyed[$pend['comment_post_ID']] = abs( (int)$pend['num_comments']);
    138138
    139139        return $pending_keyed;
    140140}
  • wordpress/wp-admin/includes/nav-menu.php

     
    506506
    507507        // paginate browsing for large numbers of post objects
    508508        $per_page = 50;
    509         $pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
     509        $pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? abs( (int) $_REQUEST['paged'] ) : 1;
    510510        $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
    511511
    512512        $args = array(
     
    696696       
    697697        // paginate browsing for large numbers of objects
    698698        $per_page = 50;
    699         $pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
     699        $pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? abs( (int) $_REQUEST['paged'] ) : 1;
    700700        $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
    701701
    702702        $args = array(
  • wordpress/wp-admin/includes/template.php

     
    137137                switch ($column_name) {
    138138                        case 'cb':
    139139                                $output .= "<th scope='row' class='check-column'>";
    140                                 if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) {
     140                                if ( abs( (int) get_option( 'default_link_category' ) ) != $category->term_id ) {
    141141                                        $output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />";
    142142                                } else {
    143143                                        $output .= "&nbsp;";
  • wordpress/wp-admin/admin-ajax.php

     
    745745        if ( '' == $comment_content )
    746746                die( __('Error: please type a comment.') );
    747747
    748         $comment_parent = absint($_POST['comment_ID']);
     748        $comment_parent = abs( (int)$_POST['comment_ID']);
    749749        $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
    750750
    751751        $comment_id = wp_new_comment( $commentdata );
  • wordpress/wp-admin/comment.php

     
    4848        wp_enqueue_script('comment');
    4949        require_once('./admin-header.php');
    5050
    51         $comment_id = absint( $_GET['c'] );
     51        $comment_id = abs( (int) $_GET['c'] );
    5252
    5353        if ( !$comment = get_comment( $comment_id ) )
    5454                comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'javascript:history.go(-1)') );
     
    7070case 'trash'   :
    7171case 'spam'    :
    7272
    73         $comment_id = absint( $_GET['c'] );
     73        $comment_id = abs( (int) $_GET['c'] );
    7474
    7575        if ( !$comment = get_comment_to_edit( $comment_id ) ) {
    7676                wp_redirect( admin_url('edit-comments.php?error=1') );
     
    194194case 'unspamcomment'    :
    195195case 'approvecomment'   :
    196196case 'unapprovecomment' :
    197         $comment_id = absint( $_REQUEST['c'] );
     197        $comment_id = abs( (int) $_REQUEST['c'] );
    198198
    199199        if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
    200200                check_admin_referer( 'approve-comment_' . $comment_id );
     
    213213        elseif ( '' != wp_get_original_referer() && ! $noredir )
    214214                $redir = wp_get_original_referer();
    215215        elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
    216                 $redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
     216                $redir = admin_url('edit-comments.php?p=' . abs( (int) $comment->comment_post_ID ) );
    217217        else
    218218                $redir = admin_url('edit-comments.php');
    219219
     
    256256
    257257case 'editedcomment' :
    258258
    259         $comment_id = absint( $_POST['comment_ID'] );
    260         $comment_post_id = absint( $_POST['comment_post_ID'] );
     259        $comment_id = abs( (int) $_POST['comment_ID'] );
     260        $comment_post_id = abs( (int) $_POST['comment_post_ID'] );
    261261
    262262        check_admin_referer( 'update-comment_' . $comment_id );
    263263
  • wordpress/wp-admin/edit-comments.php

     
    223223                continue;
    224224        $link = add_query_arg( 'comment_status', $status, $link );
    225225        if ( $post_id )
    226                 $link = add_query_arg( 'p', absint( $post_id ), $link );
     226                $link = add_query_arg( 'p', abs( (int) $post_id ), $link );
    227227        /*
    228228        // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
    229229        if ( !empty( $_GET['s'] ) )
     
    352352<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
    353353
    354354<?php if ( isset($_GET['apage']) ) { ?>
    355         <input type="hidden" name="apage" value="<?php echo esc_attr( absint( $_GET['apage'] ) ); ?>" />
     355        <input type="hidden" name="apage" value="<?php echo esc_attr( abs( (int) $_GET['apage'] ) ); ?>" />
    356356<?php }
    357357
    358358if ( ( 'spam' == $comment_status || 'trash' == $comment_status) && current_user_can ('moderate_comments') ) {
  • wordpress/wp-admin/edit-form-advanced.php

     
    6666
    6767$message = false;
    6868if ( isset($_GET['message']) ) {
    69         $_GET['message'] = absint( $_GET['message'] );
     69        $_GET['message'] = abs( (int) $_GET['message'] );
    7070        if ( isset($messages[$post_type][$_GET['message']]) )
    7171                $message = $messages[$post_type][$_GET['message']];
    7272        elseif ( !isset($messages[$post_type]) && isset($messages['post'][$_GET['message']]) )
  • wordpress/wp-admin/edit-link-categories.php

     
    8989<div class="tablenav">
    9090
    9191<?php
    92 $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
     92$pagenum = isset( $_GET['pagenum'] ) ? abs( (int) $_GET['pagenum'] ) : 0;
    9393if ( empty($pagenum) )
    9494        $pagenum = 1;
    9595if ( ! isset( $catsperpage ) || $catsperpage < 0 )
  • wordpress/wp-admin/edit-tags.php

     
    208208<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
    209209<div class="tablenav">
    210210<?php
    211 $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
     211$pagenum = isset( $_GET['pagenum'] ) ? abs( (int) $_GET['pagenum'] ) : 0;
    212212if ( empty($pagenum) )
    213213        $pagenum = 1;
    214214
  • wordpress/wp-admin/edit.php

     
    4040        $post_new_file = 'post-new.php';
    4141}
    4242
    43 $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
     43$pagenum = isset( $_GET['paged'] ) ? abs( (int) $_GET['paged'] ) : 0;
    4444if ( empty($pagenum) )
    4545        $pagenum = 1;
    4646$per_page = 'edit_' . $post_type . '_per_page';
  • wordpress/wp-admin/ms-sites.php

     
    319319        // List sites
    320320        case 'list':
    321321        default:
    322                 $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
     322                $pagenum = isset( $_GET['paged'] ) ? abs( (int) $_GET['paged'] ) : 0;
    323323                if ( empty($pagenum) )
    324324                        $pagenum = 1;
    325325
  • wordpress/wp-admin/ms-users.php

     
    4848        <?php
    4949}
    5050
    51         $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
     51        $pagenum = isset( $_GET['paged'] ) ? abs( (int) $_GET['paged'] ) : 0;
    5252        if ( empty( $pagenum ) )
    5353                $pagenum = 1;
    5454
  • wordpress/wp-admin/revision.php

     
    1313
    1414wp_reset_vars(array('revision', 'left', 'right', 'diff', 'action'));
    1515
    16 $revision_id = absint($revision);
    17 $diff        = absint($diff);
    18 $left        = absint($left);
    19 $right       = absint($right);
     16$revision_id = abs( (int)$revision);
     17$diff        = abs( (int)$diff);
     18$left        = abs( (int)$left);
     19$right       = abs( (int)$right);
    2020
    2121$redirect = 'edit.php';
    2222
  • wordpress/wp-admin/themes.php

     
    7373$per_page = 15;
    7474
    7575if ( isset( $_GET['pagenum'] ) )
    76         $page = absint( $_GET['pagenum'] );
     76        $page = abs( (int) $_GET['pagenum'] );
    7777
    7878if ( empty($page) )
    7979        $page = 1;
  • wordpress/wp-includes/comment.php

     
    222222                return $cache;
    223223        }
    224224
    225         $post_id = absint($post_id);
     225        $post_id = abs( (int)$post_id);
    226226
    227227        if ( 'hold' == $status )
    228228                $approved = "comment_approved = '0'";
     
    264264                $orderby = 'comment_date_gmt';
    265265        }
    266266
    267         $number = absint($number);
    268         $offset = absint($offset);
     267        $number = abs( (int)$number);
     268        $offset = abs( (int)$offset);
    269269
    270270        if ( !empty($number) ) {
    271271                if ( $offset )
     
    12571257        elseif ( isset($commentdata['user_id']) )
    12581258                $commentdata['user_id'] = (int) $commentdata['user_id'];
    12591259
    1260         $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? absint($commentdata['comment_parent']) : 0;
     1260        $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? abs( (int)$commentdata['comment_parent']) : 0;
    12611261        $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : '';
    12621262        $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0;
    12631263
  • wordpress/wp-includes/default-widgets.php

     
    678678
    679679        function form( $instance ) {
    680680                $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
    681                 $number = isset($instance['number']) ? absint($instance['number']) : 5;
     681                $number = isset($instance['number']) ? abs( (int)$instance['number']) : 5;
    682682?>
    683683                <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
    684684                <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
  • wordpress/wp-includes/deprecated.php

     
    25132513        _deprecated_function( __FUNCTION__, '3.0' );
    25142514        return '';
    25152515}
     2516
     2517/**
     2518 * Converts value to nonnegative integer.
     2519 *
     2520 * @deprecated 3.0.0
     2521 * @since 2.5.0
     2522 *
     2523 * @param scalar|array $maybeint Data you wish to have convered to an nonnegative integer
     2524 * @return int An nonnegative integer
     2525 */
     2526function absint( $maybeint ) {
     2527        _deprecated_function( __FUNCTION__, '3.0' );
     2528        return abs( (int) $maybeint );
     2529}
  • wordpress/wp-includes/formatting.php

     
    24012401                case 'thread_comments_depth':
    24022402                case 'users_can_register':
    24032403                case 'start_of_week':
    2404                         $value = absint( $value );
     2404                        $value = abs( (int) $value );
    24052405                        break;
    24062406
    24072407                case 'embed_size_w':
    24082408                        if ( '' !== $value )
    2409                                 $value = absint( $value );
     2409                                $value = abs( (int) $value );
    24102410                        break;
    24112411
    24122412                case 'posts_per_page':
  • wordpress/wp-includes/functions.php

     
    136136 */
    137137function number_format_i18n( $number, $decimals = 0 ) {
    138138        global $wp_locale;
    139         $formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
     139        $formatted = number_format( $number, abs( (int) $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
    140140        return apply_filters( 'number_format_i18n', $formatted );
    141141}
    142142
     
    15101510function get_status_header_desc( $code ) {
    15111511        global $wp_header_to_desc;
    15121512
    1513         $code = absint( $code );
     1513        $code = abs( (int) $code );
    15141514
    15151515        if ( !isset( $wp_header_to_desc ) ) {
    15161516                $wp_header_to_desc = array(
     
    31283128}
    31293129
    31303130/**
    3131  * Converts value to nonnegative integer.
    3132  *
    3133  * @since 2.5.0
    3134  *
    3135  * @param mixed $maybeint Data you wish to have convered to an nonnegative integer
    3136  * @return int An nonnegative integer
    3137  */
    3138 function absint( $maybeint ) {
    3139         return abs( intval( $maybeint ) );
    3140 }
    3141 
    3142 /**
    31433131 * Determines if the blog can be accessed over SSL.
    31443132 *
    31453133 * Determines if blog can be accessed over SSL by using cURL to access the site
  • wordpress/wp-includes/general-template.php

     
    877877                $type = 'monthly';
    878878
    879879        if ( '' != $limit ) {
    880                 $limit = absint($limit);
     880                $limit = abs( (int)$limit);
    881881                $limit = ' LIMIT '.$limit;
    882882        }
    883883
  • wordpress/wp-includes/media.php

     
    179179 */
    180180function add_image_size( $name, $width = 0, $height = 0, $crop = FALSE ) {
    181181        global $_wp_additional_image_sizes;
    182         $_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => !!$crop );
     182        $_wp_additional_image_sizes[$name] = array( 'width' => abs( (int) $width ), 'height' => abs( (int) $height ), 'crop' => !!$crop );
    183183}
    184184
    185185/**
  • wordpress/wp-includes/meta.php

     
    3232        if ( !$meta_type || !$meta_key )
    3333                return false;
    3434
    35         if ( !$object_id = absint($object_id) )
     35        if ( !$object_id = abs( (int)$object_id) )
    3636                return false;
    3737
    3838        if ( ! $table = _get_meta_table($meta_type) )
     
    9292        if ( !$meta_type || !$meta_key )
    9393                return false;
    9494
    95         if ( !$object_id = absint($object_id) )
     95        if ( !$object_id = abs( (int)$object_id) )
    9696                return false;
    9797
    9898        if ( ! $table = _get_meta_table($meta_type) )
     
    164164        if ( !$meta_type || !$meta_key )
    165165                return false;
    166166
    167         if ( (!$object_id = absint($object_id)) && !$delete_all )
     167        if ( (!$object_id = abs( (int)$object_id)) && !$delete_all )
    168168                return false;
    169169
    170170        if ( ! $table = _get_meta_table($meta_type) )
     
    224224        if ( !$meta_type )
    225225                return false;
    226226
    227         if ( !$object_id = absint($object_id) )
     227        if ( !$object_id = abs( (int)$object_id) )
    228228                return false;
    229229
    230230        $meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
  • wordpress/wp-includes/pluggable.php

     
    103103function get_userdata( $user_id ) {
    104104        global $wpdb;
    105105
    106         $user_id = absint( $user_id );
     106        $user_id = abs( (int) $user_id );
    107107        if ( ! $user_id )
    108108                return false;
    109109
  • wordpress/wp-includes/post.php

     
    13411341function is_sticky($post_id = null) {
    13421342        global $id;
    13431343
    1344         $post_id = absint($post_id);
     1344        $post_id = abs( (int)$post_id);
    13451345
    13461346        if ( !$post_id )
    1347                 $post_id = absint($id);
     1347                $post_id = abs( (int)$id);
    13481348
    13491349        $stickies = get_option('sticky_posts');
    13501350
  • wordpress/wp-includes/query.php

     
    12531253                if ( ! empty($qv['robots']) )
    12541254                        $this->is_robots = true;
    12551255
    1256                 $qv['p'] =  absint($qv['p']);
    1257                 $qv['page_id'] =  absint($qv['page_id']);
    1258                 $qv['year'] = absint($qv['year']);
    1259                 $qv['monthnum'] = absint($qv['monthnum']);
    1260                 $qv['day'] = absint($qv['day']);
    1261                 $qv['w'] = absint($qv['w']);
    1262                 $qv['m'] = absint($qv['m']);
    1263                 $qv['paged'] = absint($qv['paged']);
     1256                $qv['p'] =  abs( (int)$qv['p']);
     1257                $qv['page_id'] =  abs( (int)$qv['page_id']);
     1258                $qv['year'] = abs( (int)$qv['year']);
     1259                $qv['monthnum'] = abs( (int)$qv['monthnum']);
     1260                $qv['day'] = abs( (int)$qv['day']);
     1261                $qv['w'] = abs( (int)$qv['w']);
     1262                $qv['m'] = abs( (int)$qv['m']);
     1263                $qv['paged'] = abs( (int)$qv['paged']);
    12641264                $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers
    12651265                $qv['pagename'] = trim( $qv['pagename'] );
    12661266                $qv['name'] = trim( $qv['name'] );
    1267                 if ( '' !== $qv['hour'] ) $qv['hour'] = absint($qv['hour']);
    1268                 if ( '' !== $qv['minute'] ) $qv['minute'] = absint($qv['minute']);
    1269                 if ( '' !== $qv['second'] ) $qv['second'] = absint($qv['second']);
     1267                if ( '' !== $qv['hour'] ) $qv['hour'] = abs( (int)$qv['hour']);
     1268                if ( '' !== $qv['minute'] ) $qv['minute'] = abs( (int)$qv['minute']);
     1269                if ( '' !== $qv['second'] ) $qv['second'] = abs( (int)$qv['second']);
    12701270
    12711271                // Compat.  Map subpost to attachment.
    12721272                if ( '' != $qv['subpost'] )
     
    12741274                if ( '' != $qv['subpost_id'] )
    12751275                        $qv['attachment_id'] = $qv['subpost_id'];
    12761276
    1277                 $qv['attachment_id'] = absint($qv['attachment_id']);
     1277                $qv['attachment_id'] = abs( (int)$qv['attachment_id']);
    12781278
    12791279                if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) {
    12801280                        $this->is_single = true;
     
    13851385                        if (  '' != $qv['tag'] )
    13861386                                $this->is_tag = true;
    13871387
    1388                         $qv['tag_id'] = absint($qv['tag_id']);
     1388                        $qv['tag_id'] = abs( (int)$qv['tag_id']);
    13891389                        if (  !empty($qv['tag_id']) )
    13901390                                $this->is_tag = true;
    13911391
     
    16851685
    16861686                if ( isset($q['page']) ) {
    16871687                        $q['page'] = trim($q['page'], '/');
    1688                         $q['page'] = absint($q['page']);
     1688                        $q['page'] = abs( (int)$q['page']);
    16891689                }
    16901690
    16911691                // If true, forcibly turns off SQL_CALC_FOUND_ROWS even when limits are present.
     
    18041804                        $where .= ' AND ' . _wp_mysql_week( "`$wpdb->posts`.`post_date`" ) . " = '" . $q['w'] . "'";
    18051805
    18061806                if ( intval($q['comments_popup']) )
    1807                         $q['p'] = absint($q['comments_popup']);
     1807                        $q['p'] = abs( (int)$q['comments_popup']);
    18081808
    18091809                // If an attachment is requested by number, let it supercede any post number.
    18101810                if ( $q['attachment_id'] )
    1811                         $q['p'] = absint($q['attachment_id']);
     1811                        $q['p'] = abs( (int)$q['attachment_id']);
    18121812
    18131813                // If a post number is specified, load that post
    18141814                if ( $q['p'] ) {
     
    20822082                        $author_array = preg_split('/[,\s]+/', $q['author']);
    20832083                        $_author_array = array();
    20842084                        foreach ( $author_array as $key => $_author )
    2085                                 $_author_array[] = "$wpdb->posts.post_author " . $eq . ' ' . absint($_author);
     2085                                $_author_array[] = "$wpdb->posts.post_author " . $eq . ' ' . abs( (int)$_author);
    20862086                        $whichauthor .= ' AND (' . implode(" $andor ", $_author_array) . ')';
    20872087                        unset($author_array, $_author_array);
    20882088                }
     
    21022102                        $q['author'] = get_user_by('slug', $q['author_name']);
    21032103                        if ( $q['author'] )
    21042104                                $q['author'] = $q['author']->ID;
    2105                         $whichauthor .= " AND ($wpdb->posts.post_author = " . absint($q['author']) . ')';
     2105                        $whichauthor .= " AND ($wpdb->posts.post_author = " . abs( (int)$q['author']) . ')';
    21062106                }
    21072107
    21082108                // MIME-Type stuff for attachment browsing
     
    23162316
    23172317                // Paging
    23182318                if ( empty($q['nopaging']) && !$this->is_singular ) {
    2319                         $page = absint($q['paged']);
     2319                        $page = abs( (int)$q['paged']);
    23202320                        if ( empty($page) )
    23212321                                $page = 1;
    23222322
     
    23252325                                $pgstrt = ($page - 1) * $q['posts_per_page'] . ', ';
    23262326                                $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
    23272327                        } else { // we're ignoring $page and using 'offset'
    2328                                 $q['offset'] = absint($q['offset']);
     2328                                $q['offset'] = abs( (int)$q['offset']);
    23292329                                $pgstrt = $q['offset'] . ', ';
    23302330                                $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
    23312331                        }
  • wordpress/wp-includes/rewrite.php

     
    256256
    257257        // First, check to see if there is a 'p=N' or 'page_id=N' to match against
    258258        if ( preg_match('#[?&](p|page_id|attachment_id)=(\d+)#', $url, $values) )       {
    259                 $id = absint($values[2]);
     259                $id = abs( (int)$values[2]);
    260260                if ( $id )
    261261                        return $id;
    262262        }
  • wordpress/wp-includes/taxonomy.php

     
    814814                'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '',
    815815                'pad_counts' => false, 'offset' => '', 'search' => '');
    816816        $args = wp_parse_args( $args, $defaults );
    817         $args['number'] = absint( $args['number'] );
    818         $args['offset'] = absint( $args['offset'] );
     817        $args['number'] = abs( (int) $args['number'] );
     818        $args['offset'] = abs( (int) $args['offset'] );
    819819        if ( !$single_taxonomy || !is_taxonomy_hierarchical($taxonomies[0]) ||
    820820                '' !== $args['parent'] ) {
    821821                $args['child_of'] = 0;
  • wordpress/wp-includes/theme.php

     
    757757 * @return string
    758758 */
    759759function get_author_template() {
    760         $author_id = absint( get_query_var( 'author' ) );
     760        $author_id = abs( (int) get_query_var( 'author' ) );
    761761        $author = get_user_by( 'id', $author_id );
    762762        $author = $author->user_nicename;
    763763
     
    786786 * @return string
    787787 */
    788788function get_category_template() {
    789         $cat_ID = absint( get_query_var('cat') );
     789        $cat_ID = abs( (int) get_query_var('cat') );
    790790        $category = get_category( $cat_ID );
    791791
    792792        $templates = array();
     
    814814 * @return string
    815815 */
    816816function get_tag_template() {
    817         $tag_id = absint( get_query_var('tag_id') );
     817        $tag_id = abs( (int) get_query_var('tag_id') );
    818818        $tag_name = get_query_var('tag');
    819819
    820820        $templates = array();
  • wordpress/wp-comments-post.php

     
    8383if ( '' == $comment_content )
    8484        wp_die( __('Error: please type a comment.') );
    8585
    86 $comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0;
     86$comment_parent = isset($_POST['comment_parent']) ? abs( (int)$_POST['comment_parent']) : 0;
    8787
    8888$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
    8989
  • wordpress/wp-links-opml.php

     
    2222if ( !empty($_GET['link_cat']) ) {
    2323        $link_cat = $_GET['link_cat'];
    2424        if ( !in_array($link_cat, array('all', '0')) )
    25                 $link_cat = absint( (string)urldecode($link_cat) );
     25                $link_cat = abs( (int) (string)urldecode($link_cat) );
    2626}
    2727
    2828echo '<?xml version="1.0"?'.">\n";
  • wordpress/xmlrpc.php

     
    10981098
    10991099                $post_id = '';
    11001100                if ( isset($struct['post_id']) )
    1101                         $post_id = absint($struct['post_id']);
     1101                        $post_id = abs( (int)$struct['post_id']);
    11021102
    11031103                $offset = 0;
    11041104                if ( isset($struct['offset']) )
    1105                         $offset = absint($struct['offset']);
     1105                        $offset = abs( (int)$struct['offset']);
    11061106
    11071107                $number = 10;
    11081108                if ( isset($struct['number']) )
    1109                         $number = absint($struct['number']);
     1109                        $number = abs( (int)$struct['number']);
    11101110
    11111111                $comments = get_comments( array('status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) );
    11121112                $num_comments = count($comments);
     
    12591259                }
    12601260
    12611261                if ( is_numeric($post) )
    1262                         $post_id = absint($post);
     1262                        $post_id = abs( (int)$post);
    12631263                else
    12641264                        $post_id = url_to_postid($post);
    12651265
     
    12991299                        }
    13001300                }
    13011301
    1302                 $comment['comment_parent'] = isset($content_struct['comment_parent']) ? absint($content_struct['comment_parent']) : 0;
     1302                $comment['comment_parent'] = isset($content_struct['comment_parent']) ? abs( (int)$content_struct['comment_parent']) : 0;
    13031303
    13041304                $comment['comment_content'] = $content_struct['content'];
    13051305