Skip to content

Commit 76703ae

Browse files
Pete Albrechtpetk
authored andcommitted
fnmatch error when pattern or filename too long
i3logix PHP Testfest 2017
1 parent 5ca12f6 commit 76703ae

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Test fnmatch() function : warning filename or pattern exceeds maxpathlen
3+
--SKIPIF--
4+
<?php
5+
if (!function_exists('fnmatch')) die('skip fnmatch() function is not available');
6+
?>
7+
--FILE--
8+
<?php
9+
$longstring = str_pad('blah', PHP_MAXPATHLEN);
10+
var_dump(fnmatch('blah', $longstring));
11+
var_dump(fnmatch($longstring, 'blah'));
12+
?>
13+
--EXPECTF--
14+
Warning: fnmatch(): Filename exceeds the maximum allowed length of %d characters in %s on line %d
15+
bool(false)
16+
17+
Warning: fnmatch(): Pattern exceeds the maximum allowed length of %d characters in %s on line %d
18+
bool(false)

0 commit comments

Comments
 (0)