Strange autoload with evaluateExpression

I use CGridView with CButtonColumn and custom buttons. One of the buttons’


URL

contains this string:


backUrl(Yii::app()->createUrl("/game/publishToggle/{$data->id}"))

. Basically it calls a method backUrl() which will return an URL with a parameter which is a reference to the current page, but nevermind that.

The issue is something which happens on my production server - when trying to evaluate this script it throws this weird error:

include(backUrl(Yii.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory

I have tracked it down to call to "function_exists()" in CComponent::evaluateExpression(). For some weird reason function_exists believes that "backUrl(Yii" is a name of a class. I have worked around it like this:


$parenthPos = strpos($_expression_, '(');

        

if(is_string($_expression_) && (!$parenthPos || !function_exists($_expression_)))

Certainly that’s not all, I should check for all non alpha-numeric characters but for now it suffices.

The PHP version on my server is 5.3.8, display_errors is set to "On". Is that an issue of Yii, something on my end or a PHP oddity?

What version of the framework are you using? Try to upgrade to the latest stable 1.1.12.

Ah, it fixes this bug, thanks! I didn’t realize a new version was released already.