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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
29 + 16 = ?
Subscribe to this entry?

 
 [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-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 20 08:01:29 2019 UTC