Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (4 years ago)
Author:
SergeyBiryukov
Message:

General: Replace older-style PHP type conversion functions with type casts.

This improves performance, readability, and consistency throughout core.

  • intval()(int)
  • strval()(string)
  • floatval()(float)

Props ayeshrajans.
Fixes #42918.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-trackback.php

    r47198 r49108  
    4747if ( ! isset( $_GET['tb_id'] ) || ! $_GET['tb_id'] ) {
    4848    $tb_id = explode( '/', $_SERVER['REQUEST_URI'] );
    49     $tb_id = intval( $tb_id[ count( $tb_id ) - 1 ] );
     49    $tb_id = (int) $tb_id[ count( $tb_id ) - 1 ];
    5050}
    5151
     
    8585}
    8686
    87 if ( ! isset( $tb_id ) || ! intval( $tb_id ) ) {
     87if ( ! isset( $tb_id ) || ! (int) $tb_id ) {
    8888    trackback_response( 1, __( 'I really need an ID for this to work.' ) );
    8989}
Note: See TracChangeset for help on using the changeset viewer.