Kod
Notice
Indirect modification of overloaded property Template::$tabs has no effect
Błąd wystąpił w pliku C:\PHP\cms\libary\template.class.php(61) : eval()'d code ( Linia : 29 )
Indirect modification of overloaded property Template::$tabs has no effect
Błąd wystąpił w pliku C:\PHP\cms\libary\template.class.php(61) : eval()'d code ( Linia : 29 )
Pytanie brzmi dlaczego ?
A teraz okoliczności:
Kod który jest evalowany
Kod
<ul>
<?php foreach( $this->tabs as $aTab ): ?>
<li id="current"><a href="<?php echo $aTab['href']?>"><span><?php echo $aTab['text']?></span></a></li>
<?php endforeach; ?>
</ul>
<?php foreach( $this->tabs as $aTab ): ?>
<li id="current"><a href="<?php echo $aTab['href']?>"><span><?php echo $aTab['text']?></span></a></li>
<?php endforeach; ?>
</ul>
Eval jest wykonany w metodzie render() w klasie Template. Oto ta metoda...
<?php public function render( $sFileName ) { { // To żeby nieco ograniczyć możliwości użytkownikowi ... '/$_POST/' , '/$_GET/' , '/$GLOABLS/' , '/$_REQUEST/' , // *** // '/$this->__aContent/' ); foreach( $aBanned as $sBannedString ) { throw new Exception( 'Illegal procedure in template ( '.$sFileName.' )' ); } } else { throw new Exception( 'Template file ( '.$sFileName.' ) doesn't exist ); } }
Są jeszcze 4 metody które zmienne przesłane do templatki zapisują ...
<?php public function __set( $sVar , $mValue ) { $this->__aContent[ $sVar ] = $mValue; } public function __get( $sVar ) { return $this->__aContent[ $sVar ]; } public function __unset( $sVar ) { } public function __isset( $sVar ) { } ?>