ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: Burke Knight on February 03, 2016, 07:29:47 pm

Title: Settings.php Maint mode msg issue
Post by: Burke Knight on February 03, 2016, 07:29:47 pm
Okay, here's a strange one.
When went to edit Settings.php I found an issue.

Maintenance mode message in settings in admin: Okay faithful users...we're attempting to restore an older backup of the database...news will be posted once we're back!

Yet, every time save that page, it adds to it in Settings.php:

Code: [Select]
$mmessage = 'Okay faithful users...we#039;re attempting to restore an older backup of the database...news will be posted once we#039;re back!';		#039;re back!';		#039;re back!';		#039;re back!';		#039;re back!';		#039;re back!';		#039;re back!';

Yet, does not show any errors in log.
Title: Re: Settings.php Maint mode msg issue
Post by: Joshua Dickerson on February 03, 2016, 07:52:19 pm
That's exactly what it says?

Should be:
Code: [Select]
$mmessage = 'Okay faithful users...we\'re attempting to restore an older backup of the database...news will be posted once we\'re back!';

If it's not adding those slashes, something is wrong.
Title: Re: Settings.php Maint mode msg issue
Post by: Burke Knight on February 03, 2016, 08:03:05 pm
Agreed. Which is why I reported it as a bug.  ;D

@Joshua Dickerson, I think somehow, when it misses doing the slashes, and does the ' as #039; it's the extra ; in the code that's causing the duplication when saving. Oh, and I did not notice, it parsed in the code block. Before the ' in we're (both times) it was actually the #039; code.
Title: Re: Settings.php Maint mode msg issue
Post by: Spuds on February 03, 2016, 09:53:58 pm
Yup its a bug ... I'll add it to the 1.0.7 tracker

https://github.com/elkarte/Elkarte/issues/2369


In quick testing you need to enter two 's for it to generate the issue.   so we're testing is fine but we're we're testing causes the issue
Title: Re: Settings.php Maint mode msg issue
Post by: Burke Knight on February 04, 2016, 12:17:41 am
Quote from: Spuds – In quick testing you need to enter two 's for it to generate the issue.   so we're testing is fine but we're we're testing causes the issue

However, it does appear, that the 2 we're do not need to be next to each other.
Title: Re: Settings.php Maint mode msg issue
Post by: Adrek on February 04, 2016, 05:12:46 pm
It's related to not parsing HTML? http://www.elkarte.net/community/index.php?topic=3151.0
Title: Re: Settings.php Maint mode msg issue
Post by: Burke Knight on February 04, 2016, 07:53:25 pm
Quote from: phantom – It's related to not parsing HTML? http://www.elkarte.net/community/index.php?topic=3151.0

Well, saying it's the default message that comes set when install ElkArte, I'd have to say no, since no HTML in the message.
However, was anything changed after that thread, in the install for this section?
Not too sure since the date of that thread and the 1.0.6 update date, are close, due to the last reply besides yours from today. XD.
Title: Re: Settings.php Maint mode msg issue
Post by: emanuele on February 05, 2016, 02:47:47 am
It's something I noticed when I was looking at the html issue.
The #code is introduced by htmlspecialchars, and the line is borked later on by Elk trying to identify any comment at the end of the line.
Title: Re: Settings.php Maint mode msg issue
Post by: Burke Knight on February 05, 2016, 07:28:23 am
@emanuele, is this why it adds on each save of the settings page?
Title: Re: Settings.php Maint mode msg issue
Post by: emanuele on February 05, 2016, 10:18:15 am
AFAICS it's the only meaningful reason: the parsing code stops at the first # and splits the string, though the input box takes the test from the global variable, so the text is always correct, but the line of code saved becomes longer inheriting the pieces of string after the first #. (Off the top of my head, so I may be wrong.)