Invenzzia »

IMPORTANT ANNOUNCEMENT

Due to the uncertain status of the Flyspray project, lack of new releases and moving the code repository to Github, we decided to shutdown this issue tracker by the end of January 2011. From that date, the bugs should be reported directly in Github project repositories.

List of repositories:

Open Power Template 2.x family

PLEASE PROVIDE THE TEMPLATES AND/OR PHP CODE IN THE TASK DESCRIPTION (Not URL-s to them). THAT ALLOWS US TO REPRODUCE THE PROBLEM! OTHERWISE WE ARE NOT ABLE TO HELP YOU!

Remember to hide all the security-related pieces of code from the task description, like passwords, server paths etc. for your own safety. Once we close the task, we cannot edit it anymore!
Tasklist

FS#50 - OPT2 accepts variables beggining with number

Attached to Project: Open Power Template
Opened by Jacek Jędrzejewski (eXtreme) - Tuesday, 03 February 2009, 04:31 GMT-8
Last edited by Zyx (Zyx) - Wednesday, 11 February 2009, 03:23 GMT-8
Task Type Bug Report
Category Compiler
Status Closed
Assigned To No-one
Operating System OS-independent
Severity Medium
Priority Normal
Reported Version 2.0-beta1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Manual says:

"The variable name begins with an underscore or a letter, and later the digits from 0 to 9 are also allowed."

However, it is possible to make a variable with number at the beggining:

PHP:
$view->assign('2foobar', 'barbaz');

TPL:
{$2foobar}

Complier should throw an exception and assign() should not allow to assign a variable which contains disallowed signs. Currently there is no check, you can assign whatever you want and it is bad IMO. Simple reqex won't slow down OPT.
This task depends upon

Closed by  Zyx (Zyx)
Wednesday, 11 February 2009, 03:23 GMT-8
Reason for closing:  Fixed
Additional comments about closing:  The compiler part is fixed in rev. 50, the API part I'll skip for now, because it requires some deeper investigations.
Comment by Zyx (Zyx) - Tuesday, 03 February 2009, 09:45 GMT-8
When it comes to the compiler - yes, it should.
When it comes to the assign() - running any regular expression is quite time-consuming operation. And if the operation is one of the most common... the problem is worth considering, however I would not decide too fast. In fact, we should use assign() only if the variable name is auto-generated and here, such control could be very important.

Loading...