diff options
author | Pete Albrecht <palbrecht@i3logix.com> | 2017-10-03 15:39:22 -0600 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2019-02-10 19:38:46 +0100 |
commit | 76703ae5a1c7d5532ca2bed9ebb18976f07cbe9d (patch) | |
tree | 30ecc60773d76c1d773e78f647d0aaeebca0f8ee | |
parent | 5ca12f6c5ff3b86c09b733566ba3e2a5c7cc4fce (diff) | |
download | php-git-76703ae5a1c7d5532ca2bed9ebb18976f07cbe9d.tar.gz |
fnmatch error when pattern or filename too long
i3logix PHP Testfest 2017
-rw-r--r-- | ext/standard/tests/file/fnmatch_maxpathlen.phpt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/standard/tests/file/fnmatch_maxpathlen.phpt b/ext/standard/tests/file/fnmatch_maxpathlen.phpt new file mode 100644 index 0000000000..849e7710bb --- /dev/null +++ b/ext/standard/tests/file/fnmatch_maxpathlen.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test fnmatch() function : warning filename or pattern exceeds maxpathlen +--SKIPIF-- +<?php +if (!function_exists('fnmatch')) die('skip fnmatch() function is not available'); +?> +--FILE-- +<?php +$longstring = str_pad('blah', PHP_MAXPATHLEN); +var_dump(fnmatch('blah', $longstring)); +var_dump(fnmatch($longstring, 'blah')); +?> +--EXPECTF-- +Warning: fnmatch(): Filename exceeds the maximum allowed length of %d characters in %s on line %d +bool(false) + +Warning: fnmatch(): Pattern exceeds the maximum allowed length of %d characters in %s on line %d +bool(false) |