Changeset 1762
- Timestamp:
- 09/30/2008 04:25:12 PM (2 months ago)
- Files:
-
- trunk/scripts/settings.class.php (modified) (5 diffs)
- trunk/scripts/update/102To110.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/scripts/settings.class.php
r1761 r1762 467 467 // no quotes for bolean and numbers 468 468 $no_quotes = array ( 469 'jlog_clean_url' ,470 'jlog_max_blog_orginal' ,471 'jlog_max_blog_big' ,472 'jlog_max_blog_small' ,473 'jlog_sub_current' ,474 'jlog_start_year' ,475 'jlog_info_by_comment' 469 'jlog_clean_url' => 'bool', 470 'jlog_max_blog_orginal' => 'int', 471 'jlog_max_blog_big' => 'int', 472 'jlog_max_blog_small' => 'int', 473 'jlog_sub_current' => 'int', 474 'jlog_start_year' => 'int', 475 'jlog_info_by_comment' => 'bool' 476 476 ); 477 477 … … 480 480 481 481 foreach($this->d as $key => $value) { 482 $key = strtoupper($key);483 482 $output = ''; 484 if( !in_array($key, $no_quotes)) {483 if(isset($no_quotes[$key])) { 485 484 // boolean values 486 if($ key == 'JLOG_CLEAN_URL' OR $key == 'JLOG_INFO_BY_COMMENT') {485 if($no_quotes[$key] == 'bool') { 487 486 if($value == 'true' OR $value === true) $output = 'true'; 488 487 else $output = 'false'; … … 497 496 $output = '"' . $this->escapeForPhp($value) . '"'; 498 497 } 499 $file_content .= 'define( "' . $key . '", ' . $output .');' . PHP_EOL;498 $file_content .= 'define(\'' . $key . '\', \'' . $output . '\');' . PHP_EOL; 500 499 } 501 500 … … 513 512 * escapeForPhp() 514 513 * 515 * escapes $value so that it can be used between double quotes in a 516 * PHP script 514 * escapes $value so that it can be used between single quotes in a 515 * PHP script, single quotes are better than double qoutes, as therein no 516 * further substituions are performed 517 517 * 518 518 * @access public … … 521 521 */ 522 522 function escapeForPhp($value) { 523 $value = str_replace("\0", '\0', $value); 524 $value = str_replace("\r", '\r', $value); 525 $value = str_replace("\n", '\n', $value); 526 $value = str_replace('"', '\"', $value); 523 $value = str_replace('\\', '\\\\', $value); 524 $value = str_replace("\0", '', $value); 525 $value = str_replace("\r", "'.chr(13).'", $value); 526 $value = str_replace("\n", "'.chr(10).'", $value); 527 $value = str_replace("'", "\'", $value); 527 528 return $value; 528 529 } trunk/scripts/update/102To110.php
r1741 r1762 37 37 // read current settings from environment and POSTed data 38 38 $update = new Settings($l); 39 $update->get_data(); 40 $update->get_userdata(); 39 $update->getDataByConstants(); 41 40 42 41 // convert all settings to utf8
