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!
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!
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
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
|
DetailsManual 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.
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.
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.