X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=config%2Fconf.pl;h=5b191039eabaecaca04273925693dd58ea71349b;hb=d4f20027c5fc4d0d8ff6ad724c941b78a321bfa4;hp=8ee43ff8631a375fb43b68aa7e62b4c751215f45;hpb=de74555eb9470ae23796b4fc224e59f6bb1458e7;p=squirrelmail.git diff --git a/config/conf.pl b/config/conf.pl index 8ee43ff8..5b191039 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]; @@ -289,7 +292,7 @@ $allow_thread_sort = 'false' if ( !$allow_thread_sort ); $allow_server_sort = 'false' if ( !$allow_server_sort ); $no_list_for_subscribe = 'false' if ( !$no_list_for_subscribe ); $allow_charset_search = 'true' if ( !$allow_charset_search ); -$allow_advanced_search = '0' if ( !$allow_advanced_search) ; +$allow_advanced_search = 0 if ( !$allow_advanced_search) ; $prefs_user_field = 'user' if ( !$prefs_user_field ); $prefs_key_field = 'prefkey' if ( !$prefs_key_field ); $prefs_val_field = 'prefval' if ( !$prefs_val_field ); @@ -478,7 +481,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) { print "11. Allow server-side sorting : $WHT$allow_server_sort$NRM\n"; print "12. Allow server charset search : $WHT$allow_charset_search$NRM\n"; print "13. Allow advanced search : $WHT$allow_advanced_search$NRM\n"; - print "14. PHP session name : $WHT$session_name$NRM\n"; + print "14. PHP session name : $WHT$session_name$NRM\n"; print "\n"; print "R Return to Main Menu\n"; } elsif ( $menu == 5 ) { @@ -2145,18 +2148,20 @@ sub command314 { # command315 (UID support) obsoleted. # advanced search option - sub command316 { - print "This option allows you to change the advanced search form.\n"; - print "Set to 0 to disable the advanced search, 1 to have advanced\n"; - print "and search only or 2 for both forms.\n"; - print "[$WHT$allow_advanced_search$NRM]: $WHT"; - $allows_advanced_search = ; - chomp($allows_advanced_search); - if ( $allows_advanced_search eq "" ) { - $allows_advanced_searchn=0; + print "This option allows you to control the use of advanced search form.\n"; + print " 0 = enable basic search only\n"; + print " 1 = enable advanced search only\n"; + print " 2 = enable both\n"; + print "\n"; + + print "Allowed search (0,1,2)? [$WHT$allow_advanced_search$NRM]: $WHT"; + $new_allow_advanced_search = ; + if ( $new_allow_advanced_search =~ /^[0|1|2]\n/i ) { + $allow_advanced_search = $new_allow_advanced_search; } - return $allows_advanced_search; + $allow_advanced_search =~ s/[\r|\n]//g; + return $allow_advanced_search; } @@ -3138,8 +3143,10 @@ sub save_data { print CF "\$allow_thread_sort = $allow_thread_sort;\n"; # boolean print CF "\$allow_server_sort = $allow_server_sort;\n"; - # boolean + # boolean print CF "\$allow_charset_search = $allow_charset_search;\n"; + # integer + print CF "\$allow_advanced_search = $allow_advanced_search;\n"; print CF "\n"; # all plugins are strings @@ -3155,7 +3162,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"; @@ -3246,8 +3257,6 @@ sub save_data { print CF "\$use_smtp_tls = $use_smtp_tls;\n"; # string print CF "\$session_name = '$session_name';\n"; - # string - print CF "\$allow_advanced_search = '$allow_advanced_search';\n"; print CF "\n";