Commit:    aae3e0e43338be6c026c7a0eccc718f19d96c0ce
Author:    Ben Ramsey <[email protected]>         Tue, 5 Jan 2016 17:40:17 
-0600
Parents:   ab6f7b782082a7d527c2b007d0a121f4022e1947
Branches:  master

Link:       
http://git.php.net/?p=web/news.git;a=commitdiff;h=aae3e0e43338be6c026c7a0eccc718f19d96c0ce

Log:
Use strpos() to check for @-symbol instead of deprecated ereg()

Changed paths:
  M  common.php


Diff:
diff --git a/common.php b/common.php
index a6293d7..979c98a 100644
--- a/common.php
+++ b/common.php
@@ -126,7 +126,7 @@ function format_author($a, $charset) {
        if (preg_match("/^\s*\"?(.+?)\"?\s*<(.+)>\s*$/",$a,$ar)) {
                return "<a 
href=\"mailto:".htmlspecialchars(urlencode(spam_protect($ar[2])), ENT_QUOTES, 
"UTF-8")."\" class=\"email fn n\">".str_replace(" ", "&nbsp;", 
htmlspecialchars($ar[1], ENT_QUOTES, "UTF-8"))."</a>";
        }
-       if (ereg("@",$a)) {
+       if (strpos("@",$a) !== false) {
                $a = spam_protect($a);
                return "<a href=\"mailto:".htmlspecialchars(urlencode($a), 
ENT_QUOTES, "UTF-8")."\" class=\"email fn n\">".htmlspecialchars($a, 
ENT_QUOTES, "UTF-8")."</a>";
        }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to