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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: urs at circle dot ch
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sun Dec 22 06:01:30 2024 UTC