Skip to content

Commit

Permalink
fix(HelperBuilder): invalid index accesses can no longer occur
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreimus committed Jan 23, 2024
1 parent 0c6d9a4 commit 28d665b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/HelperBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function pathFormattedFromString($path, $rtrim = false)
if (strpos($path, '..') !== false) {
throw new Exception('Invalid path');
}
if (substr($path, 0, 1) !== '$') {
if ($path[0] !== '$') {
throw new Exception('Path "' . $path . '" should begin by $ ex: "$/prettyblocks/path/to/images/"');
}
$pathFormatted = str_replace('$', _PS_ROOT_DIR_, $path);
Expand Down

0 comments on commit 28d665b

Please sign in to comment.