Skip to content

Commit

Permalink
Fixed Use of undefined constant PATHINFO_ALL
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Jan 26, 2022
1 parent 074f47d commit e9b63ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 5.5.9
## mm/dd/2021

1. [Common](#common)
1. [](#bugfix)
- Fixed `Use of undefined constant PATHINFO_ALL`

# 5.5.8
## 01/24/2021

Expand Down
13 changes: 10 additions & 3 deletions src/classes/Gantry/Framework/Base/Gantry.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,19 @@ protected static function init()
* @link https://www.php.net/manual/en/function.pathinfo.php
*
* @param string $path
* @param int $options
* @param int|null $flags
* @return array|string
*/
public static function pathinfo($path, $options = PATHINFO_ALL)
public static function pathinfo($path, $flags = null)
{
$info = pathinfo(str_replace(['%2F', '%5C'], ['/', '\\'], rawurlencode($path)), $options);
$path = str_replace(['%2F', '%5C'], ['/', '\\'], rawurlencode($path));

if (null === $flags) {
$info = pathinfo($path);
} else {
$info = pathinfo($path, (int)$flags);
}

if (is_array($info)) {
return array_map('rawurldecode', $info);
}
Expand Down

0 comments on commit e9b63ca

Please sign in to comment.