diff options
author | Marco Ceppi <marco@ceppi.net> | 2014-01-09 21:22:52 -0800 |
---|---|---|
committer | Marco Ceppi <marco@ceppi.net> | 2014-01-09 21:22:52 -0800 |
commit | 3186fd2c5a15162632025f99b654be32685548fc (patch) | |
tree | d5a54af19778ea5a58ef53315507a504dbce9923 /Auth/Yadis/ParseHTML.php | |
parent | 1dc1ff1316133fa1f4c436391246e700df110255 (diff) | |
parent | b60f7550d2d8b9fe1d86ba9029a89b7e8a150817 (diff) | |
download | php-openid-3186fd2c5a15162632025f99b654be32685548fc.zip php-openid-3186fd2c5a15162632025f99b654be32685548fc.tar.gz php-openid-3186fd2c5a15162632025f99b654be32685548fc.tar.bz2 |
Merge pull request #114 from AdamWill/entity_decode
Yadis: drop custom replaceEntities() function and use html_entity_decode
Diffstat (limited to 'Auth/Yadis/ParseHTML.php')
-rw-r--r-- | Auth/Yadis/ParseHTML.php | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/Auth/Yadis/ParseHTML.php b/Auth/Yadis/ParseHTML.php index 6f0f8b7..255d7cd 100644 --- a/Auth/Yadis/ParseHTML.php +++ b/Auth/Yadis/ParseHTML.php @@ -66,29 +66,6 @@ class Auth_Yadis_ParseHTML { } /** - * Replace HTML entities (amp, lt, gt, and quot) as well as - * numeric entities (e.g. #x9f;) with their actual values and - * return the new string. - * - * @access private - * @param string $str The string in which to look for entities - * @return string $new_str The new string entities decoded - */ - function replaceEntities($str) - { - foreach ($this->_entity_replacements as $old => $new) { - $str = preg_replace(sprintf("/&%s;/", $old), $new, $str); - } - - // Replace numeric entities because html_entity_decode doesn't - // do it for us. - $str = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $str); - $str = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $str); - - return $str; - } - - /** * Strip single and double quotes off of a string, if they are * present. * @@ -216,7 +193,7 @@ class Auth_Yadis_ParseHTML { $link_attrs = array(); foreach ($attr_matches[0] as $index => $full_match) { $name = $attr_matches[1][$index]; - $value = $this->replaceEntities( + $value = html_entity_decode( $this->removeQuotes($attr_matches[2][$index])); $link_attrs[strtolower($name)] = $value; |