Visman преди 2 години
родител
ревизия
d8aa723425
променени са 1 файла, в които са добавени 9 реда и са изтрити 1 реда
  1. 9 1
      app/Models/User/Current.php

+ 9 - 1
app/Models/User/Current.php

@@ -165,7 +165,13 @@ class Current extends Action
 
 
         if (
         if (
             0 === $status
             0 === $status
-            && ! \str_starts_with($agent, 'Mozilla/')
+            && (
+                ! \str_starts_with($agent, 'Mozilla/')
+                || (
+                    false === \strpos($agent, ' Gecko')
+                    && false === \strpos($agent, ' MSIE ')
+                )
+            )
             && ! \str_starts_with($agent, 'Opera/')
             && ! \str_starts_with($agent, 'Opera/')
         ) {
         ) {
             $status = 1;
             $status = 1;
@@ -176,12 +182,14 @@ class Current extends Action
         }
         }
 
 
         $reg = [
         $reg = [
+            '%Mozilla\S+%',
             '%[^\w/.-]+%',
             '%[^\w/.-]+%',
             '%(?:_| |-|\b)bot(?:_| |-|\b)%i',
             '%(?:_| |-|\b)bot(?:_| |-|\b)%i',
             '%(?<=^|\s)[^a-zA-Z\s]{1,2}(?:\s|$)%',
             '%(?<=^|\s)[^a-zA-Z\s]{1,2}(?:\s|$)%',
             '%/\S*+\K.+%',
             '%/\S*+\K.+%',
         ];
         ];
         $rep = [
         $rep = [
+            '',
             ' ',
             ' ',
             '',
             '',
             '',
             '',