I found this line of code in the Virtuemart plugin for Joomla on line 2136 in administrator/components/com_virtuemart/classes/ps_product.php
eval ('\$text_including_tax = \'$text_including_tax\';');
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Scrap my previous answer.
The reason this eval() is here is shown in the php eval docs
This is what’s happening:
At the end of this
$text_including_taxis equal to:The single quotes prevents
$taxbeing included in the original definition of the string. By usingeval()it forces it to re-evaluate the string and include the value for$taxin the string.I’m not a fan of this particular method, but it is correct. An alternative could be to use
sprintf()