Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge commit '4cbbfd80' into 1.2-branch

  • Loading branch information...
commit 617d25a754cf367fc015b1d7fe124317e1a0d4de 2 parents c531a70 + 4cbbfd8
@rmccue rmccue authored
Showing with 4 additions and 27 deletions.
  1. +4 −27 simplepie.inc
View
31 simplepie.inc
@@ -11873,34 +11873,11 @@ class SimplePie_IRI
// If we have a % character
if ($string[$position] === '%')
{
- // If we have a pct-encoded section
+ // If we have a pct-encoded section normalise the pct-encoded to uppercase
if ($position + 2 < $strlen && strspn($string, '0123456789ABCDEFabcdef', $position + 1, 2) === 2)
{
- // Get the the represented character
- $chr = chr(hexdec(substr($string, $position + 1, 2)));
-
- // If the character is valid, replace the pct-encoded with the actual character while normalising case
- if (strpos($valid_chars, $chr) !== false)
- {
- if ($case & SIMPLEPIE_LOWERCASE)
- {
- $chr = strtolower($chr);
- }
- elseif ($case & SIMPLEPIE_UPPERCASE)
- {
- $chr = strtoupper($chr);
- }
- $string = substr_replace($string, $chr, $position, 3);
- $strlen -= 2;
- $position++;
- }
-
- // Otherwise just normalise the pct-encoded to uppercase
- else
- {
- $string = substr_replace($string, strtoupper(substr($string, $position + 1, 2)), $position + 1, 2);
- $position += 3;
- }
+ $string = substr_replace($string, strtoupper(substr($string, $position + 1, 2)), $position + 1, 2);
+ $position += 3;
}
// If we don't have a pct-encoded section, just replace the % with its own esccaped form
else
@@ -14944,7 +14921,7 @@ class SimplePie_Sanitize
$data = SimplePie_Misc::absolutize_url($data, $base);
}
- if ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI))
+ if ($type & (SIMPLEPIE_CONSTRUCT_TEXT))
{
$data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');
}
Please sign in to comment.
Something went wrong with that request. Please try again.