forked from extern/egroupware
* Api/Filemanager/WebDAV: fix SQL error if login error or WebDAV path contains non-ascii chars
in that case we transliterate these to ascii for storage in egw_access_log table, which only allows ascii chars
This commit is contained in:
parent
8e9ff828ba
commit
351c2f56b7
@ -675,7 +675,7 @@ class Session
|
|||||||
/**
|
/**
|
||||||
* Write or update (for logout) the access_log
|
* Write or update (for logout) the access_log
|
||||||
*
|
*
|
||||||
* @param string|int $sessionid nummeric or PHP session id or 0 for unsuccessful logins
|
* @param string|int $sessionid nummeric or PHP session id or error-message for unsuccessful logins
|
||||||
* @param string $login ='' account_lid (evtl. with domain) or '' for setting the logout-time
|
* @param string $login ='' account_lid (evtl. with domain) or '' for setting the logout-time
|
||||||
* @param string $user_ip ='' ip to log
|
* @param string $user_ip ='' ip to log
|
||||||
* @param int $account_id =0 numerical account_id
|
* @param int $account_id =0 numerical account_id
|
||||||
@ -685,6 +685,13 @@ class Session
|
|||||||
{
|
{
|
||||||
$now = time();
|
$now = time();
|
||||||
|
|
||||||
|
// if sessionid contains non-ascii chars (only happens for error-messages)
|
||||||
|
// --> transliterate it to ascii, as session_php only allows ascii chars
|
||||||
|
if (preg_match('/[^\x20-\x7f]/', $sessionid))
|
||||||
|
{
|
||||||
|
$sessionid = Translation::to_ascii($sessionid);
|
||||||
|
}
|
||||||
|
|
||||||
if ($login)
|
if ($login)
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->db->insert(self::ACCESS_LOG_TABLE,array(
|
$GLOBALS['egw']->db->insert(self::ACCESS_LOG_TABLE,array(
|
||||||
@ -1407,10 +1414,16 @@ class Session
|
|||||||
/**
|
/**
|
||||||
* Set action logged in access-log
|
* Set action logged in access-log
|
||||||
*
|
*
|
||||||
|
* Non-ascii chars in $action get transliterate to ascii, as our session_action column allows only ascii.
|
||||||
|
*
|
||||||
* @param string $action
|
* @param string $action
|
||||||
*/
|
*/
|
||||||
public function set_action($action)
|
public function set_action($action)
|
||||||
{
|
{
|
||||||
|
if (preg_match('/[^\x20-\x7f]/', $action))
|
||||||
|
{
|
||||||
|
$action = Translation::to_ascii($action);
|
||||||
|
}
|
||||||
$this->action = $action;
|
$this->action = $action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user