Project

General

Profile

Actions

Bug #50913

closed

t3lib_div->trimExplode fills database table sys_log

Added by Christian Finkemeier over 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2013-08-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

There are several uses of t3lib_div::trimExplode with wrong parameter types.

The second parameter must be a string, otherwise a php warning is stored to the sys_log database table, e.g. in t3lib_userAuth::getAuthInfoArray (line 1299) where the argument is an integer...

This could be easily resolved by this:

@@ -1282,20 1282,24 @@ t3lib_userAuth::getAuthInfoArray
    function getAuthInfoArray() {
        $authInfo = array();
        $authInfo['loginType'] = $this->loginType;
        $authInfo['refInfo'] = parse_url(t3lib_div::getIndpEnv('HTTP_REFERER'));
        $authInfo['HTTP_HOST'] = t3lib_div::getIndpEnv('HTTP_HOST');
        $authInfo['REMOTE_ADDR'] = t3lib_div::getIndpEnv('REMOTE_ADDR');
        $authInfo['REMOTE_HOST'] = t3lib_div::getIndpEnv('REMOTE_HOST');
        $authInfo['security_level'] = $this->security_level;
        $authInfo['showHiddenRecords'] = $this->showHiddenRecords;
            // can be overidden in localconf by SVCONF:
        $authInfo['db_user']['table'] = $this->user_table;
        $authInfo['db_user']['userid_column'] = $this->userid_column;
        $authInfo['db_user']['username_column'] = $this->username_column;
        $authInfo['db_user']['userident_column'] = $this->userident_column;
        $authInfo['db_user']['usergroup_column'] = $this->usergroup_column;
        $authInfo['db_user']['enable_clause'] = $this->user_where_clause();
-       $authInfo['db_user']['checkPidList'] = $this->checkPid ? $this->checkPid_value : '';
+       $authInfo['db_user']['checkPidList'] = ($this->checkPid && $this->checkPid_value)
+           ? $this->checkPid_value
+           : '';
-       $authInfo['db_user']['check_pid_clause'] = $this->checkPid ? ' AND pid IN (' . $GLOBALS['TYPO3_DB']->cleanIntList($authInfo['db_user']['checkPidList']) . ')' : '';
+       $authInfo['db_user']['check_pid_clause'] = ($this->checkPid && $this->checkPid_value)
+           ? ' AND pid IN (' . $GLOBALS['TYPO3_DB']->cleanIntList($authInfo['db_user']['checkPidList']) . ')'
+           : '';
        $authInfo['db_groups']['table'] = $this->usergroup_table;
        return $authInfo;
    }


Files

class.tslib_fe.php.diff (2.36 KB) class.tslib_fe.php.diff Christian Finkemeier, 2013-08-12 13:06
class.t3lib_tsparser.php.diff (634 Bytes) class.t3lib_tsparser.php.diff Christian Finkemeier, 2013-08-12 13:06
class.tslib_pibase.php.diff (111 Bytes) class.tslib_pibase.php.diff Christian Finkemeier, 2013-08-12 13:06
class.tx_cssstyledcontent_pi1.php.diff (245 Bytes) class.tx_cssstyledcontent_pi1.php.diff Christian Finkemeier, 2013-08-12 13:06
class.tslib_content.php.diff (187 Bytes) class.tslib_content.php.diff Christian Finkemeier, 2013-08-12 13:06

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #42921: t3lib_div->trimExplode fills database table sys_logClosed2012-11-13

Actions
Related to TYPO3 Core - Bug #52346: Incomplete backup in AbstractUserAuthenticationTestClosed2013-09-28

Actions
Related to TYPO3 Core - Bug #63959: t3lib_div->trimExplode fills database table sys_logClosed2014-12-17

Actions
Actions

Also available in: Atom PDF