From 35043d8257cf5300291d38d71b47efe091450c0d Mon Sep 17 00:00:00 2001 From: Yuriy Pikhtarev Date: Sun, 25 Jun 2017 15:43:45 +0300 Subject: [PATCH] Short list syntax can be used. --- admin/admin_rebuild_search.php | 4 ++-- library/TorrentPier/TorrentPier/Legacy/Attach.php | 2 +- library/TorrentPier/TorrentPier/Legacy/Common/Upload.php | 2 +- library/attach_mod/displaying.php | 2 +- library/attach_mod/includes/functions_thumbs.php | 4 ++-- library/includes/functions.php | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/admin/admin_rebuild_search.php b/admin/admin_rebuild_search.php index 3ea7ee6c9..a8d24ad10 100644 --- a/admin/admin_rebuild_search.php +++ b/admin/admin_rebuild_search.php @@ -134,7 +134,7 @@ if ($mode == 'submit' || $mode == 'refresh') { } // get the db sizes - list($search_data_size, $search_index_size, $search_tables_size) = get_db_sizes(); + [$search_data_size, $search_index_size, $search_tables_size] = get_db_sizes(); // get the post subject/text of each post $result = OLD_DB()->query(" @@ -290,7 +290,7 @@ if ($mode == 'submit' || $mode == 'refresh') { } // get the db sizes - list($search_data_size, $search_index_size, $search_tables_size) = get_db_sizes(); + [$search_data_size, $search_index_size, $search_tables_size] = get_db_sizes(); // calculate the final (estimated) values $final_search_tables_size = ''; diff --git a/library/TorrentPier/TorrentPier/Legacy/Attach.php b/library/TorrentPier/TorrentPier/Legacy/Attach.php index 8bd1ef3aa..f3e02cf5b 100644 --- a/library/TorrentPier/TorrentPier/Legacy/Attach.php +++ b/library/TorrentPier/TorrentPier/Legacy/Attach.php @@ -908,7 +908,7 @@ class Attach // Check Image Size, if it's an image if (!$error && !IS_ADMIN && $cat_id === IMAGE_CAT) { - list($width, $height) = image_getdimension($upload_dir . '/' . $this->attach_filename); + [$width, $height] = image_getdimension($upload_dir . '/' . $this->attach_filename); if ($width && $height && (int)$attach_config['img_max_width'] && (int)$attach_config['img_max_height']) { if ($width > (int)$attach_config['img_max_width'] || $height > (int)$attach_config['img_max_height']) { diff --git a/library/TorrentPier/TorrentPier/Legacy/Common/Upload.php b/library/TorrentPier/TorrentPier/Legacy/Common/Upload.php index 9fa6a0574..6f3574005 100644 --- a/library/TorrentPier/TorrentPier/Legacy/Common/Upload.php +++ b/library/TorrentPier/TorrentPier/Legacy/Common/Upload.php @@ -92,7 +92,7 @@ class Upload // img if ($this->cfg['max_width'] || $this->cfg['max_height']) { if ($img_info = getimagesize($this->file['tmp_name'])) { - list($width, $height, $type, $attr) = $img_info; + [$width, $height, $type, $attr] = $img_info; // redefine ext if (!$width || !$height || !$type || !isset($this->img_types[$type])) { diff --git a/library/attach_mod/displaying.php b/library/attach_mod/displaying.php index 30e39677d..55737296f 100644 --- a/library/attach_mod/displaying.php +++ b/library/attach_mod/displaying.php @@ -213,7 +213,7 @@ function display_attachments($post_id) if (@(int)$display_categories[$attachments['_' . $post_id][$i]['extension']] == IMAGE_CAT && (int)$attach_config['img_display_inlined']) { if ((int)$attach_config['img_link_width'] != 0 || (int)$attach_config['img_link_height'] != 0) { - list($width, $height) = image_getdimension($filename); + [$width, $height] = image_getdimension($filename); if ($width == 0 && $height == 0) { $image = true; diff --git a/library/attach_mod/includes/functions_thumbs.php b/library/attach_mod/includes/functions_thumbs.php index 07b248d0d..fd9bbe509 100644 --- a/library/attach_mod/includes/functions_thumbs.php +++ b/library/attach_mod/includes/functions_thumbs.php @@ -103,13 +103,13 @@ function create_thumbnail($source, $new_file, $mimetype) return false; } - list($width, $height, $type, ) = getimagesize($source); + [$width, $height, $type,] = getimagesize($source); if (!$width || !$height) { return false; } - list($new_width, $new_height) = get_img_size_format($width, $height); + [$new_width, $new_height] = get_img_size_format($width, $height); $tmp_path = $old_file = ''; diff --git a/library/includes/functions.php b/library/includes/functions.php index 180d0ec33..c26777b78 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -689,13 +689,13 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false) if (!is_array($default)) { $type = gettype($default); } else { - list($key_type, $type) = $default; + [$key_type, $type] = $default; $type = gettype($type); $key_type = gettype($key_type); if ($type == 'array') { reset($default); $default = current($default); - list($sub_key_type, $sub_type) = $default; + [$sub_key_type, $sub_type] = $default; $sub_type = gettype($sub_type); $sub_type = ($sub_type == 'array') ? 'NULL' : $sub_type; $sub_key_type = gettype($sub_key_type);