Edit report at https://bugs.php.net/bug.php?id=71876&edit=1
ID: 71876
Comment by: the_djmaze at hotmail dot com
Reported by: the_djmaze at hotmail dot com
Summary: Memory corruption htmlspecialchars(): charset `*'
not supported
Status: Open
Type: Bug
Package: Strings related
Operating System: Fedora 22
PHP Version: 7.0.6
Block user comment: N
Private report: N
New Comment:
Tested with PHP 7.0.8 still an issue.
When using
<?php
ini_set('internal_encoding', 'UTF-8');
?>
The issue is completely gone.
Previous Comments:
------------------------------------------------------------------------
[2016-06-07 13:06:57] the_djmaze at hotmail dot com
Just tested with PHP 7.0.6 and can reproduce it there as well.
When some bigger memory usage occurs (say a CMS page), and then the above script is tested, it shows
the error.
Just using the simple test on a fresh Apache daemon start it didn't show the error.
yohgaki you got me thinking, since PHP runs as a module, it stays loaded in memory.
So you are probably right that the zend_string gets freed because something did a
ini_set('default_charset', 'UTF-8') (or not?!?) in 5.6 and 7?
------------------------------------------------------------------------
[2016-06-07 12:50:41] the_djmaze at hotmail dot com
The below code is sufficient. PHP runs as Apache 2 module.
The problem arises when encoding is set in php.ini and not in your script itself en then run the
script several times in Apache.
<?php
htmlspecialchars('some text', ENT_NOQUOTES);
phpinfo();
?>
------------------------------------------------------------------------
[2016-06-05 02:31:05] yohgaki@php.net
It sounds like zend_string handling issue. i.e. String is released, but pointer points to
zend_string buffer. I've seen this type of bugs in 5.x to 7.0 transition.
I cannot reproduce this, if you could narrow down specific condition reproducing this, I'll
look into it.
------------------------------------------------------------------------
[2016-06-04 20:58:33] yohgaki@php.net
What is the default_charset setting? i.e. var_dump(ini_get('default_charset'));
------------------------------------------------------------------------
[2016-06-03 03:32:28] the_djmaze at hotmail dot com
Found some websites with the issue: (hit your browser F5 a few times to see it happen)
www.modelcity.cz/cz/?page_id=333&album=1&gallery=32
cms.w3host.hu/opencart/index.php?route=product/product&product_id=46
www.suchanoha.cz/?page_id=974&wppa-album=39&wppa-photo=490&wppa-cover=0&wppa-occur=1&wppa-single=1
ubytovani-ledenice.cz/?page_id=14
www.conceptvision.cz/index.php/8-slideshow/15-sli
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=71876
--
Edit this bug report at https://bugs.php.net/bug.php?id=71876&edit=1