Don't quote error_reporting value
authorJamie Cameron <jcameron@webmin.com>
Sat, 19 Jun 2010 21:07:44 +0000 (14:07 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sat, 19 Jun 2010 21:07:44 +0000 (14:07 -0700)
phpini/phpini-lib.pl
phpini/save_errors.cgi

index 6143b74..6f1c8ba 100755 (executable)
@@ -65,17 +65,17 @@ local @rv = map { $_->{'value'} } &find(@_);
 return $rv[0];
 }
 
-# save_directive(&config, name, [value], [newsection])
+# save_directive(&config, name, [value], [newsection], [neverquote])
 # Updates a single entry in the PHP config file
 sub save_directive
 {
-local ($conf, $name, $value, $newsection) = @_;
+local ($conf, $name, $value, $newsection, $noquote) = @_;
 $newsection ||= "PHP";
 local $old = &find($name, $conf, 0);
 local $cmt = &find($name, $conf, 1);
 local $lref;
 local $newline = $name." = ".
-                ($value !~ /\s/ ? $value :
+                ($value !~ /\s/ || $noquote ? $value :
                  $value =~ /"/ ? "'$value'" : "\"$value\"");
 if (defined($value) && $old) {
        # Update existing value
index df0581a..a47a940 100755 (executable)
@@ -24,7 +24,7 @@ if (defined($in{"error_reporting"})) {
                $in{"error_reporting"} =~ /\S/ ||
                        &error($text{'errors_ereporting'});
                &save_directive($conf, "error_reporting",
-                               $in{"error_reporting"});
+                               $in{"error_reporting"}, undef, 1);
                }
        }
 else {