cvs: docweb /scripts notes_stats.php
[email protected] ("Etienne Kneuss")
| Newsgroups | php.doc.web |
|---|---|
| Message-ID | <cvscolder1169147891@cvsserver> |
colder Thu Jan 18 19:18:11 2007 UTC
Modified files:
/docweb/scripts notes_stats.php
Log:
Check for existance before using some vars. Notices--;
http://cvs.php.net/viewvc.cgi/docweb/scripts/notes_stats.php?r1=1.11&r2=1.12&diff_format=u
Index: docweb/scripts/notes_stats.php
diff -u docweb/scripts/notes_stats.php:1.11 docweb/scripts/notes_stats.php:1.12
--- docweb/scripts/notes_stats.php:1.11 Mon Aug 1 00:41:01 2005
+++ docweb/scripts/notes_stats.php Thu Jan 18 19:18:11 2007
@@ -17,7 +17,7 @@
| Vincent Gevers <[email protected]> |
| Credits: Sean Coates <[email protected]> |
+----------------------------------------------------------------------+
-$Id: notes_stats.php,v 1.11 2005/08/01 00:41:01 sean Exp $
+$Id: notes_stats.php,v 1.12 2007/01/18 19:18:11 colder Exp $
*/
require_once '../build-ops.php';
@@ -58,7 +58,14 @@
for ($i = $first; $i <= $last; ++$i) {
$line = fgets($s, 4096);
- list($n, $subj, $author, $odate) = explode("\t", $line, 5);
+ $n = $subj = $author = $odate = null;
+
+ $line_parts = explode("\t", $line, 5);
+
+ if(isset($line_parts[0])) $n = $line_parts[0];
+ if(isset($line_parts[1])) $subj = $line_parts[1];
+ if(isset($line_parts[2])) $author = $line_parts[2];
+ if(isset($line_parts[3])) $odate = $line_parts[3];
/* check if the server has closed the connection
the program will continue to fetch data later */
@@ -66,7 +73,7 @@
break;
}
- echo "\r$i";
+ echo "\n$i";
/*
* What should be matched: