mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-07 11:02:17 +09:00
Issue 581: Can not login after r9685
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9702 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
15bc72057b
commit
9f24618740
3 changed files with 12 additions and 2 deletions
|
|
@ -7,7 +7,8 @@
|
|||
var $is_operation = false;
|
||||
var $operation = '';
|
||||
|
||||
var $_is_string = false;
|
||||
var $_is_string = false; ///< Checks if value is plain string or name of XE function (ipaddress, plus, etc).
|
||||
var $_is_string_from_function = false; //< Checks if value is string resulted from evaluating a piece of PHP code (see $_SERVER[REMOTE_ADDR])
|
||||
|
||||
function DefaultValue($column_name, $value){
|
||||
$dbParser = &DB::getParser();
|
||||
|
|
@ -23,6 +24,10 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
function isStringFromFunction(){
|
||||
return $this->_is_string_from_function;
|
||||
}
|
||||
|
||||
function isSequence(){
|
||||
return $this->is_sequence;
|
||||
}
|
||||
|
|
@ -58,6 +63,7 @@
|
|||
switch($func_name) {
|
||||
case 'ipaddress' :
|
||||
$val = '$_SERVER[\'REMOTE_ADDR\']';
|
||||
$this->_is_string_from_function = true;
|
||||
break;
|
||||
case 'unixtime' :
|
||||
$val = 'time()';
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@
|
|||
//else $this->default_value = $dbParser->parseColumnName($column->attrs->default);
|
||||
else {
|
||||
$this->default_value = $default_value->toString();
|
||||
if($default_value->isStringFromFunction()){
|
||||
$this->default_value = '"\'".' . $this->default_value . '."\'"';
|
||||
}
|
||||
if($default_value->isString()){
|
||||
$this->default_value = '"' . $this->default_value . '"';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,8 +68,9 @@
|
|||
$argsString = '$args->session_key = 339321; $args->val = "yuhuu";';
|
||||
$expected = 'update `xe_session` as `session`
|
||||
set `member_srl` = 0, `val` = \'yuhuu\'
|
||||
, `ipaddress` = \''. $_SERVER['REMOTE_ADDR'] .'\'
|
||||
, `last_update` = ' . date("YmdHis") . '
|
||||
where `session_key` = \'339321\'';
|
||||
where `session_key` = \'339321\'';
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue