Page 1 of 1

Bug Twocents_XH with quotation marks, commas or parentheses

Posted: Mon Sep 25, 2017 2:44 pm
by Celtarcs
Hello,

I use the Twocents_XH plugin, very good ! ;)
But there is a bug: Can not create comments when the name of page (only for level 2,3,4...) contains quotation marks, commas or parentheses.
No problem for the pages of Level 1.

Example:
Creating a Level 1 page with the name:
Example1 'Example1' (Example1)
Edit the page: Write the title (Header1) "Example1 'Example1' (Example1)", and the code

Code: Select all

{{{twocents ('example1')}}}
Creating a second page of level 2 with the name:
Example2 'Example2' (Example2)
Edit the second page: The title (Header1) "Example2 'Example2' (Example2)", and the code

Code: Select all

{{{twocents ('example2')}}}
Now the test:
- Test 1: Open the page "Example1 'Example1' (Example1)" in view mode and write a comment -> Result OK
- test 2: Opening the page "Example2 'Example2' (Example2)" in view mode and writing a comment -> Result KO
Failed, the home page show in the <div></div>

Can someone confirm my tests?

Again thanks to Christoph Becker for his plugin.

Sorry for my English.

Regards

Re: Bug Twocents_XH with quotation marks, commas or parentheses

Posted: Tue Sep 26, 2017 12:37 pm
by cmb
Celtarcs wrote:Can someone confirm my tests?
Yes, indeed there is a bug. A hackish workaround would be to replace this line with:

Code: Select all

        return "{$GLOBALS['su']}&" . preg_replace('/=(?=&|$)/', '', http_build_query($this->params, null, '&'));
A clean solution appears to be much more complex.

Re: Bug Twocents_XH with quotation marks, commas or parentheses

Posted: Wed Sep 27, 2017 10:28 am
by Celtarcs
Thank you very mush for your help.

I made the same change in the plugin Cryptographp_XH.

Regards.

Re: Bug Twocents_XH with quotation marks, commas or parentheses

Posted: Wed Sep 27, 2017 9:25 pm
by cmb
Celtarcs wrote:I made the same change in the plugin Cryptographp_XH.
Ah, fine! Some other plugins may be affected by this issue as well, see https://github.com/cmb69/twocents_xh/issues/48.

Re: Bug Twocents_XH with quotation marks, commas or parentheses

Posted: Thu Sep 28, 2017 8:31 am
by Celtarcs
Thank you again for your help ;) .