cvs: php-news-web / article.php

From: Date: Tue, 20 Sep 2005 18:12:28 +0000
Subject: cvs: php-news-web / article.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-29396@lists.php.net to get a copy of this message
goba Tue Sep 20 14:12:28 2005 EDT Modified files: /php-news-web article.php Log: Nuno's encoding detection fix http://cvs.php.net/diff.php/php-news-web/article.php?r1=1.32&r2=1.33&ty=u Index: php-news-web/article.php diff -u php-news-web/article.php:1.32 php-news-web/article.php:1.33 --- php-news-web/article.php:1.32 Sun Feb 13 10:02:06 2005 +++ php-news-web/article.php Tue Sep 20 14:12:25 2005 @@ -40,13 +40,14 @@ $boundaries = array(); $lk = ''; $linebuf = ''; +$insig = false; while (!feof($s)) { $line = fgets($s); if ($line == ".\r\n") break; if ($inheaders && ($line == "\n" || $line == "\r\n")) { $inheaders = 0; if ($headers['content-type'] - && preg_match("/charset=(\"|'|)(.+)\\1/is", $headers['content-type'], $m)) { + && preg_match('/charset=("|\'|)([1-9a-zA-Z-]+)\1/is', $headers['content-type'], $m)) { $charset = trim($m[2]); } if ($headers['content-type'] @@ -108,7 +109,7 @@ if ($inheaders) { - list($k,$v) = explode(": ", $line, 2); + @list($k,$v) = explode(": ", $line, 2); if ($k && $v) { $headers[strtolower($k)] = $v; $lk = strtolower($k); @@ -210,7 +211,7 @@ echo " </tr>\n"; echo " <tr>\n"; # references - if ($headers["references"] || $headers["in-reply-to"]) { + if (!empty($headers['references']) || !empty($headers['in-reply-to'])) { $ref = $headers["references"] ? $headers["references"] : $headers["in-reply-to"]; echo ' <td class="headerlabel">References:</td>' . "\n"; echo ' <td class="headervalue">';

« previous php.mirrors (#29396) next »