Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spaces are not replaced with underscore (config setting) - forbidden blank page instead #4238

Open
macin opened this issue Mar 8, 2024 · 7 comments

Comments

@macin
Copy link

macin commented Mar 8, 2024

The problem

I have a config enabled to convert spaces to underscores.
However after upgrade to Kaos 6a I started getting feedback from the users, that they are not able to create pages.

AFter investigation, is seems that when user types in the namespace name with spaces, dokuwiki redirects to the page with %20 in the url

I was not able to confirm if this is server problem, or dokuwiki itself

Enter page name here
IMG_20240308_183310

Zrzut ekranu 2024-03-08 174252

Version of DokuWiki

2024-0206a Kaos

PHP Version

8.2

Webserver and version of webserver

Ubuntu

Browser and version of browser, operating system running browser

Version 122.0.6261.71 (Official Build) (64-bit)

Additional environment information

No response

Relevant logs and/or error messages

No response

@macin macin added the Bug label Mar 8, 2024
@fiwswe
Copy link
Collaborator

fiwswe commented Mar 8, 2024

AFter investigation, is seems that when user types in the namespace name with spaces, dokuwiki redirects to the page with %20 in the url

Where does the user type in the name with spaces? The URL bar of the browser?

If so then the browser most likely replaces the spaces with %20 because space is not a valid character in URLs.

@macin
Copy link
Author

macin commented Mar 8, 2024

Oh, I wasn't very precise... This is before the page is created. There is a button to create a page and after clicking it, the native browser modal I pasted above appears to type in the name. Once I type that in, the url opens with spaces not replaced with underscores as on screenshot.

Now that you asked, maybe this is not a core dokuwiki, but a page create plugin failure? Need to check which plugin this could be...

In the previous version this worked well, i.e. when I typed in the name with spaces, the redirect to new page was already with underscores...

Just tried similar though right click index menu and similar effect.

@fiwswe
Copy link
Collaborator

fiwswe commented Mar 8, 2024

Yes, probably a plugin. DokuWiki does not have any buttons to create pages or modal dialogs to enter (new) page names.

Also, what template are you using? Might also be related?

I have a config enabled to convert spaces to underscores.

Is this the sepchar setting? I have that set to _ as well and never had any issues.

@fiwswe
Copy link
Collaborator

fiwswe commented Mar 9, 2024

Not a DokuWiki issue. See: SoarinFerret/dokuwiki-plugin-pagebuttons#20

@fiwswe fiwswe closed this as completed Mar 9, 2024
@splitbrain splitbrain reopened this Mar 9, 2024
@splitbrain
Copy link
Collaborator

I actually think there might be a regression here. Needs investigation.

@splitbrain
Copy link
Collaborator

Okay, it seems DokuWiki itself is still working as expected. If an ID with spaces is passed as ID, it will be cleaned up correctly: https://www.dokuwiki.org/doku.php?id=playground:page%20with%20spaces

However when the the ID is passed via mod_rewrite, a forbidden error is issued: https://www.dokuwiki.org/playground:page%20with%20spaces

However I don't think it is triggered by DokuWiki but the web server? But I am not sure why... the rewrite should pass the ID on to doku.php, space or no space?

If @macin is correct and this used to work in Jack Jackrum, I have no idea why. Or what the change is that causes the regression. Would be great if someone could confirm that it works on Jack.

@fiwswe
Copy link
Collaborator

fiwswe commented Mar 9, 2024

Ok, I (also?) tried this and to my surprise it worked:
https://www.dokuwiki.org/playground:page_with_spaces

The cleanup of the page id happens when saving the page. While initially editing it, it still had the spaces/%20 in the URL.

I can't say what happens in the mod_rewrite case.

Depends on the exact rewrite rules. If the rules from https://www.dokuwiki.org/install:apache are used then the URL would start out as: https://hostname/ns:page%20with%20spaces&do=edit
Thus the QSA modifier would not see a query string (which would need to start with ?) and the B modifier would escape the & -> %26 and = -> %3D yielding: https://hostname/doku.php?id=ns:page%20with%20spaces%26do%3Dedit. Would DokuWiki consider this page name forbidden? I tried https://www.dokuwiki.org/playground:page%20with%20spaces%26do%3Dedit and it does indeed return Forbidden.

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

No branches or pull requests

3 participants