Issue Bug Closed

#15046Handling of $this->altRootline in class.t3lib_matchcondition.php

Andreas Otto † 10/13/05, 09:45 updated 10/14/05, 10:15

Description

While working with TS in a BE module I discovered that  this creates PHP
warnings because of not serving the right variable type to array functions:

    1:  {main}()
    2:  tx_dkdstaticupload_module1->init()
    3:  t3lib_TStemplate->start()
    4:  t3lib_TStemplate->matching()
    5:  t3lib_matchCondition->match()
    6:  reset()

Basically this is all about the variable “$this->altRootLine” which should
always be an array. In my case this variable is set to an empty string on
line 4 of the stack trace above. A solution would be to check on line 5 if
“$this->altRootLine” is an array or not and then set it as an empty array if
needed:

    1: if ( !is_array( $this->altRootLine ) ) {
    2:     $this->altRootLine = array();
    3: }

(issue imported from #M1594)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.