Avoid recognizing empty usenrame matches
authorAlexander Ebert <ebert@woltlab.com>
Tue, 20 Jun 2017 09:57:53 +0000 (11:57 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 20 Jun 2017 09:57:59 +0000 (11:57 +0200)
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeTextParser.class.php

index ba768e1b034519ff2760ff4d98132cb34b62418f..70074af8ff08630b256938e6d028c06fe4f43ce7 100644 (file)
@@ -232,7 +232,8 @@ class HtmlInputNodeTextParser {
                                        $match = $matches[$i][$j];
                                        $variants = $this->getUsernameVariants($match);
                                        foreach ($variants as $username) {
-                                               if (!isset($usernames[$username])) {
+                                               $username = StringUtil::trim($username);
+                                               if (!empty($username) && !isset($usernames[$username])) {
                                                        $usernames[$username] = $username;
                                                }
                                        }