Login!
Lost password?
 

MODx Bug/Feature Tracker and Feature Requests

Welcome to the MODx CMS Tracker. Please choose the appropriate project from the drop down menu and provide as much information as possible regarding your server environment and browser. Thanks!

FS#732 — @EVAL not working with multi-line scripts

Attached to Project — MODx
Opened by Jason Coward (opengeek) - Wednesday, 27 December 2006, 12:15PM
Last edited by Jason Coward (opengeek) - Saturday, 30 December 2006, 09:05PM
Task Type Bug Report
Category Core Distribution
Status Closed
Assigned To Jason Coward (opengeek)
Operating System All
Severity Critical
Priority Immediate
Reported Version 0.9.5
Due in Version 0.9.6
Due Date Undecided
Percent Complete 100%

Details

The regexp introduced with 0.9.5 into the code responsible for parsing TV command bindings will only work with PHP scripts that fit on the same line as the @EVAL command. All other lines are truncated from the script and thus are never evaluated.
This task depends upon

This task blocks these from closing
Closed by  Ryan Thrash (rthrash)
Saturday, 14 April 2007, 09:48AM
Reason for closing:  Fixed
Comment by Jason Coward (opengeek) - Saturday, 30 December 2006, 09:05PM
  • Field changed: Percent Complete (0% → 100%)
This is fixed in the 095dev branch and will be merged to trunk for the 0.9.5.1 release.


Comment by Jan Willem Nienhuis (brikkelt) - Monday, 01 January 2007, 03:50PM
The 'm' modifier in the regexp doesn't do a multiline search, but makes each \n the beginning of a line, that can be matched by the ^ metacharacter. In short: 'm' doesn't do the trick.

What you and I are looking for is the 's' modifier, which makes the '.' metacharacter include the \n as well (which it doesn't by default).

$regexp= '/@(' . implode('|', $BINDINGS) . ')\s*(.*)/is';

Works for me!

Greetings, JW