Author: lindner
Date: Mon Nov 16 19:57:32 2009
New Revision: 880935
URL: http://svn.apache.org/viewvc?rev=880935&view=rev
Log:
SHINDIG-1220 | Patch from Thiago Arrais | Charset guessing code in
BasicRemoteContentFetcher gets lost when no charset is informed
Modified:
incubator/shindig/trunk/php/src/common/sample/BasicRemoteContentFetcher.php
Modified:
incubator/shindig/trunk/php/src/common/sample/BasicRemoteContentFetcher.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/common/sample/BasicRemoteContentFetcher.php?rev=880935&r1=880934&r2=880935&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/common/sample/BasicRemoteContentFetcher.php
(original)
+++ incubator/shindig/trunk/php/src/common/sample/BasicRemoteContentFetcher.php
Mon Nov 16 19:57:32 2009
@@ -98,9 +98,9 @@
}
}
if ($isTextType && function_exists('mb_convert_encoding')) {
- $charset = 'UTF-8';
- preg_match("/charset\s*=\s*([^\"' >]*)/ix",$content, $charset);
- if (isset($charset[1])) {
+ if (0 == preg_match("/charset\s*=\s*([^\"' >]*)/ix",$content, $charset))
{
+ $charset = 'UTF-8';
+ } else {
$charset = trim($charset[1]);
if (($pos = strpos($charset, "\n")) !== false) {
$charset = trim(substr($charset, 0, $pos));