Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix broken ECODE

  • Loading branch information...
commit d439009b6e27a2a51bef7e977c8af174bb2d28df 1 parent 545785e
Chris Nandor pudge authored
Showing with 7 additions and 8 deletions.
  1. +7 −8 Slash/Utility/Data/Data.pm
15 Slash/Utility/Data/Data.pm
View
@@ -1355,23 +1355,22 @@ sub processCustomTags {
if (grep /^ECODE$/, @{$constants->{approvedtags}}) {
my $ecode = 'ecode';
my $open = qr[\n* <\s* (?:$ecode) (?: \s+ END="(\w+)")? \s*> \n*]xsio;
- my $close_1 = qr[$open (.*?) \n* <\s* /\2 \s*> \n*]xsio; # if END is used
- my $close_2 = qr[$open (.*?) \n* <\s* /ECODE \s*> \n*]xsio; # if END is not used
+ my $close_1 = qr[($open (.*?) \n* <\s* /\2 \s*> \n*)]xsio; # if END is used
+ my $close_2 = qr[($open (.*?) \n* <\s* /ECODE \s*> \n*)]xsio; # if END is not used
while ($str =~ m[($open)]g) {
my $len = length($1);
my $end = $2;
my $pos = pos($str) - $len;
- my $newlen = 25; # length('<BLOCKQUOTE></BLOCKQUOTE>')
my $close = $end ? $close_1 : $close_2;
-
my $substr = substr($str, $pos);
if ($substr =~ m/^$close/si) {
- my $code = strip_code($2);
- $newlen += length($code);
- substr($str, $pos, $newlen) = "<blockquote>$code</blockquote>";
- pos($str) = $pos + $newlen;
+ my $len = length($1);
+ my $code = strip_code($3);
+ my $newstr = "<blockquote>$code</blockquote>";
+ substr($str, $pos, $len) = $newstr;
+ pos($str) = $pos + length($newstr);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.