Project

General

Profile

Actions

Bug #33316

closed

Syntax-Error: Two If-clauses with assign-operator instead of equal-operator in class.db_list.inc; Solution included!

Added by Clemens Riccabona almost 13 years ago. Updated almost 13 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Code Cleanup
Target version:
-
Start date:
2012-01-19
Due date:
% Done:

0%

Estimated time:
0.10 h
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

I don't know if the code is in any use, but due to some debugging I stumbled over a syntax-error in class.db_list.inc in at least TYPO3 4.5.9 and 4.5.10 at line 194 ff

// code snippet original begin
// this will hide records from display - it has nothing todo with user rights!!
if ($pidList = $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
if ($pidList = $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
$this->perms_clause .= ' AND pages.uid NOT IN ('.$pidList.')';
}
}
// code snippet original end

This should be changed to this I think:


// code snippet corrected begin
// this will hide records from display - it has nothing todo with user rights!!
if ($pidList $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
if ($pidList $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
$this->perms_clause .= ' AND pages.uid NOT IN ('.$pidList.')';
}
}
// code snippet corrected end

Actions #1

Updated by Clemens Riccabona almost 13 years ago

aehm, seems that my '==' has been cleared out by the software.
so my code posted is NOT correct, but i could not find the possibility to correct it. ...

Actions #2

Updated by Markus Klein almost 13 years ago

  • Target version deleted (4.5.11)

Not a bug!

Look at the code

    // this will hide records from display - it has nothing todo with user rights!!
if ($pidList = $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
    if ($pidList = $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
        $this->perms_clause .= ' AND pages.uid NOT IN ('.$pidList.')';
    }
}

This assignment is done by intention as it is used in the following line each time.

Actions #3

Updated by Clemens Riccabona almost 13 years ago

ah, ok, cryptic. ;)
so it is not a bug, but ugly coding style (IMHO) ... ;)
and ide will most likely always complain about this (netbeans does). ...

sry, my fault. i should read 'more exactly' ... ;)

could be closed so.

Actions #4

Updated by Stefan Galinski almost 13 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF