[PHP-WEBMASTER] [web-news] master: Fix broken email detection in author formatting (#42)

[email protected] (NickSdot via GitHub)
Newsgroups php.webmaster
Message-ID <[email protected]>
Author: NickSdot (NickSdot)
Committer: GitHub (web-flow)
Pusher: sy-records
Date: 2026-08-08T14:06:40+08:00

Commit: https://github.com/php/web-news/commit/7a06f2f61e7b9b8ad0556dcccb839277ae641344
Raw diff: https://github.com/php/web-news/commit/7a06f2f61e7b9b8ad0556dcccb839277ae641344.diff

Fix broken email detection in author formatting (#42)

Changed paths:
  M  lib/common.php


Diff:

diff --git a/lib/common.php b/lib/common.php
index bbc3940..46244c4 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -250,7 +250,7 @@ function format_author($a, $charset = 'iso-8859-1', $nameOnly = false)
         $email = spam_protect($ar[2]);
         $name = $ar[1];
     }
-    elseif (strpos("@", $a) !== false) {
+    elseif (strpos($a, "@") !== false) {
        $email = $name = spam_protect($a);
     } else {
         $email = $name = $a;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.