Skip Menu |

This queue is for tickets about the HTML-Template-Pro CPAN distribution.

Report information
The Basics
Id: 109255
Status: new
Priority: 0/
Queue: HTML-Template-Pro

People
Owner: vlasenko [...] imath.kiev.ua
Requestors: unrtstRMSPAM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.38
  • 0.39
  • 0.40
  • 0.41
  • 0.42
  • 0.43
  • 0.44
  • 0.45
  • 0.46
  • 0.48
  • 0.50
  • 0.52
  • 0.53
  • 0.54
  • 0.55
  • 0.56
  • 0.57
  • 0.58
  • 0.59
  • 0.60
  • 0.61
  • 0.62
  • 0.64
  • 0.65
  • 0.66
  • 0.67
  • 0.68.1
  • 0.69
  • 0.70
  • 0.71
  • 0.72
  • 0.73
  • 0.74
  • 0.75
  • 0.76
  • 0.80
  • 0.81
  • 0.82
  • 0.83
  • 0.84
  • 0.85
  • 0.86
  • 0.87
  • 0.90
  • 0.91
  • 0.92
  • 0.93
  • 0.94
  • 0.95
  • 0.9501
  • 0.9502
  • 0.9503
  • 0.9504
  • 0.9505
  • 0.9506
  • 0.9507
  • 0.9508
  • 0.9509
  • 0.9510
Fixed in: (no value)



Subject: Backslash not escaped in the uri escaping (pstrutils.inc urlencode_pstring)
In pstrutils.inc in urlencode_pstring, it has a comment: * # do the translation (RFC 2396 ^uric) * s!([^a-zA-Z0-9_.\-])!sprintf('%%%02X', $_) The code then has the test case: if ((curchar>='a' && curchar<='z') || (curchar>='A' && curchar<='Z') || (curchar>='0' && curchar<='9') || curchar=='_' || curchar=='.' || curchar=='\\' || curchar=='-' ) *(buf+offset)=curchar; ... The backslash ('\\') is not in that character class in the regex. The backslash in the regex is, unnecessarily, escaping the dash ("-") following it. FWIW, I found this while comparing URI::Escape, URI::Escape::XS, HTML::Template's ESCAPE="url", and HTML::Template::Pro's ESCAPE="url". * URI::Escape::uri_escape : does not handle multi-byte characters (because it's incorrectly treating them as characters instead of bytes). * URI::Escape::uri_escape_utf8 : incorrectly handles single high byte characters (because it utf8::upgrade's the string... so it will require utf8::downgrade on the other side, and it can not handle arbitrary data, like JPEG byte strings). * URI::Escape::XS::uri_escape : does NOT encode [~!*'()], while all other methods do. Most of those were removed from the unreserved character set with rfc3986. * HTML::Template : makes the same mistakes as URI::Escape::uri_escape, but silently drops multibyte chars from its output ("test\xE5test" becomes "testtest"). * HTML::Template::Pro : handles everything correctly, except the backslash. Fix is to just remove the "|| curchar=='\\' " from the if statement.