Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Passing an empty string to pageFilenameFromPath() results in error. #66

@fabianmichael

Description

@fabianmichael

In one of my projects, it seems that the pageFilenameFromPath() sometimes gets an empty string as parameter. In that case, the pathinfo() function does not return all expected keys, but only the following:

array(2) {
  ["basename"]=>
  string(0) ""
  ["filename"]=>
  string(0) ""
}

This leads to the following exception: Notice: Undefined index: dirname (see https://github.com/bnomei/kirby3-autoid/blob/master/classes/AutoIDDatabase.php#L233)

As I don’t know exactly why an empty ID gets passed to the method, I did not create a fix that just supresses the error. Maybe this would be sufficient, but maybe the issue is rooted somewhere else?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions