Skip to content

Commit

Permalink
Merge pull request #52 from gggeek/fix_php_8_1
Browse files Browse the repository at this point in the history
make pakeFinder::isPathAbsolute work with php 8.1
  • Loading branch information
gggeek authored Dec 13, 2021
2 parents 324ed26 + b0e8267 commit 2b61008
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
1.99.5:

* fix compatibility with php 8.1 in `pakeFinder::isPathAbsolute`
* add ctype php extension to the requirements


1.99.4:

* fix compatibility with php 7.4 (thanks rlerdorf)
* add json php extension to the requirements


1.99.3:

* `pake_symlink()` will throw `pakeException` if not successful
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"require": {
"php": ">=5.2.1",
"ext-ctype": "*",
"ext-json": "*",
"ext-mbstring": "*"
},
Expand Down
10 changes: 5 additions & 5 deletions lib/pake/pakeFinder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private function args_to_array($arg_list, $not = false)
/**
* converts ant-pattern to PCRE regex
*
* @param string $pattern
* @param string $pattern
* @return string
*/
private function pattern_to_regex($pattern)
Expand Down Expand Up @@ -602,10 +602,10 @@ private function exec_ok($dir, $entry)

public static function isPathAbsolute($path)
{
if ($path{0} == '/' || $path{0} == '\\' ||
(strlen($path) > 3 && ctype_alpha($path{0}) &&
$path{1} == ':' &&
($path{2} == '\\' || $path{2} == '/')
if ($path[0] == '/' || $path[0] == '\\' ||
(strlen($path) > 3 && ctype_alpha($path[0]) &&
$path[1] == ':' &&
($path[2] == '\\' || $path[2] == '/')
)
) {
return true;
Expand Down

0 comments on commit 2b61008

Please sign in to comment.