Short list syntax can be used

Signed-off-by: Yuriy Pikhtarev <iglix@me.com>
This commit is contained in:
Yuriy Pikhtarev 2018-06-24 15:21:55 +03:00
commit 742575bb56
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
7 changed files with 10 additions and 10 deletions

View file

@ -134,7 +134,7 @@ if ($mode == 'submit' || $mode == 'refresh') {
} }
// get the db sizes // 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 // get the post subject/text of each post
$result = DB()->query(" $result = DB()->query("
@ -290,7 +290,7 @@ if ($mode == 'submit' || $mode == 'refresh') {
} }
// get the db sizes // 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 // calculate the final (estimated) values
$final_search_tables_size = ''; $final_search_tables_size = '';

View file

@ -248,7 +248,7 @@ function file_write($str, $file, $max_size = LOG_MAX_SIZE, $lock = true, $replac
$old_name = $file; $old_name = $file;
$ext = ''; $ext = '';
if (preg_match('#^(.+)(\.[^\\\/]+)$#', $file, $matches)) { if (preg_match('#^(.+)(\.[^\\\/]+)$#', $file, $matches)) {
list($old_name, $ext) = $matches; [$old_name, $ext] = $matches;
} }
$new_name = $old_name . '_[old]_' . date('Y-m-d_H-i-s_') . getmypid() . $ext; $new_name = $old_name . '_[old]_' . date('Y-m-d_H-i-s_') . getmypid() . $ext;
clearstatcache(); clearstatcache();

View file

@ -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)$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) { 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) { if ($width == 0 && $height == 0) {
$image = true; $image = true;

View file

@ -103,13 +103,13 @@ function create_thumbnail($source, $new_file, $mimetype)
return false; return false;
} }
list($width, $height, $type, ) = getimagesize($source); [$width, $height, $type,] = getimagesize($source);
if (!$width || !$height) { if (!$width || !$height) {
return false; 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 = ''; $tmp_path = $old_file = '';

View file

@ -689,13 +689,13 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false)
if (!is_array($default)) { if (!is_array($default)) {
$type = gettype($default); $type = gettype($default);
} else { } else {
list($key_type, $type) = $default; [$key_type, $type] = $default;
$type = gettype($type); $type = gettype($type);
$key_type = gettype($key_type); $key_type = gettype($key_type);
if ($type == 'array') { if ($type == 'array') {
reset($default); reset($default);
$default = current($default); $default = current($default);
list($sub_key_type, $sub_type) = $default; [$sub_key_type, $sub_type] = $default;
$sub_type = gettype($sub_type); $sub_type = gettype($sub_type);
$sub_type = ($sub_type == 'array') ? 'NULL' : $sub_type; $sub_type = ($sub_type == 'array') ? 'NULL' : $sub_type;
$sub_key_type = gettype($sub_key_type); $sub_key_type = gettype($sub_key_type);

View file

@ -907,7 +907,7 @@ class Attach
// Check Image Size, if it's an image // Check Image Size, if it's an image
if (!$error && !IS_ADMIN && $cat_id === IMAGE_CAT) { 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 && $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']) { if ($width > (int)$attach_config['img_max_width'] || $height > (int)$attach_config['img_max_height']) {

View file

@ -92,7 +92,7 @@ class Upload
// img // img
if ($this->cfg['max_width'] || $this->cfg['max_height']) { if ($this->cfg['max_width'] || $this->cfg['max_height']) {
if ($img_info = getimagesize($this->file['tmp_name'])) { if ($img_info = getimagesize($this->file['tmp_name'])) {
list($width, $height, $type, $attr) = $img_info; [$width, $height, $type, $attr] = $img_info;
// redefine ext // redefine ext
if (!$width || !$height || !$type || !isset($this->img_types[$type])) { if (!$width || !$height || !$type || !isset($this->img_types[$type])) {