htmlspecialchars and UTF8 bug

Support/Development for PHP
clinton4
Forum User
Forum User
Posts: 11
Joined: Sat Mar 05, 2011 10:14 am
Location: Norway

htmlspecialchars and UTF8 bug

Unread post by clinton4 »

Hi,

In previous version of PHP 5, there is a known bug regrding UTF8 and htmlspecialchars. I read that this was fixed here -> http://www.atomicorp.com/news/atomic-ar ... p-534.html but i still get an empty string when i use norwegian chars like ÆØÅ with htmlspecialchars. Is this verified fixed? If so, what could my problem be?

I'am running CentOS 5 (final) and PHP 5.3.5.

Thanks :)
clinton4
Forum User
Forum User
Posts: 11
Joined: Sat Mar 05, 2011 10:14 am
Location: Norway

Re: htmlspecialchars and UTF8 bug

Unread post by clinton4 »

Anybody?
User avatar
mikeshinn
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 4149
Joined: Thu Feb 07, 2008 7:49 pm
Location: Chantilly, VA

Re: htmlspecialchars and UTF8 bug

Unread post by mikeshinn »

That should still be fixed in 5.3.5., have you tried rolling back to 5.3.4 to see if the same thing happens (or not)? That would tell us if this is actually the UTF8 bug, if your problem occurs in 5.3.4 then we can rule that out as the root cause, if it doesnt occur in 5.3.4 then something changed in 5.3.5.
clinton4
Forum User
Forum User
Posts: 11
Joined: Sat Mar 05, 2011 10:14 am
Location: Norway

Re: htmlspecialchars and UTF8 bug

Unread post by clinton4 »

Hi and thanks for your reply :)

When i try to downgrade PHP, i get this dependency error:
[root@server ~]# yum --enablerepo=atomic-testing downgrade php
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: ftp.uninett.no
* atomic: www6.atomicorp.com
* atomic-testing: www6.atomicorp.com
* base: ftp.uninett.no
* extras: ftp.uninett.no
* updates: ftp.uninett.no
Setting up Downgrade Process
atomic-testing | 1.9 kB 00:00
Excluding Packages from Plesk Server Administrator
Finished
Resolving Dependencies
--> Running transaction check
---> Package php.i386 0:5.2.17-1.el5.art set to be updated
--> Processing Dependency: php-common = 5.2.17-1.el5.art for package: php
--> Processing Dependency: php-cli = 5.2.17-1.el5.art for package: php
---> Package php.i386 0:5.3.5-2.el5.art set to be erased
--> Finished Dependency Resolution
php-5.2.17-1.el5.art.i386 from atomic has depsolving problems
--> Missing Dependency: php-common = 5.2.17-1.el5.art is needed by package php-5.2.17-1.el5.art.i386 (atomic)
php-5.2.17-1.el5.art.i386 from atomic has depsolving problems
--> Missing Dependency: php-cli = 5.2.17-1.el5.art is needed by package php-5.2.17-1.el5.art.i386 (atomic)
Error: Missing Dependency: php-common = 5.2.17-1.el5.art is needed by package php-5.2.17-1.el5.art.i386 (atomic)
Error: Missing Dependency: php-cli = 5.2.17-1.el5.art is needed by package php-5.2.17-1.el5.art.i386 (atomic)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
If i do the --skip-broken part, would that couse any problems?
clinton4
Forum User
Forum User
Posts: 11
Joined: Sat Mar 05, 2011 10:14 am
Location: Norway

Re: htmlspecialchars and UTF8 bug

Unread post by clinton4 »

Hi again,

I did # yum --enablerepo=atomic-testing downgrade php php-common php-cli

and now PHP don't work at all. I only get HTTP 500 error.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: htmlspecialchars and UTF8 bug

Unread post by breun »

What does the error_log say?

What php* packages do you have installed right now?

Code: Select all

# rpm -qa | grep ^php | sort
Lemonbit Internet Dedicated Server Management
clinton4
Forum User
Forum User
Posts: 11
Joined: Sat Mar 05, 2011 10:14 am
Location: Norway

Re: htmlspecialchars and UTF8 bug

Unread post by clinton4 »

Hi,

I did try to upgrade again, and did #yum --enablerepo=atomic-testing upgrade php php-common php-cli

Then i figured out that i nedded to install php-mysql and did #yum --enablerepo=atomic-testing install php-mysql

This is what i get from #rpm -qa | grep ^php | sort

php-5.3.5-2.el5.art
php-cli-5.3.5-2.el5.art
php-common-5.3.5-2.el5.art
php-mysql-5.3.5-2.el5.art
php-pdo-5.3.5-2.el5.art

Now, PHP seems to be up and running again, but i cant access my Plesk admin area. I get no error message when i try to access Plesk, the site just wont load.

My erro_log says:
PHP Fatal error: Class 'DOMDocument' not found in /bla/bla/bla

Edit: I now did #yum --enablerepo=atomic-testing install php-xml, that go rid of the DOMDocument error, but still no access to Plesk panel.

Edit2: I now get a error message like this in my error_log:
[Mon Mar 07 00:42:36 2011] [warn] RSA server certificate CommonName (CN) `plesk' does NOT match server name!?
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: htmlspecialchars and UTF8 bug

Unread post by breun »

Plesk does not use the php* packages on your system for the web interface, so this doesn't sound directly related to your PHP issues. Have you checked Plesk's logs for errors?

That Apache warning is harmless, it just reports about the hostname on Plesk's default SSL certificate being differing from your actual hostname.
Lemonbit Internet Dedicated Server Management
clinton4
Forum User
Forum User
Posts: 11
Joined: Sat Mar 05, 2011 10:14 am
Location: Norway

Re: htmlspecialchars and UTF8 bug

Unread post by clinton4 »

Okay, the Plesk access problem happend after i did the PHP downgrade, maybe i removed some package that i shouldnt?

In /usr/local/psa/admin/logs i only have httpsd_access_log, do you know where i can find Plesk's error log?
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: htmlspecialchars and UTF8 bug

Unread post by breun »

clinton4 wrote:Okay, the Plesk access problem happend after i did the PHP downgrade, maybe i removed some package that i shouldnt?
Maybe, I don't know what packages were removed. /var/log/yum.log should be able to tell you what happened if you don't remember.
In /usr/local/psa/admin/logs i only have httpsd_access_log, do you know where i can find Plesk's error log?
I believe that should be the location.
Lemonbit Internet Dedicated Server Management
clinton4
Forum User
Forum User
Posts: 11
Joined: Sat Mar 05, 2011 10:14 am
Location: Norway

Re: htmlspecialchars and UTF8 bug

Unread post by clinton4 »

Okay, i have no erro log in /usr/local/psa/admin/logs

Here is my yum log, if you can se any obvious mistakes here, please let me know :)

Mar 05 13:20:35 Updated: yum-3.2.22-26.el5.centos.noarch
Mar 05 14:09:52 Updated: php-common-5.2.17-1.el5.art.i386
Mar 05 14:09:52 Updated: php-pdo-5.2.17-1.el5.art.i386
Mar 05 14:09:52 Updated: php-cli-5.2.17-1.el5.art.i386
Mar 05 14:09:53 Updated: php-mcrypt-5.2.17-1.el5.art.i386
Mar 05 14:09:53 Updated: php-gd-5.2.17-1.el5.art.i386
Mar 05 14:09:53 Updated: php-mbstring-5.2.17-1.el5.art.i386
Mar 05 14:09:53 Updated: php-5.2.17-1.el5.art.i386
Mar 05 14:09:53 Updated: php-mysql-5.2.17-1.el5.art.i386
Mar 05 14:09:54 Updated: php-xml-5.2.17-1.el5.art.i386
Mar 05 14:09:54 Updated: php-imap-5.2.17-1.el5.art.i386
Mar 05 14:24:45 Updated: php-common-5.3.5-2.el5.art.i386
Mar 05 14:24:46 Updated: php-pdo-5.3.5-2.el5.art.i386
Mar 05 14:24:47 Installed: libedit-3.0-2.20090923cvs.el5.art.i386
Mar 05 14:24:48 Updated: php-cli-5.3.5-2.el5.art.i386
Mar 05 14:24:48 Updated: php-gd-5.3.5-2.el5.art.i386
Mar 05 14:24:49 Updated: php-5.3.5-2.el5.art.i386
Mar 05 14:24:49 Updated: php-imap-5.3.5-2.el5.art.i386
Mar 05 14:24:49 Updated: php-mysql-5.3.5-2.el5.art.i386
Mar 05 14:24:49 Updated: php-mbstring-5.3.5-2.el5.art.i386
Mar 05 14:24:49 Updated: php-xml-5.3.5-2.el5.art.i386
Mar 05 14:24:49 Updated: php-mcrypt-5.3.5-2.el5.art.i386
Mar 06 22:45:58 Installed: php-common-5.2.17-1.el5.art.i386
Mar 06 22:45:58 Installed: php-cli-5.2.17-1.el5.art.i386
Mar 06 22:45:58 Installed: php-5.2.17-1.el5.art.i386
Mar 06 22:45:59 Erased: psa-kronolith
Mar 06 22:46:00 Erased: psa-mnemo
Mar 06 22:46:01 Erased: psa-php5-configurator
Mar 06 22:46:01 Erased: psa-mimp
Mar 06 22:46:02 Erased: psa-ingo
Mar 06 22:46:02 Erased: php-pdo
Mar 06 22:46:02 Erased: psa-awstats-configurator
Mar 06 22:46:03 Erased: psa-libpam-plesk
Mar 06 22:46:04 Erased: psa-firewall
Mar 06 22:46:04 Erased: php-mysql
Mar 06 22:46:05 Erased: psa-api-rpc
Mar 06 22:46:07 Erased: psa
Mar 06 22:46:10 Erased: psa-imp
Mar 06 22:46:11 Erased: php-gd
Mar 06 22:46:12 Erased: psa-horde
Mar 06 22:46:13 Erased: psa-turba
Mar 06 22:46:13 Erased: psa-backup-manager
Mar 06 22:46:14 Erased: php-imap
Mar 06 22:46:15 Erased: psa-passwd
Mar 06 22:46:15 Erased: php-mbstring
Mar 06 22:46:15 Erased: psa-updates
Mar 06 22:46:15 Erased: php-xml
Mar 06 22:46:15 Erased: php-mcrypt
Mar 06 22:54:15 Updated: php-common-5.3.5-2.el5.art.i386
Mar 06 22:54:15 Updated: php-cli-5.3.5-2.el5.art.i386
Mar 06 22:54:16 Updated: php-5.3.5-2.el5.art.i386
Mar 06 23:02:06 Installed: php-common-5.2.17-1.el5.art.i386
Mar 06 23:02:06 Installed: php-cli-5.2.17-1.el5.art.i386
Mar 06 23:02:07 Installed: php-5.2.17-1.el5.art.i386
Mar 06 23:04:28 Updated: php-common-5.3.5-2.el5.art.i386
Mar 06 23:04:28 Updated: php-cli-5.3.5-2.el5.art.i386
Mar 06 23:04:29 Updated: php-5.3.5-2.el5.art.i386
Mar 06 23:08:10 Installed: php-xml-5.3.5-2.el5.art.i386
Mar 06 23:13:29 Installed: php-common-5.2.17-1.el5.art.i386
Mar 06 23:13:29 Installed: php-cli-5.2.17-1.el5.art.i386
Mar 06 23:13:30 Installed: php-5.2.17-1.el5.art.i386
Mar 06 23:13:30 Erased: php-xml
Mar 06 23:15:24 Updated: php-common-5.3.5-2.el5.art.i386
Mar 06 23:15:24 Updated: php-cli-5.3.5-2.el5.art.i386
Mar 06 23:15:25 Updated: php-5.3.5-2.el5.art.i386
Mar 06 23:16:26 Installed: php-common-5.2.17-1.el5.art.i386
Mar 06 23:16:26 Installed: php-cli-5.2.17-1.el5.art.i386
Mar 06 23:16:26 Installed: php-5.2.17-1.el5.art.i386
Mar 06 23:51:20 Updated: php-common-5.3.5-2.el5.art.i386
Mar 06 23:51:20 Installed: php-pdo-5.3.5-2.el5.art.i386
Mar 06 23:51:21 Updated: php-cli-5.3.5-2.el5.art.i386
Mar 06 23:51:22 Updated: php-5.3.5-2.el5.art.i386
Mar 06 23:51:23 Installed: php-mysql-5.3.5-2.el5.art.i386
Mar 07 00:42:15 Installed: php-xml-5.3.5-2.el5.art.i386
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: htmlspecialchars and UTF8 bug

Unread post by breun »

You erased a couple of psa-* packages, which are Plesk packages. I'd install those again.
Lemonbit Internet Dedicated Server Management
clinton4
Forum User
Forum User
Posts: 11
Joined: Sat Mar 05, 2011 10:14 am
Location: Norway

Re: htmlspecialchars and UTF8 bug

Unread post by clinton4 »

When i try yum install psa-kronolith psa-mnemo psa-php5-configurator psa-mimp psa-ingo php-pdo psa-awstats-configurator psa-libpam-plesk psa-firewall psa-api-rpc psa psa-imp php-gd psa-horde psa-turba psa-backup-manager php-imap psa-passwd php-mbstring psa-updates php-mcrypt

I get:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: ftp.uninett.no
* atomic: www6.atomicorp.com
* base: ftp.uninett.no
* extras: ftp.uninett.no
* updates: ftp.uninett.no
Excluding Packages from Plesk Server Administrator
Finished
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-gd.i386 0:5.2.17-1.el5.art set to be updated
---> Package php-imap.i386 0:5.2.17-1.el5.art set to be updated
---> Package php-mbstring.i386 0:5.2.17-1.el5.art set to be updated
---> Package php-mcrypt.i386 0:5.2.17-1.el5.art set to be updated
---> Package php-pdo.i386 0:5.2.17-1.el5.art set to be updated
---> Package psa.i586 0:9.0.1-cos5.build90090127.18 set to be updated
Error: pkgKey 196 doesn't exist in repo plesk
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.

Any ide how to get these packages installe again?
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: htmlspecialchars and UTF8 bug

Unread post by breun »

I'd try the autoinstaller. Are you on Plesk 9.0.1?
Lemonbit Internet Dedicated Server Management
clinton4
Forum User
Forum User
Posts: 11
Joined: Sat Mar 05, 2011 10:14 am
Location: Norway

Re: htmlspecialchars and UTF8 bug

Unread post by clinton4 »

I wil try that. I'am on 9.2.2
Post Reply