cvs: php-master-web /fetch user-notes.php
| From: | Gabor Hojtsy | Date: | Mon, 14 Jul 2003 08:48:52 +0000 |
| Subject: | cvs: php-master-web /fetch user-notes.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-19317@lists.php.net to get a copy of this message | ||
goba Mon Jul 14 04:48:52 2003 EDT
Modified files:
/php-master-web/fetch user-notes.php
Log:
Obfuscate email addresses right in the fetch process
Index: php-master-web/fetch/user-notes.php
diff -u php-master-web/fetch/user-notes.php:1.6 php-master-web/fetch/user-notes.php:1.7
--- php-master-web/fetch/user-notes.php:1.6 Tue Jun 3 13:34:03 2003
+++ php-master-web/fetch/user-notes.php Mon Jul 14 04:48:52 2003
@@ -20,7 +20,17 @@
$res = @mysql_query($query) or exit;
-while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) {
- echo "$row[id]|$row[sect]|$row[rate]|$row[ts]|$row[user]|",
- base64_encode(gzcompress($row[note],3)),"\n";
+// Print out a row for all notes, obfuscating the
+// email addresses as needed
+while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {
+ $user = $row['user'];
+ if ($user != "php-general@lists.php.net" && $user !=
"user@example.com") {
+ if (preg_match("!(.+)@(.+)\.(.+)!", $user)) {
+ $user = str_replace(array('@', '.'), array(' at ', '
dot '), $user);
+ }
+ } else {
+ $user = '';
+ }
+ echo "$row[id]|$row[sect]|$row[rate]|$row[ts]|$user|",
+ base64_encode(gzcompress($row[note],3)),"\n";
}