Skip to content

Commit e670e5c

Browse files
committed
there are cases where a node name might be an integer
1 parent 78fee59 commit e670e5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PHPCR/Util/PathHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private function __construct()
6262
*/
6363
public static function assertValidAbsolutePath($path, $destination = false, $throw = true)
6464
{
65-
if (! is_string($path)
65+
if ((!is_string($path) && !is_numeric($path))
6666
|| strlen($path) == 0
6767
|| '/' !== $path[0]
6868
|| strlen($path) > 1 && '/' === $path[strlen($path) - 1]
@@ -134,7 +134,7 @@ public static function assertValidLocalName($name, $throw = true)
134134
*/
135135
public static function normalizePath($path, $destination = false, $throw = true)
136136
{
137-
if (!is_string($path)) {
137+
if (!is_string($path) && !is_numeric($path)) {
138138
return self::error('Expected string but got ' . gettype($path), $throw);
139139
}
140140
if (strlen($path) === 0) {
@@ -199,7 +199,7 @@ public static function normalizePath($path, $destination = false, $throw = true)
199199
*/
200200
public static function absolutizePath($path, $context, $destination = false, $throw = true)
201201
{
202-
if (!is_string($path)) {
202+
if (!is_string($path) && !is_numeric($path)) {
203203
return self::error('Expected string path but got ' . gettype($path), $throw);
204204
}
205205
if (!is_string($context)) {

0 commit comments

Comments
 (0)