lupo49/dokuwiki-plugin-orphanswanted

Problem with some IDs existing as Lowercase and Uppercase

Closed this issue · 4 comments

Hello,

we had a problem with an ID existing as:
mywiki:0010_Allgemein:0060_Look_and_Feel
and
mywiki:0010_allgemein:0060_look_and_feel
-> Both IDs where added in the data array in the function orph_callback_search_wanted().

This lead to the problem that in the wanted-Mode only one Version was succefully flaged as 'page does exist' - the other not!
So the page renderd as "not existing".
But when clicking on the -presumably- not existing Link it still opend flawlessly.
I think this may be because dokuwiki in this case is running on Windows and Windows does not distinguish between uppercase and lowercase.

The problem has been solved for us by adding
$id = strtolower($id);
on Line 45 in 'helper.php'.
Thats in function orph_callback_search_wanted() right after
$id = pathID($file);
So the link does only get added once in lowercase form.

If somebody things its a good think to make all id's lowercase before adding them to the data-Array I could make a PR for the change.

What do you think?

Thomas

Hello Thomas,

You are correct, DokuWiki internally converts everything to lowercase, regardless of the CamelCase setting.

Will fix with the function utf8_strtolower($id); as described in the DokuWiki wiki https://www.dokuwiki.org/pagename

Feel free to file a PR, otherwise I'll fix it until tomorrow.

Christian

Hello jaller94,

thanks for your answer, and thanks for reminding me of utf8_strtolower :-)

I've created a PR.

Thomas

Hi @ThomasChr, could you try if cleanID() does the same?

Yes, that does exactly the same - the Bug is gone. Should I replace it in a PR?