Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/PHPCR/Util/PathHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function __construct()
*/
public static function assertValidAbsolutePath($path, $destination = false, $throw = true)
{
if (! is_string($path)
if ((!is_string($path) && !is_numeric($path))
|| strlen($path) == 0
|| '/' !== $path[0]
|| strlen($path) > 1 && '/' === $path[strlen($path) - 1]
Expand Down Expand Up @@ -134,7 +134,7 @@ public static function assertValidLocalName($name, $throw = true)
*/
public static function normalizePath($path, $destination = false, $throw = true)
{
if (!is_string($path)) {
if (!is_string($path) && !is_numeric($path)) {
return self::error('Expected string but got ' . gettype($path), $throw);
}
if (strlen($path) === 0) {
Expand Down Expand Up @@ -199,7 +199,7 @@ public static function normalizePath($path, $destination = false, $throw = true)
*/
public static function absolutizePath($path, $context, $destination = false, $throw = true)
{
if (!is_string($path)) {
if (!is_string($path) && !is_numeric($path)) {
return self::error('Expected string path but got ' . gettype($path), $throw);
}
if (!is_string($context)) {
Expand Down