Changeset 1763

Show
Ignore:
Timestamp:
09/30/2008 04:37:18 PM (2 months ago)
Author:
driehle
Message:

'nother Bugfix for #199

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/scripts/settings.class.php

    r1762 r1763  
    494494      // string values 
    495495      else { 
    496         $output = '"' . $this->escapeForPhp($value) . '"'; 
     496        $output = '\'' . $this->escapeForPhp($value) . '\''; 
    497497      } 
    498       $file_content .= 'define(\'' . $key . '\', \'' . $output . '\');' . PHP_EOL; 
     498      $key = '\'' . $this->escapeForPhp(strtoupper($key)) . '\''; 
     499      $file_content .= 'define(' . $key . ', ' . $output . ');' . PHP_EOL; 
    499500    } 
    500501 
     
    522523  function escapeForPhp($value) { 
    523524    $value = str_replace('\\', '\\\\', $value); 
     525    $value = str_replace("'",  "\'", $value); 
    524526    $value = str_replace("\0", '', $value); 
     527    $value = str_replace("\r\n", "'.chr(13).chr(10).'", $value); 
    525528    $value = str_replace("\r", "'.chr(13).'", $value); 
    526529    $value = str_replace("\n", "'.chr(10).'", $value); 
    527     $value = str_replace("'",  "\'", $value); 
    528530    return $value; 
    529531  } 
  • trunk/scripts/update/102To110.php

    r1762 r1763  
    3737            // read current settings from environment and POSTed data 
    3838            $update = new Settings($l); 
    39             $update->getDataByConstants(); 
     39            $update->importDataByConstants(); 
    4040    
    4141            // convert all settings to utf8