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
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:
10 + 14 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Wed Apr 24 10:01:31 2024 UTC