aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/media.php
diff options
context:
space:
mode:
authorfiwswe <fiwswe@fwml.de>2023-09-14 22:32:18 +0200
committerfiwswe <fiwswe@fwml.de>2023-09-14 23:06:43 +0200
commit6c16a3a9aa602bb7e269fb6d5d18e1353e17f97f (patch)
treea128e76bb9a55a704f1d2a89e1a9b73398f7ff1c /inc/media.php
parentfa4b9dc1e9fc6a931deee2786437a3d4f9a8ef71 (diff)
downloaddokuwiki-6c16a3a9aa602bb7e269fb6d5d18e1353e17f97f.tar.gz
dokuwiki-6c16a3a9aa602bb7e269fb6d5d18e1353e17f97f.zip
Use str_starts_with/str_ends_with
Diffstat (limited to 'inc/media.php')
-rw-r--r--inc/media.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/media.php b/inc/media.php
index ed3270096..3b2ccda9f 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -658,7 +658,7 @@ function media_contentcheck($file, $mime)
}
}
}
- if (substr($mime, 0, 6) == 'image/') {
+ if (str_starts_with($mime, 'image/')) {
$info = @getimagesize($file);
if ($mime == 'image/gif' && $info[2] != 1) {
return -1; // uploaded content did not match the file extension
@@ -668,7 +668,7 @@ function media_contentcheck($file, $mime)
return -1;
}
# fixme maybe check other images types as well
- } elseif (substr($mime, 0, 5) == 'text/') {
+ } elseif (str_starts_with($mime, 'text/')) {
global $TEXT;
$TEXT = io_readFile($file);
if (checkwordblock()) {