Skip to content

Fix numeric folders throwing on markDirty - #23034

Merged
nickvergessen merged 1 commit into
masterfrom
bugfix/noid/numeric-folders-thorw-on-mark-dirty
Sep 25, 2020
Merged

Fix numeric folders throwing on markDirty#23034
nickvergessen merged 1 commit into
masterfrom
bugfix/noid/numeric-folders-thorw-on-mark-dirty

Conversation

@nickvergessen

Copy link
Copy Markdown
Member

TypeError: strpos() expects parameter 1 to be string, int given

The problem is that in cacheNode() we strip of any slashes, so
a folder 0/ will be trimmed to '0' and be used as an array key.
Since PHP automatically casts numeric array keys to integers,
you afterwards get $nodePath as int(0). Since it's now a number,
the strpos() function does not accept it anymore. Simply casting
$nodePath to a string again in the foreach solves the issue

TypeError: strpos() expects parameter 1 to be string, int given
The problem is that in cacheNode() we strip of any slashes, so
a folder "0/" will be trimmed to "0" and be used as an array key.
Since PHP automatically casts numeric array keys to integers,
you afterwards get $nodePath as int(0). Since it's now a number,
the strpos() function does not accept it anymore. Simply casting
$nodePath to a string again in the foreach solves the issue
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen
nickvergessen merged commit deddcbd into masterSep 25, 2020
@nickvergessen
nickvergessen deleted the bugfix/noid/numeric-folders-thorw-on-mark-dirty branch September 25, 2020 12:52
@nickvergessen

Copy link
Copy Markdown
MemberAuthor

Backport I guess?

@rullzer

Copy link
Copy Markdown
Member

/backport to stable20

@rullzer

Copy link
Copy Markdown
Member

/backport to stable19

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbugfeature: dav

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@nickvergessen@rullzer@icewind1991