Help! All configure fields now empty when I try to edit

Once you've installed phpList Version 2... ask questions here!
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation. This is for Version 2 of phpList (the orange one).

Help! All configure fields now empty when I try to edit

Postby kanjigirl » 4:15pm, Wed 19 Sep, 2007

My 2.10.5 install was working fine earlier today.

I uploaded a template, and got that working too, but now, when I go to the Config page and try to change any of the default text messages, the textarea or text field is showing up blank. Nothing in there, I tried selecting all and it's empty.

The messages are showing up normally on the Config page, they're just not there when I try to edit anything.

I deleted the template wondering if that had anything to do with it, but no. And again, I was able to edit Config messages this morning.

Please help, I have no clue what to try next...
kanjigirl
PL Nut
 
Posts: 18
Joined: 4:18pm, Fri 21 Oct, 2005

Probably cause

Postby judgej » 12:15am, Sun 16 Mar, 2008

I found the same problem. I don't know if you have found the solution, but I believe I have found the problem.

The config screen does a substitution of the 'website' variable into all config values before displaying them in the edit forms. If the website just so happens to contain '/' characters, i.e. the website is in a sub-directory rather than the root directory, the extra '/' causes the string substitution to go too far and it blanks out the value.

The solution is in admin/configure.php, lines 64 and 65, which read as follows in PHPlist 2.10.5:

Code: Select all
    $value = preg_replace('/'.$domain.'/i','[DOMAIN]', $value);
    $value = preg_replace('/'.$website.'/i','[WEBSITE]', $value);


They should read:

Code: Select all
    $value = preg_replace('/'.preg_quote($domain, '/').'/i','[DOMAIN]', $value);
    $value = preg_replace('/'.preg_quote($website, '/').'/i','[WEBSITE]', $value);


Hope that helps.

I'm hoping someone with a bug tracker login can add this to the list of bugs. I'm all out of registrations for the day ;-)

-- Jason
judgej
phpLister
 
Posts: 8
Joined: 12:08am, Sun 16 Mar, 2008

Re: Probably cause

Postby judgej » 12:37am, Sun 16 Mar, 2008

I've now noticed on this config page, that editing some customised fields will revert the field back to the default value, ignoring the customised version.

For example, I customised the unsubscribe page, and can see the customised text, but when I go back to change it a little more, I am presented with the pre-customised default text.

-- Jason

Fixed: inserting this line at admin/config.php line 54:

Code: Select all
$dbval = getConfig($id);


It is added just before or after the:

Code: Select all
$val = $default_config[$id];


Has the main config screen really been this broken for six month...???
judgej
phpLister
 
Posts: 8
Joined: 12:08am, Sun 16 Mar, 2008

Re: Probably cause

Postby H2B2 » 6:32pm, Sun 16 Mar, 2008

judgej wrote:Has the main config screen really been this broken for six month...???
Not for me, and considering the low numbers of users that appear to have this problem, I guess it might be related to your specific server setup.

It would be useful to specify your server's details, including versions of OS, IIS/Apache, PHP, MySQL. This might help developers find solutions for issues that occur in server environments other than the ones they use for running tests.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: Probably cause

Postby judgej » 3:35pm, Mon 17 Mar, 2008

When I look in the code, it does exactly what I would expect it to do, so I know it is nothing to do with Apache or anything like that.

The code is wrong: it passes an unescaped string into the regular expression of a preg_replace(), and when that string contains '/' characters, it interferes with the terminating characters of the expression.

I am guessing that most people put their 'lists' folder in the web root, and not in a sub-directory.

Anyway - I've raised a bug, so the devs know about it. But as you say, most people won't notice the fix, because it is a not a problem in the majority of circumstances.

-- JJ
judgej
phpLister
 
Posts: 8
Joined: 12:08am, Sun 16 Mar, 2008


Return to Question & Problems - after installing

Who is online

Users browsing this forum: No registered users and 3 guests