Index: signwriter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signwriter/signwriter.module,v
retrieving revision 1.10.2.1
diff -u -p -r1.10.2.1 signwriter.module
--- signwriter.module 22 Sep 2008 05:12:45 -0000 1.10.2.1
+++ signwriter.module 14 Nov 2008 22:39:16 -0000
@@ -437,7 +437,7 @@ function _signwriter_profile_form($p = n
'#type' => 'textfield',
'#title' => t('Input Filter Pattern'),
'#default_value' => $p->pattern,
- '#description' => t("If this pattern is defined then this profile will be available as an input filter which you can enable on the %inputformats page. When the filter is enabled, anything matching this pattern will be replaced with a signwriter image. The pattern should be a perl regular expression. For example, to replace all headings, use: /<h.*?>.*?<\/h.*?>/s. To replace only h1 headings, use /<h1.*>.*?<\/h1>/s. To define a custom pseudo-html tag (such as <signwriter>), use: /<signwriter>.*?<\/signwriter>/", array('@input-formats-url' => url('admin/settings/filters'), '%inputformats' => 'Administer >> Site configuration >> Input formats')),'#title' => t("Shadow Colour"),
+ '#description' => t("If this pattern is defined then this profile will be available as an input filter which you can enable on the %inputformats page. When the filter is enabled, anything matching this pattern will be replaced with a signwriter image. The pattern should be a perl regular expression. For example, to replace all headings, use: /<h.*?>.*?<\/h.*?>/is. To replace only h1 headings, use /<h1.*?>.*?<\/h1>/is. To define a custom pseudo-html tag (such as <signwriter>), use: /<signwriter>.*?<\/signwriter>/", array('@input-formats-url' => url('admin/settings/filters'), '%inputformats' => 'Administer >> Site configuration >> Input formats')),
'#size' => 20,
);
@@ -569,7 +569,7 @@ function _signwriter_get_val($var, $defa
*/
function signwriter_url($profile) {
$htmltext = _signwriter_get_val($profile->text, '');
- $text = html_entity_decode($htmltext, ENT_QUOTES);
+ $text = html_entity_decode($htmltext, ENT_NOQUOTES, 'UTF-8'); // quotes are significant elements of text
$fontfile = $profile->fontfile;
$size = _signwriter_get_val($profile->fontsize, 20);
$fg = (is_string($profile->foreground)) ? _signwriter_parse_colour($profile->foreground) : array(0, 0, 0);
@@ -802,11 +802,12 @@ function theme_signwriter_text_convert($
$text = _signwriter_strip_tags($text);
$signwriter->text = $text;
$imgsrc = signwriter_url($signwriter);
- return "$text
";
+ return "$text
";
}
function _signwriter_strip_tags($text) {
- return preg_replace('/<\/?(i|b|em)>/', '', $text);
+ $text = preg_replace('/\\\/m','',$text); // $text may contain escaped quotes and the backslash shouldn't show up
+ return preg_replace('/<\/?(i|b|em)>/im', '', $text); // case insensitive and multiple replacements
}
function signwriter_get_fontpath() {