dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbbad5e
)
upload: Simplify file extension extraction in UploadBase
author
Thiemo Kreuz
<thiemo.kreuz@wikimedia.de>
Thu, 28 Feb 2019 11:37:40 +0000
(12:37 +0100)
committer
Thiemo Kreuz
<thiemo.kreuz@wikimedia.de>
Thu, 28 Feb 2019 11:38:52 +0000
(12:38 +0100)
The code does the exact same, just shorter and hopefully better
readable.
Change-Id: Idd1d34927a5c027d378d1a54afd23dc7f33ee004
includes/upload/UploadBase.php
patch
|
blob
|
history
diff --git
a/includes/upload/UploadBase.php
b/includes/upload/UploadBase.php
index
d9e8e99
..
d692f1a
100644
(file)
--- a/
includes/upload/UploadBase.php
+++ b/
includes/upload/UploadBase.php
@@
-947,8
+947,8
@@
abstract class UploadBase {
*/
list( $partname, $ext ) = $this->splitExtensions( $this->mFilteredName );
- if (
count( $ext )
) {
- $this->mFinalExtension = trim(
$ext[count( $ext ) - 1]
);
+ if (
$ext !== []
) {
+ $this->mFinalExtension = trim(
end( $ext )
);
} else {
$this->mFinalExtension = '';