Explorar o código

Strip unwanted parts of the spamcop auth code in case someone enters
them accidentally.

Thijs Kinkhorst %!s(int64=23) %!d(string=hai) anos
pai
achega
c214b0167a
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      plugins/spamcop/options.php

+ 3 - 0
plugins/spamcop/options.php

@@ -43,6 +43,9 @@ switch ($action) {
         break;
     case 'save_id':
         if (isset($ID)) {
+            $ID = trim($ID);
+            $ID = preg_replace('/@.*/','',$ID);
+            $ID = preg_replace('/.*\./','',$ID);
             setPref($data_dir, $username, 'spamcop_id', $ID);
         }
         break;