aboutsummaryrefslogtreecommitdiffstats
path: root/thumb.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2022-10-21 15:32:38 +1100
committerTim Starling <tstarling@wikimedia.org>2022-10-21 15:33:37 +1100
commit0077c5da15aab081125ee1c72cc4d95225e4ff5f (patch)
tree27e2128c722cb91eb72546bf289d1845a5974d52 /thumb.php
parentd2b199c51762e417c75778ca9016b8dc62c1bb67 (diff)
downloadmediawikicore-0077c5da15aab081125ee1c72cc4d95225e4ff5f.tar.gz
mediawikicore-0077c5da15aab081125ee1c72cc4d95225e4ff5f.zip
Use short array destructuring instead of list()
Introduced in PHP 7.1. Because it's shorter and looks nice. I used regex replacement. Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
Diffstat (limited to 'thumb.php')
-rw-r--r--thumb.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/thumb.php b/thumb.php
index 99c9f64b0153..19d72e48ab93 100644
--- a/thumb.php
+++ b/thumb.php
@@ -363,7 +363,7 @@ function wfStreamThumb( array $params ) {
return;
} else {
// Generate the thumbnail locally
- list( $thumb, $errorMsg ) = wfGenerateThumbnail( $img, $params, $thumbName, $thumbPath );
+ [ $thumb, $errorMsg ] = wfGenerateThumbnail( $img, $params, $thumbName, $thumbPath );
}
/** @var MediaTransformOutput|MediaTransformError|bool $thumb */
@@ -561,10 +561,10 @@ function wfExtractThumbRequestInfo( $thumbRel ) {
// Check if this is a thumbnail of an original in the local file repo
if ( preg_match( "!^((archive/)?$hashDirReg([^/]*)/([^/]*))$!", $thumbRel, $m ) ) {
- list( /*all*/, $rel, $archOrTemp, $filename, $thumbname ) = $m;
+ [ /*all*/, $rel, $archOrTemp, $filename, $thumbname ] = $m;
// Check if this is a thumbnail of an temp file in the local file repo
} elseif ( preg_match( "!^(temp/)($hashDirReg([^/]*)/([^/]*))$!", $thumbRel, $m ) ) {
- list( /*all*/, $archOrTemp, $rel, $filename, $thumbname ) = $m;
+ [ /*all*/, $archOrTemp, $rel, $filename, $thumbname ] = $m;
} else {
return null; // not a valid looking thumbnail request
}