svn: /web/php-news/trunk/ article.php
| From: | Shein Alexey | Date: | Mon, 16 May 2011 08:08:34 +0000 |
| Subject: | svn: /web/php-news/trunk/ article.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-11009@lists.php.net to get a copy of this message | ||
shein Mon, 16 May 2011 08:08:34 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=311071
Log:
Fixed charset parsing regex to take into consideration hyphens in charset names, such as utf-8,
koi8-r and etc.
Changed paths:
U web/php-news/trunk/article.php
Modified: web/php-news/trunk/article.php
===================================================================
--- web/php-news/trunk/article.php 2011-05-16 07:55:57 UTC (rev 311070)
+++ web/php-news/trunk/article.php 2011-05-16 08:08:34 UTC (rev 311071)
@@ -47,7 +47,7 @@
if ($inheaders && ($line == "\n" || $line == "\r\n")) {
$inheaders = 0;
if (isset($headers['content-type'])) {
- if (preg_match('/charset=(["\']?)(\w+)\1/i',
$headers['content-type'], $m)) {
+ if (preg_match('/charset=(["\']?)([\w-]+)\1/i',
$headers['content-type'], $m)) {
$charset = trim($m[2]);
}