php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78373 tidy_parse_string change the locale previously set with setlocale
Submitted: 2019-08-05 12:15 UTC Modified: 2019-08-05 14:53 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: chalda82 at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: Tidy (PECL)
PHP Version: 7.3.8 OS:
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: chalda82 at gmail dot com
New email:
PHP Version: OS:

 

 [2019-08-05 12:15 UTC] chalda82 at gmail dot com
Description:
------------
The function tidy_parse_string change locale to 'C'.

Test script:
---------------
<?php
setlocale(LC_ALL, 'de_DE');

/* [...] */

echo setlocale(LC_ALL, 0); // Show "de_DE"
$tidy = tidy_parse_string($text, $config, 'UTF8');
echo "\n".setlocale(LC_ALL, 0); // show "C" instead of "de_DE"
?>

Expected result:
----------------
de_DE
de_DE

Actual result:
--------------
de_DE
C

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-08-05 14:53 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2019-08-05 14:53 UTC] cmb@php.net
That's a known *upstream* issue[1].

[1] <https://github.com/htacg/tidy-html5/issues/770>.
 [2021-11-01 10:19 UTC] mikko dot rantalainen at peda dot net
To workaround the upstream issue, maybe PHP should combile tidy with

   cmake ../.. -DSUPPORT_LOCALIZATIONS:BOOL=OFF

by default as suggested in the upstream issue? I think tidy not having localized error messages is better than messing with the gettext localization config.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC