Explorar o código

spam busting improvements

Jordi Boggiano %!s(int64=7) %!d(string=hai) anos
pai
achega
48d5262916

+ 2 - 2
src/Packagist/WebBundle/Controller/UserController.php

@@ -70,9 +70,9 @@ class UserController extends Controller
             $doctrine = $this->getDoctrine();
 
             $doctrine->getConnection()->executeUpdate(
-                'UPDATE package p JOIN maintainers_packages mp ON mp.package_id = p.id JOIN fos_user u ON mp.user_id = u.id
+                'UPDATE package p JOIN maintainers_packages mp ON mp.package_id = p.id
                  SET abandoned = 1, replacementPackage = "spam/spam", description = "", readme = "", indexedAt = NULL, dumpedAt = "2100-01-01 00:00:00"
-                 WHERE u.id = :userId',
+                 WHERE mp.user_id = :userId',
                 ['userId' => $user->getId()]
             );
 

+ 1 - 1
src/Packagist/WebBundle/Entity/Package.php

@@ -274,7 +274,7 @@ class Package
                 return;
             }
 
-            if (preg_match('{(free.*watch|watch.*free|movie.*free|free.*movie|generate.*resource|generate.*unlimited|hack.*coin|coin.*hack|vbucks|hack.*cheat|cheat.*hack|putlocker)}i', $information['name'])) {
+            if (preg_match('{(free.*watch|watch.*free|movie.*free|free.*movie|watch.*movie|watch.*full|generate.*resource|generate.*unlimited|hack.*coin|coin.*hack|v[.-]?bucks|(fortnite|pubg).*free|hack.*cheat|cheat.*hack|putlocker)}i', $information['name'])) {
                 $context->buildViolation('The package name '.htmlentities($information['name'], ENT_COMPAT, 'utf-8').' is blocked, if you think this is a mistake please get in touch with us.')
                     ->atPath($property)
                     ->addViolation()