From ed65d11b350e23d69c8bb691ea9c40b4db2c313d Mon Sep 17 00:00:00 2001 From: kink Date: Sat, 1 May 2004 13:33:34 +0000 Subject: [PATCH] Escape theme name so it can be "Admin's Favourite" without parse errors in config.php (closes #805309) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7335 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/conf.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/conf.pl b/config/conf.pl index 8ee43ff8..436388b8 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -171,6 +171,9 @@ while ( $line = ) { $options[1] =~ s/[\'|\"];\s*$//; $options[1] =~ s/;$//; $options[1] =~ s/^[\'|\"]//; + # de-escape escaped strings + $options[1] =~ s/\\'/'/g; + $options[1] =~ s/\\\\/\\/g; if ( $options[0] =~ /^theme\[[0-9]+\]\[['|"]PATH['|"]\]/ ) { $sub = $options[0]; @@ -3155,7 +3158,11 @@ sub save_data { for ( $count = 0 ; $count <= $#theme_name ; $count++ ) { print CF "\$theme[$count]['PATH'] = " . &change_to_SM_path($theme_path[$count]) . ";\n"; - print CF "\$theme[$count]['NAME'] = '$theme_name[$count]';\n"; + # escape theme name so it can contain single quotes. + $esc_name = $theme_name[$count]; + $esc_name =~ s/\\/\\\\/g; + $esc_name =~ s/'/\\'/g; + print CF "\$theme[$count]['NAME'] = '$esc_name';\n"; } print CF "\n"; -- 2.25.1