cvs: phpweb /manual add-note.php
| From: | jim winstead | Date: | Wed, 02 Jan 2002 12:02:44 +0000 |
| Subject: | cvs: phpweb /manual add-note.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-8026@lists.php.net to get a copy of this message | ||
jimw Wed Jan 2 07:02:44 2002 EDT
Modified files:
/phpweb/manual add-note.php
Log:
a little proactive newline clean-up.
Index: phpweb/manual/add-note.php
diff -u phpweb/manual/add-note.php:1.32 phpweb/manual/add-note.php:1.33
--- phpweb/manual/add-note.php:1.32 Tue Jan 1 19:37:01 2002
+++ phpweb/manual/add-note.php Wed Jan 2 07:02:43 2002
@@ -9,6 +9,12 @@
$user = trim($user);
$note = trim($note);
+/* convert all line-endings to unix format, and don't allow out-of-control
+ * blank lines. */
+$note = str_replace("\r\n", "\n", $note);
+$note = str_replace("\r", "\n", $note);
+$note = preg_replace("/\n{2,}/", "\n\n", $note);
+
/* don't pass through example username */
if ($user == "user@example.com") {
$user = "";