Skip to content

Commit f02eec9

Browse files
committed
Bug-fix.
Changelog excerpt: - PDF files were sometimes being flagged as images; Fixed. Also slightly refactored some regex.
1 parent 9492ec0 commit f02eec9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,5 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
9999
### v3.3.4
100100

101101
[2022.11.30; Maikuolan]: Adjusted minimum value for some port directives from 1 to 0.
102+
103+
[2022.12.26; Bug-fix; Maikuolan]: PDF files were sometimes being flagged as images; Fixed.

src/Scanner.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: The scanner (last modified: 2022.08.20).
11+
* This file: The scanner (last modified: 2022.12.26).
1212
*/
1313

1414
namespace phpMussel\Core;
@@ -3125,12 +3125,13 @@ private function imageIndicators(string $Ext, string $Head): bool
31253125
{
31263126
return (
31273127
preg_match(
3128-
'/^(?:bm[2p]|c(d5|gm)|d(ib|w[fg]|xf)|ecw|fits|gif|img|j(f?if?|p[2s]|pe?g?2?|xr)|p(bm|cx|dd|gm|ic|n[gms]|' .
3129-
'pm|s[dp])|s(id|v[ag])|tga|w(bmp?|ebp|mp)|x(cf|bmp))$/',
3128+
'/^(?:bm[2p]|cd5|cgm|d(?:ib|w[fg]|xf)|ecw|fits|gif|img|j(?:f?if?|p[2s' .
3129+
']|pe?g?2?|xr)|p(?:bm|cx|dd|gm|ic|n[gms]|pm|s[dp])|s(?:id|v[ag])|tga|' .
3130+
'w(?:bmp?|ebp|mp)|xcf|xbmp)$/',
31303131
$Ext
31313132
) ||
31323133
preg_match(
3133-
'/^(?:0000000c6a502020|25504446|38425053|424d|474946383[79]61|57454250|67696d7020786366|89504e47|ffd8ff)/',
3134+
'/^(?:0000000c6a502020|38425053|424d|474946383[79]61|57454250|67696d7020786366|89504e47|ffd8ff)/',
31343135
$Head
31353136
)
31363137
);

0 commit comments

Comments
 (0)