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. Built from https://develop.svn.wordpress.org/trunk@49108 git-svn-id: http://core.svn.wordpress.org/trunk@48870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -39,8 +39,8 @@ if ( ! current_user_can( 'upload_files' ) ) {
|
||||
}
|
||||
|
||||
// Just fetch the detail form for that attachment.
|
||||
if ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] ) && $_REQUEST['fetch'] ) {
|
||||
$id = intval( $_REQUEST['attachment_id'] );
|
||||
if ( isset( $_REQUEST['attachment_id'] ) && (int) $_REQUEST['attachment_id'] && $_REQUEST['fetch'] ) {
|
||||
$id = (int) $_REQUEST['attachment_id'];
|
||||
$post = get_post( $id );
|
||||
if ( 'attachment' !== $post->post_type ) {
|
||||
wp_die( __( 'Invalid post type.' ) );
|
||||
|
||||
Reference in New Issue
Block a user