ソースを参照

Config saves as single quote

Cerothen 9 年 前
コミット
616d5ca88d
1 ファイル変更3 行追加3 行削除
  1. 3 3
      functions.php

+ 3 - 3
functions.php

@@ -779,7 +779,7 @@ function createConfig($array, $path = 'config/config.php', $nest = 0) {
 				$item = $v;
 				$item = $v;
 				break;
 				break;
 			case 'string':
 			case 'string':
-				$item = '"'.addcslashes($v,'\'"\\$').'"';
+				$item = "'".str_replace(array('\\',"'"),array('\\\\',"\'"),$v)."'";
 				break;
 				break;
 			case 'array':
 			case 'array':
 				$item = createConfig($v, false, $nest+1);
 				$item = createConfig($v, false, $nest+1);
@@ -789,13 +789,13 @@ function createConfig($array, $path = 'config/config.php', $nest = 0) {
 		}
 		}
 		
 		
 		if($allowCommit) {
 		if($allowCommit) {
-			$output[] = str_repeat("\t",$nest+1).'"'.$k.'" => '.$item;
+			$output[] = str_repeat("\t",$nest+1)."'$k' => $item";
 		}
 		}
 	}
 	}
 	
 	
 	if (!$nest && !isset($array['CONFIG_VERSION'])) {
 	if (!$nest && !isset($array['CONFIG_VERSION'])) {
 		// Inject Current Version
 		// Inject Current Version
-		$output[] = "\t".'"CONFIG_VERSION" => "'.INSTALLEDVERSION.'"';
+		$output[] = "\t'CONFIG_VERSION' => '".INSTALLEDVERSION."'";
 	}
 	}
 	
 	
 	// Build output
 	// Build output