php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8018 get_html_translation_table() produces wrong conversion
Submitted: 2000-11-28 17:27 UTC Modified: 2000-11-28 18:26 UTC
From: urs at circle dot ch Assigned:
Status: Closed Package: Strings related
PHP Version: 4.0 Latest CVS (28/11/2000) OS: Win2k
Private report: No CVE-ID: None
 [2000-11-28 17:27 UTC] urs at circle dot ch
dear all

while using get_html_translation_table() i recognized a wrong conversion of the "&" character to "'" instead of "&".

could this confirm someone?

<?php

  $str = "Hallo & <Pallo> & k??chen & ? & ? & ?";
  $trans = get_html_translation_table(HTML_SPECIALCHARS);

  echo strtr($str, $trans) . "<br>\n";      // output: Hallo ' <Pallo> ' k??chen ' ? ' ? ' ?
  echo htmlspecialchars($str) . "<br>\n";   // output: Hallo & <Pallo> & k??chen & ? & ? & ?
  echo htmlentities($str) . "<br>\n";       // output: Hallo & <Pallo> & k??chen & ? & ? & ?

?>

--
Urs Gehrig <urs@circle.ch>
http://www.circle.ch


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-28 18:26 UTC] waldschrott@php.net
this has already been fixed a week (two?) ago, I wonder
which Latest CVS you do use? :)

I cannot confirm, it works with my build
 [2000-11-28 18:26 UTC] waldschrott@php.net
this has already been fixed a week (two?) ago, I wonder
which Latest CVS you do use? :)

I cannot confirm, it works with my build
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC