Skip to content

Conversation

@nickvergessen
Copy link
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 <[email protected]>
@nickvergessen nickvergessen merged commit deddcbd into master Sep 25, 2020
@nickvergessen nickvergessen deleted the bugfix/noid/numeric-folders-thorw-on-mark-dirty branch September 25, 2020 12:52
@nickvergessen
Copy link
Member Author

Backport I guess?

@rullzer
Copy link
Member

rullzer commented Sep 25, 2020

/backport to stable20

@rullzer
Copy link
Member

rullzer commented Sep 25, 2020

/backport to stable19

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants