[Tickets #4094] NEW: File/PDF.php - Bug since PHP 4.3.10 with certain locales

bugs@bugs.horde.org bugs at bugs.horde.org
Thu Jun 29 11:34:21 PDT 2006


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=4094
-----------------------------------------------------------------------
 Ticket             | 4094
 Created By         | thomas at gelf.net
 Summary            | File/PDF.php - Bug since PHP 4.3.10 with certain locales
 Queue              | Horde Framework Packages
 Version            | HEAD
 State              | Unconfirmed
 Priority           | 2. Medium
 Type               | Bug
 Owners             | 
+New Attachment     | File_PDF-locales_bug.patch
-----------------------------------------------------------------------


thomas at gelf.net (2006-06-29 11:34) wrote:

I really got angry about this one (angry about PHP - not Horde):

PHP's Changelog for 4.3.10 contains a little note about "Improved number
handling on non-English locales."

 -> http://de.php.net/release_4_3_10.php

A small example is probably better than lots of words, so have a look at
this small piece of code:

  <?php
  $float = 4.12;
  printf('%.2f <=> %.2F', $float, $float);
  setlocale(LC_ALL, 'de_DE.UTF-8');
  echo "\n";
  printf('%.2f <=> %.2F', $float, $float);
  ?>

And now have a look at it's output:

  4.12 <=> 4.12
  4,12 <=> 4.12

I really couldn't believe that this guys are able to do such intrusive
changes
from one minor version to the next one... PHP is #*%#$~*!!!

It took me a lot of debugging to find out why File_PDF works in a stand-
alone script (without horde) and created "illegal" PDF files when called
from a Horde application.

I attached a little patch containing all the %f -> %F replacements and
also
other two not so important fixes:

- use of undefined $style in addPage()
- "if ($font_family)" -> "if (isset($font_family))" - There should
probably
   always be a font_family, so the appropiate NOTICE might never happen;
   but as while debugging I've seen it once I changed also this one

Regards,
Thomas Gelf




More information about the bugs mailing list