Make WordPress Core


Ignore:
Timestamp:
10/08/2020 09:13:57 PM (5 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-admin/async-upload.php

    r48128 r49108  
    4040
    4141// Just fetch the detail form for that attachment.
    42 if ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] ) && $_REQUEST['fetch'] ) {
    43     $id   = intval( $_REQUEST['attachment_id'] );
     42if ( isset( $_REQUEST['attachment_id'] ) && (int) $_REQUEST['attachment_id'] && $_REQUEST['fetch'] ) {
     43    $id   = (int) $_REQUEST['attachment_id'];
    4444    $post = get_post( $id );
    4545    if ( 'attachment' !== $post->post_type ) {
Note: See TracChangeset for help on using the changeset viewer.