<% %> should not be interpreted as PHP

Liam McDermott - August 16, 2007 - 22:55
Project:Code Filter
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

A user of my forum has been posting a lot of ASP problems (mixed in with some bad html), the codefilter module interprets this as PHP. This causes problems with the rendering of the site and messes up the code entered.

The codefilter module should ignore

<?php

?>
tags.

AttachmentSize
withtags.png70.35 KB

#1

Liam McDermott - August 16, 2007 - 22:59

How the same code looks with < % % > matching removed.

AttachmentSize
withouttags.png 85.9 KB

#2

Liam McDermott - August 16, 2007 - 23:04
Status:active» needs review

A patch to fix the problem.

AttachmentSize
php_highlight_0.patch 1011 bytes

#3

JohnAlbin - August 17, 2007 - 22:58
Priority:minor» normal
Status:needs review» needs work

I think ASP-style and short tag-style escapes are a bad idea. But rather than removing the ability to highlight them, we should add an option to the filter to allow/disallow these tag styles.

#4

Liam McDermott - August 22, 2007 - 21:36

JohnAlbin: if I create a patch to do this would you be able to commit it? Is someone maintaining this module?

Sorry, just don't want to do work for it to fall down a black hole. :)

#5

JohnAlbin - August 22, 2007 - 21:45

I don’t have commit access for this module. But if you post a patch, I’ll review it.

Also, I’m pretty sure that if a patch gets reviewed and marked RTBC, that Steven will review it and decide whether to commit it. This module is pretty important to the Drupal.org website and most certainly is being maintained.

#6

Liam McDermott - October 30, 2007 - 18:08

Sorry for not having followed-up on this sooner. Attached is a patch that adds the option to switch off ASP-style filtering to the filter Configure tab. ASP-style filtering is on--which is the module's current behaviour--by default.

AttachmentSize
php_highlight_withsettings.patch 2.11 KB

#7

Liam McDermott - October 31, 2007 - 16:09
Status:needs work» needs review

#8

sepeck - October 31, 2007 - 17:24

You may want to test to see if this issue occurs on Drupal 6 beta's as well,. Code filter has been moved into core with Drupal 6. If it is an issue, then file a separate bug report.

#9

chx - November 1, 2007 - 00:36

Yes likely D6 suffers from this but I have no problems just ripping out ASP tags support from codefilter as the PHP manual strongly discourages their use so it's quite expectable noone ever will post using those.

#10

JohnAlbin - December 4, 2007 - 23:00

I looked at Drupal 6 and, for the life of me, I could not find a "Code filter" input filter or anything like it. Care to enlighten me?

Liam, I'll review your patch tonight, if I can get to it.

 
 

Drupal is a registered trademark of Dries Buytaert.