Skip to main content
Topic: Settings.php Maint mode msg issue (Read 1667 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Settings.php Maint mode msg issue

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.

Re: Settings.php Maint mode msg issue

Reply #1
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.

Re: Settings.php Maint mode msg issue

Reply #2
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.

Re: Settings.php Maint mode msg issue

Reply #3
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
Be safe, Be kind, Happy Programing

Re: Settings.php Maint mode msg issue

Reply #4
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.


Re: Settings.php Maint mode msg issue

Reply #6
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.

Re: Settings.php Maint mode msg issue

Reply #7
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.
Bugs creator.
Features destroyer.
Template killer.


 

Re: Settings.php Maint mode msg issue

Reply #9
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.)
Bugs creator.
Features destroyer.
Template killer.