Ticket #13317: 13317-better-not-propagate-absint.patch
File 13317-better-not-propagate-absint.patch, 26.5 KB (added by , 15 years ago) |
---|
-
wordpress/wp-admin/includes/comment.php
123 123 if ( empty($pending) ) 124 124 return 0; 125 125 else 126 return abs int($pending[0]['num_comments']);126 return abs( (int)$pending[0]['num_comments']); 127 127 } 128 128 129 129 $pending_keyed = array(); … … 134 134 135 135 if ( !empty($pending) ) 136 136 foreach ( $pending as $pend ) 137 $pending_keyed[$pend['comment_post_ID']] = abs int($pend['num_comments']);137 $pending_keyed[$pend['comment_post_ID']] = abs( (int)$pend['num_comments']); 138 138 139 139 return $pending_keyed; 140 140 } -
wordpress/wp-admin/includes/nav-menu.php
506 506 507 507 // paginate browsing for large numbers of post objects 508 508 $per_page = 50; 509 $pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? abs int($_REQUEST['paged'] ) : 1;509 $pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? abs( (int) $_REQUEST['paged'] ) : 1; 510 510 $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0; 511 511 512 512 $args = array( … … 696 696 697 697 // paginate browsing for large numbers of objects 698 698 $per_page = 50; 699 $pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? abs int($_REQUEST['paged'] ) : 1;699 $pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? abs( (int) $_REQUEST['paged'] ) : 1; 700 700 $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0; 701 701 702 702 $args = array( -
wordpress/wp-admin/includes/template.php
137 137 switch ($column_name) { 138 138 case 'cb': 139 139 $output .= "<th scope='row' class='check-column'>"; 140 if ( abs int(get_option( 'default_link_category' ) ) != $category->term_id ) {140 if ( abs( (int) get_option( 'default_link_category' ) ) != $category->term_id ) { 141 141 $output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />"; 142 142 } else { 143 143 $output .= " "; -
wordpress/wp-admin/admin-ajax.php
745 745 if ( '' == $comment_content ) 746 746 die( __('Error: please type a comment.') ); 747 747 748 $comment_parent = abs int($_POST['comment_ID']);748 $comment_parent = abs( (int)$_POST['comment_ID']); 749 749 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); 750 750 751 751 $comment_id = wp_new_comment( $commentdata ); -
wordpress/wp-admin/comment.php
48 48 wp_enqueue_script('comment'); 49 49 require_once('./admin-header.php'); 50 50 51 $comment_id = abs int($_GET['c'] );51 $comment_id = abs( (int) $_GET['c'] ); 52 52 53 53 if ( !$comment = get_comment( $comment_id ) ) 54 54 comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'javascript:history.go(-1)') ); … … 70 70 case 'trash' : 71 71 case 'spam' : 72 72 73 $comment_id = abs int($_GET['c'] );73 $comment_id = abs( (int) $_GET['c'] ); 74 74 75 75 if ( !$comment = get_comment_to_edit( $comment_id ) ) { 76 76 wp_redirect( admin_url('edit-comments.php?error=1') ); … … 194 194 case 'unspamcomment' : 195 195 case 'approvecomment' : 196 196 case 'unapprovecomment' : 197 $comment_id = abs int($_REQUEST['c'] );197 $comment_id = abs( (int) $_REQUEST['c'] ); 198 198 199 199 if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) ) 200 200 check_admin_referer( 'approve-comment_' . $comment_id ); … … 213 213 elseif ( '' != wp_get_original_referer() && ! $noredir ) 214 214 $redir = wp_get_original_referer(); 215 215 elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) ) 216 $redir = admin_url('edit-comments.php?p=' . abs int($comment->comment_post_ID ) );216 $redir = admin_url('edit-comments.php?p=' . abs( (int) $comment->comment_post_ID ) ); 217 217 else 218 218 $redir = admin_url('edit-comments.php'); 219 219 … … 256 256 257 257 case 'editedcomment' : 258 258 259 $comment_id = abs int($_POST['comment_ID'] );260 $comment_post_id = abs int($_POST['comment_post_ID'] );259 $comment_id = abs( (int) $_POST['comment_ID'] ); 260 $comment_post_id = abs( (int) $_POST['comment_post_ID'] ); 261 261 262 262 check_admin_referer( 'update-comment_' . $comment_id ); 263 263 -
wordpress/wp-admin/edit-comments.php
223 223 continue; 224 224 $link = add_query_arg( 'comment_status', $status, $link ); 225 225 if ( $post_id ) 226 $link = add_query_arg( 'p', abs int($post_id ), $link );226 $link = add_query_arg( 'p', abs( (int) $post_id ), $link ); 227 227 /* 228 228 // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark 229 229 if ( !empty( $_GET['s'] ) ) … … 352 352 <input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" /> 353 353 354 354 <?php if ( isset($_GET['apage']) ) { ?> 355 <input type="hidden" name="apage" value="<?php echo esc_attr( abs int($_GET['apage'] ) ); ?>" />355 <input type="hidden" name="apage" value="<?php echo esc_attr( abs( (int) $_GET['apage'] ) ); ?>" /> 356 356 <?php } 357 357 358 358 if ( ( 'spam' == $comment_status || 'trash' == $comment_status) && current_user_can ('moderate_comments') ) { -
wordpress/wp-admin/edit-form-advanced.php
66 66 67 67 $message = false; 68 68 if ( isset($_GET['message']) ) { 69 $_GET['message'] = abs int($_GET['message'] );69 $_GET['message'] = abs( (int) $_GET['message'] ); 70 70 if ( isset($messages[$post_type][$_GET['message']]) ) 71 71 $message = $messages[$post_type][$_GET['message']]; 72 72 elseif ( !isset($messages[$post_type]) && isset($messages['post'][$_GET['message']]) ) -
wordpress/wp-admin/edit-link-categories.php
89 89 <div class="tablenav"> 90 90 91 91 <?php 92 $pagenum = isset( $_GET['pagenum'] ) ? abs int($_GET['pagenum'] ) : 0;92 $pagenum = isset( $_GET['pagenum'] ) ? abs( (int) $_GET['pagenum'] ) : 0; 93 93 if ( empty($pagenum) ) 94 94 $pagenum = 1; 95 95 if ( ! isset( $catsperpage ) || $catsperpage < 0 ) -
wordpress/wp-admin/edit-tags.php
208 208 <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" /> 209 209 <div class="tablenav"> 210 210 <?php 211 $pagenum = isset( $_GET['pagenum'] ) ? abs int($_GET['pagenum'] ) : 0;211 $pagenum = isset( $_GET['pagenum'] ) ? abs( (int) $_GET['pagenum'] ) : 0; 212 212 if ( empty($pagenum) ) 213 213 $pagenum = 1; 214 214 -
wordpress/wp-admin/edit.php
40 40 $post_new_file = 'post-new.php'; 41 41 } 42 42 43 $pagenum = isset( $_GET['paged'] ) ? abs int($_GET['paged'] ) : 0;43 $pagenum = isset( $_GET['paged'] ) ? abs( (int) $_GET['paged'] ) : 0; 44 44 if ( empty($pagenum) ) 45 45 $pagenum = 1; 46 46 $per_page = 'edit_' . $post_type . '_per_page'; -
wordpress/wp-admin/ms-sites.php
319 319 // List sites 320 320 case 'list': 321 321 default: 322 $pagenum = isset( $_GET['paged'] ) ? abs int($_GET['paged'] ) : 0;322 $pagenum = isset( $_GET['paged'] ) ? abs( (int) $_GET['paged'] ) : 0; 323 323 if ( empty($pagenum) ) 324 324 $pagenum = 1; 325 325 -
wordpress/wp-admin/ms-users.php
48 48 <?php 49 49 } 50 50 51 $pagenum = isset( $_GET['paged'] ) ? abs int($_GET['paged'] ) : 0;51 $pagenum = isset( $_GET['paged'] ) ? abs( (int) $_GET['paged'] ) : 0; 52 52 if ( empty( $pagenum ) ) 53 53 $pagenum = 1; 54 54 -
wordpress/wp-admin/revision.php
13 13 14 14 wp_reset_vars(array('revision', 'left', 'right', 'diff', 'action')); 15 15 16 $revision_id = abs int($revision);17 $diff = abs int($diff);18 $left = abs int($left);19 $right = abs int($right);16 $revision_id = abs( (int)$revision); 17 $diff = abs( (int)$diff); 18 $left = abs( (int)$left); 19 $right = abs( (int)$right); 20 20 21 21 $redirect = 'edit.php'; 22 22 -
wordpress/wp-admin/themes.php
73 73 $per_page = 15; 74 74 75 75 if ( isset( $_GET['pagenum'] ) ) 76 $page = abs int($_GET['pagenum'] );76 $page = abs( (int) $_GET['pagenum'] ); 77 77 78 78 if ( empty($page) ) 79 79 $page = 1; -
wordpress/wp-includes/comment.php
222 222 return $cache; 223 223 } 224 224 225 $post_id = abs int($post_id);225 $post_id = abs( (int)$post_id); 226 226 227 227 if ( 'hold' == $status ) 228 228 $approved = "comment_approved = '0'"; … … 264 264 $orderby = 'comment_date_gmt'; 265 265 } 266 266 267 $number = abs int($number);268 $offset = abs int($offset);267 $number = abs( (int)$number); 268 $offset = abs( (int)$offset); 269 269 270 270 if ( !empty($number) ) { 271 271 if ( $offset ) … … 1257 1257 elseif ( isset($commentdata['user_id']) ) 1258 1258 $commentdata['user_id'] = (int) $commentdata['user_id']; 1259 1259 1260 $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? abs int($commentdata['comment_parent']) : 0;1260 $commentdata['comment_parent'] = isset($commentdata['comment_parent']) ? abs( (int)$commentdata['comment_parent']) : 0; 1261 1261 $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status($commentdata['comment_parent']) : ''; 1262 1262 $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; 1263 1263 -
wordpress/wp-includes/default-widgets.php
678 678 679 679 function form( $instance ) { 680 680 $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; 681 $number = isset($instance['number']) ? abs int($instance['number']) : 5;681 $number = isset($instance['number']) ? abs( (int)$instance['number']) : 5; 682 682 ?> 683 683 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> 684 684 <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
2513 2513 _deprecated_function( __FUNCTION__, '3.0' ); 2514 2514 return ''; 2515 2515 } 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 */ 2526 function absint( $maybeint ) { 2527 _deprecated_function( __FUNCTION__, '3.0' ); 2528 return abs( (int) $maybeint ); 2529 } -
wordpress/wp-includes/formatting.php
2401 2401 case 'thread_comments_depth': 2402 2402 case 'users_can_register': 2403 2403 case 'start_of_week': 2404 $value = abs int($value );2404 $value = abs( (int) $value ); 2405 2405 break; 2406 2406 2407 2407 case 'embed_size_w': 2408 2408 if ( '' !== $value ) 2409 $value = abs int($value );2409 $value = abs( (int) $value ); 2410 2410 break; 2411 2411 2412 2412 case 'posts_per_page': -
wordpress/wp-includes/functions.php
136 136 */ 137 137 function number_format_i18n( $number, $decimals = 0 ) { 138 138 global $wp_locale; 139 $formatted = number_format( $number, abs int($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'] ); 140 140 return apply_filters( 'number_format_i18n', $formatted ); 141 141 } 142 142 … … 1510 1510 function get_status_header_desc( $code ) { 1511 1511 global $wp_header_to_desc; 1512 1512 1513 $code = abs int($code );1513 $code = abs( (int) $code ); 1514 1514 1515 1515 if ( !isset( $wp_header_to_desc ) ) { 1516 1516 $wp_header_to_desc = array( … … 3128 3128 } 3129 3129 3130 3130 /** 3131 * Converts value to nonnegative integer.3132 *3133 * @since 2.5.03134 *3135 * @param mixed $maybeint Data you wish to have convered to an nonnegative integer3136 * @return int An nonnegative integer3137 */3138 function absint( $maybeint ) {3139 return abs( intval( $maybeint ) );3140 }3141 3142 /**3143 3131 * Determines if the blog can be accessed over SSL. 3144 3132 * 3145 3133 * Determines if blog can be accessed over SSL by using cURL to access the site -
wordpress/wp-includes/general-template.php
877 877 $type = 'monthly'; 878 878 879 879 if ( '' != $limit ) { 880 $limit = abs int($limit);880 $limit = abs( (int)$limit); 881 881 $limit = ' LIMIT '.$limit; 882 882 } 883 883 -
wordpress/wp-includes/media.php
179 179 */ 180 180 function add_image_size( $name, $width = 0, $height = 0, $crop = FALSE ) { 181 181 global $_wp_additional_image_sizes; 182 $_wp_additional_image_sizes[$name] = array( 'width' => abs int( $width ), 'height' => absint($height ), 'crop' => !!$crop );182 $_wp_additional_image_sizes[$name] = array( 'width' => abs( (int) $width ), 'height' => abs( (int) $height ), 'crop' => !!$crop ); 183 183 } 184 184 185 185 /** -
wordpress/wp-includes/meta.php
32 32 if ( !$meta_type || !$meta_key ) 33 33 return false; 34 34 35 if ( !$object_id = abs int($object_id) )35 if ( !$object_id = abs( (int)$object_id) ) 36 36 return false; 37 37 38 38 if ( ! $table = _get_meta_table($meta_type) ) … … 92 92 if ( !$meta_type || !$meta_key ) 93 93 return false; 94 94 95 if ( !$object_id = abs int($object_id) )95 if ( !$object_id = abs( (int)$object_id) ) 96 96 return false; 97 97 98 98 if ( ! $table = _get_meta_table($meta_type) ) … … 164 164 if ( !$meta_type || !$meta_key ) 165 165 return false; 166 166 167 if ( (!$object_id = abs int($object_id)) && !$delete_all )167 if ( (!$object_id = abs( (int)$object_id)) && !$delete_all ) 168 168 return false; 169 169 170 170 if ( ! $table = _get_meta_table($meta_type) ) … … 224 224 if ( !$meta_type ) 225 225 return false; 226 226 227 if ( !$object_id = abs int($object_id) )227 if ( !$object_id = abs( (int)$object_id) ) 228 228 return false; 229 229 230 230 $meta_cache = wp_cache_get($object_id, $meta_type . '_meta'); -
wordpress/wp-includes/pluggable.php
103 103 function get_userdata( $user_id ) { 104 104 global $wpdb; 105 105 106 $user_id = abs int($user_id );106 $user_id = abs( (int) $user_id ); 107 107 if ( ! $user_id ) 108 108 return false; 109 109 -
wordpress/wp-includes/post.php
1341 1341 function is_sticky($post_id = null) { 1342 1342 global $id; 1343 1343 1344 $post_id = abs int($post_id);1344 $post_id = abs( (int)$post_id); 1345 1345 1346 1346 if ( !$post_id ) 1347 $post_id = abs int($id);1347 $post_id = abs( (int)$id); 1348 1348 1349 1349 $stickies = get_option('sticky_posts'); 1350 1350 -
wordpress/wp-includes/query.php
1253 1253 if ( ! empty($qv['robots']) ) 1254 1254 $this->is_robots = true; 1255 1255 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']);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']); 1264 1264 $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers 1265 1265 $qv['pagename'] = trim( $qv['pagename'] ); 1266 1266 $qv['name'] = trim( $qv['name'] ); 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']);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']); 1270 1270 1271 1271 // Compat. Map subpost to attachment. 1272 1272 if ( '' != $qv['subpost'] ) … … 1274 1274 if ( '' != $qv['subpost_id'] ) 1275 1275 $qv['attachment_id'] = $qv['subpost_id']; 1276 1276 1277 $qv['attachment_id'] = abs int($qv['attachment_id']);1277 $qv['attachment_id'] = abs( (int)$qv['attachment_id']); 1278 1278 1279 1279 if ( ('' != $qv['attachment']) || !empty($qv['attachment_id']) ) { 1280 1280 $this->is_single = true; … … 1385 1385 if ( '' != $qv['tag'] ) 1386 1386 $this->is_tag = true; 1387 1387 1388 $qv['tag_id'] = abs int($qv['tag_id']);1388 $qv['tag_id'] = abs( (int)$qv['tag_id']); 1389 1389 if ( !empty($qv['tag_id']) ) 1390 1390 $this->is_tag = true; 1391 1391 … … 1685 1685 1686 1686 if ( isset($q['page']) ) { 1687 1687 $q['page'] = trim($q['page'], '/'); 1688 $q['page'] = abs int($q['page']);1688 $q['page'] = abs( (int)$q['page']); 1689 1689 } 1690 1690 1691 1691 // If true, forcibly turns off SQL_CALC_FOUND_ROWS even when limits are present. … … 1804 1804 $where .= ' AND ' . _wp_mysql_week( "`$wpdb->posts`.`post_date`" ) . " = '" . $q['w'] . "'"; 1805 1805 1806 1806 if ( intval($q['comments_popup']) ) 1807 $q['p'] = abs int($q['comments_popup']);1807 $q['p'] = abs( (int)$q['comments_popup']); 1808 1808 1809 1809 // If an attachment is requested by number, let it supercede any post number. 1810 1810 if ( $q['attachment_id'] ) 1811 $q['p'] = abs int($q['attachment_id']);1811 $q['p'] = abs( (int)$q['attachment_id']); 1812 1812 1813 1813 // If a post number is specified, load that post 1814 1814 if ( $q['p'] ) { … … 2082 2082 $author_array = preg_split('/[,\s]+/', $q['author']); 2083 2083 $_author_array = array(); 2084 2084 foreach ( $author_array as $key => $_author ) 2085 $_author_array[] = "$wpdb->posts.post_author " . $eq . ' ' . abs int($_author);2085 $_author_array[] = "$wpdb->posts.post_author " . $eq . ' ' . abs( (int)$_author); 2086 2086 $whichauthor .= ' AND (' . implode(" $andor ", $_author_array) . ')'; 2087 2087 unset($author_array, $_author_array); 2088 2088 } … … 2102 2102 $q['author'] = get_user_by('slug', $q['author_name']); 2103 2103 if ( $q['author'] ) 2104 2104 $q['author'] = $q['author']->ID; 2105 $whichauthor .= " AND ($wpdb->posts.post_author = " . abs int($q['author']) . ')';2105 $whichauthor .= " AND ($wpdb->posts.post_author = " . abs( (int)$q['author']) . ')'; 2106 2106 } 2107 2107 2108 2108 // MIME-Type stuff for attachment browsing … … 2316 2316 2317 2317 // Paging 2318 2318 if ( empty($q['nopaging']) && !$this->is_singular ) { 2319 $page = abs int($q['paged']);2319 $page = abs( (int)$q['paged']); 2320 2320 if ( empty($page) ) 2321 2321 $page = 1; 2322 2322 … … 2325 2325 $pgstrt = ($page - 1) * $q['posts_per_page'] . ', '; 2326 2326 $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page']; 2327 2327 } else { // we're ignoring $page and using 'offset' 2328 $q['offset'] = abs int($q['offset']);2328 $q['offset'] = abs( (int)$q['offset']); 2329 2329 $pgstrt = $q['offset'] . ', '; 2330 2330 $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page']; 2331 2331 } -
wordpress/wp-includes/rewrite.php
256 256 257 257 // First, check to see if there is a 'p=N' or 'page_id=N' to match against 258 258 if ( preg_match('#[?&](p|page_id|attachment_id)=(\d+)#', $url, $values) ) { 259 $id = abs int($values[2]);259 $id = abs( (int)$values[2]); 260 260 if ( $id ) 261 261 return $id; 262 262 } -
wordpress/wp-includes/taxonomy.php
814 814 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', 815 815 'pad_counts' => false, 'offset' => '', 'search' => ''); 816 816 $args = wp_parse_args( $args, $defaults ); 817 $args['number'] = abs int($args['number'] );818 $args['offset'] = abs int($args['offset'] );817 $args['number'] = abs( (int) $args['number'] ); 818 $args['offset'] = abs( (int) $args['offset'] ); 819 819 if ( !$single_taxonomy || !is_taxonomy_hierarchical($taxonomies[0]) || 820 820 '' !== $args['parent'] ) { 821 821 $args['child_of'] = 0; -
wordpress/wp-includes/theme.php
757 757 * @return string 758 758 */ 759 759 function get_author_template() { 760 $author_id = abs int(get_query_var( 'author' ) );760 $author_id = abs( (int) get_query_var( 'author' ) ); 761 761 $author = get_user_by( 'id', $author_id ); 762 762 $author = $author->user_nicename; 763 763 … … 786 786 * @return string 787 787 */ 788 788 function get_category_template() { 789 $cat_ID = abs int(get_query_var('cat') );789 $cat_ID = abs( (int) get_query_var('cat') ); 790 790 $category = get_category( $cat_ID ); 791 791 792 792 $templates = array(); … … 814 814 * @return string 815 815 */ 816 816 function get_tag_template() { 817 $tag_id = abs int(get_query_var('tag_id') );817 $tag_id = abs( (int) get_query_var('tag_id') ); 818 818 $tag_name = get_query_var('tag'); 819 819 820 820 $templates = array(); -
wordpress/wp-comments-post.php
83 83 if ( '' == $comment_content ) 84 84 wp_die( __('Error: please type a comment.') ); 85 85 86 $comment_parent = isset($_POST['comment_parent']) ? abs int($_POST['comment_parent']) : 0;86 $comment_parent = isset($_POST['comment_parent']) ? abs( (int)$_POST['comment_parent']) : 0; 87 87 88 88 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); 89 89 -
wordpress/wp-links-opml.php
22 22 if ( !empty($_GET['link_cat']) ) { 23 23 $link_cat = $_GET['link_cat']; 24 24 if ( !in_array($link_cat, array('all', '0')) ) 25 $link_cat = abs int((string)urldecode($link_cat) );25 $link_cat = abs( (int) (string)urldecode($link_cat) ); 26 26 } 27 27 28 28 echo '<?xml version="1.0"?'.">\n"; -
wordpress/xmlrpc.php
1098 1098 1099 1099 $post_id = ''; 1100 1100 if ( isset($struct['post_id']) ) 1101 $post_id = abs int($struct['post_id']);1101 $post_id = abs( (int)$struct['post_id']); 1102 1102 1103 1103 $offset = 0; 1104 1104 if ( isset($struct['offset']) ) 1105 $offset = abs int($struct['offset']);1105 $offset = abs( (int)$struct['offset']); 1106 1106 1107 1107 $number = 10; 1108 1108 if ( isset($struct['number']) ) 1109 $number = abs int($struct['number']);1109 $number = abs( (int)$struct['number']); 1110 1110 1111 1111 $comments = get_comments( array('status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) ); 1112 1112 $num_comments = count($comments); … … 1259 1259 } 1260 1260 1261 1261 if ( is_numeric($post) ) 1262 $post_id = abs int($post);1262 $post_id = abs( (int)$post); 1263 1263 else 1264 1264 $post_id = url_to_postid($post); 1265 1265 … … 1299 1299 } 1300 1300 } 1301 1301 1302 $comment['comment_parent'] = isset($content_struct['comment_parent']) ? abs int($content_struct['comment_parent']) : 0;1302 $comment['comment_parent'] = isset($content_struct['comment_parent']) ? abs( (int)$content_struct['comment_parent']) : 0; 1303 1303 1304 1304 $comment['comment_content'] = $content_struct['content']; 1305 1305