check custom language tags for contain special characters
drimsun - January 11, 2008 - 04:48
| Project: | GeSHi Filter for syntax highlighting |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | soxofaan |
| Status: | closed |
Description
Hi
After installing and activating the GeSHi filter I get
warning: preg_replace_callback() [function.preg-replace-callback]: Unknown modifier '|'
in geshifilter.module on line 1019.
in geshifilter.module on line 1096.
all over the place when testing code highlighting =(
Any idea why this happens? I can't imagine '|' being an invalid regexp in certain php versions?

#1
Ok I nailed down the problem =)
If you use special characters for custom language tags it may mess up the regexp code
because apparently the special characters aren't escaped with a \
For instance the # in [c#] would abruptly end a regexp and cause errors.
#2
updated title
#3
Extra validation of custom language tags is needed.
For example, custom language tags should:
#4
This is a first version of a patch that should solve the initial problem from #1.
Custom language tags like [c++] and [c#] should work now.
TODO: better validation of custom language tags (see #3)
#5
committed patch #4: http://drupal.org/cvs?commit=96150, http://drupal.org/cvs?commit=96151
still todo: better validation of custom tags (see #3)
#6
#7
fixed in HEAD (for Drupal 6) by http://drupal.org/cvs?commit=113423 (also includes SimpleTest test)
#8
fixed in DRUPAL-5--2 by http://drupal.org/cvs?commit=118057
#9
Automatically closed -- issue fixed for two weeks with no activity.