Bug #14841 Updated: this is a test bug report.

From: Date: Tue, 15 Jan 2002 12:13:55 +0000
Subject: Bug #14841 Updated: this is a test bug report.
References: 1  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-8219@lists.php.net to get a copy of this message
ID: 14841 Updated by: sander Reported By: jimw@php.net Old Status: Open Status: Bogus Bug Type: Website problem PHP Version: 4.1.1 New Comment: Shoudn't we make this bug a bogus so it doesn't show up in the stats??? Previous Comments: ------------------------------------------------------------------------ [2002-01-08 13:32:53] philip@notloggedin.net This bug is crazy, I like! a lot. ------------------------------------------------------------------------ [2002-01-06 14:45:03] jimw@php.net this should look a little more tolerable in netscape 4. making sure it still works. ------------------------------------------------------------------------ [2002-01-06 13:41:32] jimw@php.net it would only result in lots of empty comments if we didn't check to make sure a comment was submitted. :) ------------------------------------------------------------------------ [2002-01-06 13:39:07] cynic@php.net looks pretty good, but the metadata at the top (bug #, status, etc) is somewhat mangled in w3m. Looks better in links, and (ironically) best in lynx. oh, and the submit button between the mailaddress input and the textarea on this page is IMO placed badly -- it'll result in lots of empty comments. ------------------------------------------------------------------------ [2002-01-05 06:39:53] hellekin@php.net May I suggest to use the two following functions. The first one is to get rid of JavaScript and unwanted stuff before storing to the database ; the second one for automagic formatting while displaying the stored message. It's useful to have two functions for cases when one can edit the message. function msgClean($txt) { /* SCRIPT PATTERN MATCHING */ $txt = preg_replace("/<script([\n\r]*.*)>([\n\r]*|[^>]*.*)<\/script>/i",'',$txt); /* STRIP UNWANTED HTML TAGS */ $txt = strip_tags($txt,"<b></b><i></i><u></u>"); return $txt; } function msgFormat($txt) { /* PLEASE KEEP THAT IN ORDER -- how */ /* LINK MATCHING PATTERN */ $txt = preg_replace("/([[:alpha:]]+):\/\/([\w\d-#\?=\/&]+[^\s_]+)(?<![,.:;])/i",'<a href="\1://\2">\1://\2</a>',$txt) /* EMAIL MATCHING PATTERN */ $txt = preg_replace("/(?!mailto:)([[:alnum:]-.]+)@([[:alnum:]-.]+\.[[:alnum:]]{1,3})(?<![,.:;])/i",'<a href="mailto:\ /* PARAGRAPH MATCHING PATTERN */ $txt = preg_replace("/(\r\n\r\n|\n\n)/i",'<p>',$txt); /* SINGLE LINE MATCHING PATTERN */ $txt = preg_replace("/(\r\n|\n)/i",'<br />',$txt); return $txt; } ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/?id=14841 Edit this bug report at http://bugs.php.net/?id=14841&edit=1

« previous php.mirrors (#8219) next »