CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#7514] Filtering of PHP tags in UDT

avatar
Created By: Jan Hartmann (jhartman)
Date Submitted: 2012-01-25 10:36

Assigned To: Robert Campbell (calguy1000)
Resolution: Fixed
State: Closed
Summary:
Filtering of PHP tags in UDT
Detailed Description:
I would like to propose a change in how User Defined Tags are handled:

As I often edit UDTs in an external editor (e.g. opening them with 'Its all
text!' extension for Mozilla Firefox), it would be much more convenient to be
able to use opening and closing PHP tags (<?php | ?>) in the code (in order to
get automatic and correct syntax highlighting etc.).

The simplest solution is by filtering the user supplied code by regex:

function remove_phptags($code)
{
    return preg_replace("/^<\?php|\?>$/","",$code);
}

This function needs to be applied in all places where the UDT code gets eval'd.

I tested it in CMSMS 1.7.1 and it works like a charm. I am now able to write
UDTs with or without opening/closing PHP tags and get automatic syntax
highlighting in external editors.

This should be in Core as it enhances the usability without the need for massive
code changes.

History

Comments
avatar
Date: 2013-03-16 23:22
Posted By: Robert Campbell (calguy1000)

Done, for 2.0
      
avatar
Date: 2015-09-06 13:02
Posted By: Rolf (rolf1)

CMS Made Simple 2.0 is released
      
Updates

Updated: 2015-09-06 13:02
state: Open => Closed

Updated: 2013-03-16 23:22
resolution_id: 6 => 7

Updated: 2012-09-07 16:09
resolution_id: 5 => 6

Updated: 2012-09-07 16:09
resolution_id: => 5
assigned_to_id: 100 => 106