Ticket #31600: 31600-incr_decr_offset_type_check.diff
File 31600-incr_decr_offset_type_check.diff, 873 bytes (added by , 8 years ago) |
---|
-
src/wp-includes/cache.php
435 435 if ( ! is_numeric( $this->cache[ $group ][ $key ] ) ) 436 436 $this->cache[ $group ][ $key ] = 0; 437 437 438 if ( ! is_numeric( $offset ) ) { 439 if ( is_string( $offset ) ) { 440 $offset = (int) $offset; 441 } else { 442 $offset = 0; 443 } 444 } 445 438 446 $offset = (int) $offset; 439 447 440 448 $this->cache[ $group ][ $key ] -= $offset; … … 546 554 if ( ! is_numeric( $this->cache[ $group ][ $key ] ) ) 547 555 $this->cache[ $group ][ $key ] = 0; 548 556 557 if ( ! is_numeric( $offset ) ) { 558 if ( is_string( $offset ) ) { 559 $offset = (int) $offset; 560 } else { 561 $offset = 0; 562 } 563 } 564 549 565 $offset = (int) $offset; 550 566 551 567 $this->cache[ $group ][ $key ] += $offset;