CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#5747] Error when final line of UDT is a comment

avatar
Created By: Wayne ONeil (wishbone)
Date Submitted: Wed Nov 24 12:18:43 -0500 2010

Assigned To:
Version: 1.9.1
CMSMS Version: None
Severity: Trivial
Resolution: Fixed
State: Closed
Summary:
Error when final line of UDT is a comment
Detailed Description:
This issue is in 1.9.1 and many (if not all) previous versions.

If you create (or edit) a UDT and the final line is a comment, you get the
following error upon submission:

Invalid code entered.
Parse error: syntax error, unexpected $end in
/path/to/cmsms/admin/adduserplugin.php(100) : eval()'d code on line 2

An example UDT would be:

echo "test";
// test comment

This is very minor, but had me scratching my head for 15 minutes. :)  The
workaround is to either remove the comment, or add an extra blank line at the
end.

Wayne (wishbone)


History

Comments
avatar
Date: 2010-12-17 22:55
Posted By: Robert Campbell (calguy1000)

Fixed in R6833
      
avatar
Date: 2011-01-17 14:36
Posted By: bess (bess)

i don't know if your fix will fix my problem dear calguy1000 but i've got the
same error when i used heredoc syntaxe without adding an extra blank line at the
end !

http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

exemple of code :

echo <<<HTML
<b>foo</b>
HTML;

it's make sense that your fix solve my problem too, but just in case, can you
confirm this point too ? or must i open another ticket  ;)
      
avatar
Date: 2011-01-17 15:52
Posted By: Robert Campbell (calguy1000)

@bess A "\n" is added to the code string before it is executed.... that should
cover it.
      
avatar
Date: 2011-01-31 11:54
Posted By: bess (bess)

perfect !
      
avatar
Date: 2011-02-09 09:31
Posted By: Rolf (rolf1)

1.9.3 is released
      
Updates

Updated: 2011-02-09 09:31
state: Open => Closed

Updated: 2010-12-17 22:55
resolution_id: 6 => 7

Updated: 2010-11-24 13:29
resolution_id: => 6