Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
6 May 2020 at 10:27 UTC
Updated:
29 Apr 2023 at 09:36 UTC
Jump to comment: Most recent
Comments
Comment #2
shaktikComment #3
shaktikComment #4
shaktikComment #5
shaktikComment #6
shaktikPlease check and fix
Call to method get() on an unknown classerror below.Shakti-Kumar:spammaster shakti.kumar$ ../../../../vendor/bin/drupal-check -ad .
20/20 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
------ -----------------------------------------------------------------------------------------------------
Line src/Controller/SpamMasterCleanUpController.php
------ -----------------------------------------------------------------------------------------------------
28 Property Drupal\spammaster\Controller\SpamMasterCleanUpController::$loggerFactory has unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface as its type.
42 Property Drupal\spammaster\Controller\SpamMasterCleanUpController::$loggerFactory
(Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface) does not accept
Drupal\Core\Logger\LoggerChannelFactoryInterface.
73 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
85 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
96 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
108 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
120 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
132 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
144 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
156 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
168 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
180 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
192 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
204 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
216 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
228 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
240 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
252 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
264 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
276 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
288 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
300 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
310 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
312 Undefined variable: $spammaster_date
337 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
346 Call to method get() on an unknown class
Drupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.
348 Undefined variable: $time
------ -----------------------------------------------------------------------------------------------------
Comment #7
avpadernoThe file correctly contains the
use Drupal\Core\Logger\LoggerChannelFactoryInterface;line. It's drupal-check that wrongly assumes the class isDrupal\spammaster\Controller\Drupal\Core\Logger\LoggerChannelFactoryInterface.Comment #8
avpadernoThat line should use placeholders, in the same way the other lines did.
A controller is used to render a page. Used like that, it's a service, which doesn't need to extend the
ControllerBaseclass.Why is the code saving the log messages in a custom database table, when it's already using the system logger?
$message['from']is already set from Drupal; there is no need for a third-party module to set it to the same value.If the form element should not be visible in the form, it should not be a text field. Drupal has a specific type for those values that need to be passed in the form without to be visible nor editable.
The coding standards say how a method should be named. The spam prefix in the method name is also useless.
There are third-party modules for CAPTCHA and honeypot. Is there any reason the users would prefer what this module implements?
Instead of concatenating strings, the code should use placeholders.
Error messages, like any other message shown to the users, must be translatable.
The code is sending the email used from the site to an external site without asking for the permission to do so. There isn't anything in the project page that inform users using the module of this. (GDPR is also about informing the users of which information is used and ask consensus.)
The module doesn't define that permission.
Each route needs to have a different path. Those aren't even controllers, since they don't render anything. The permission used for the routes is also wrong, as it is giving to every user who can access the content on the site the access to information that they should not see, including the license. (This is a information disclosure issue.)
That is not a setting, but a state value. There is an API to store the state of a module.
Deleting content from a database table is done with
$this->connection->delete().Comment #9
pedro-alves commentedThank you very much for you time kiamlaluno.
Based on your comments I updated the module to version rc42.
Small explanation regarding using our logs table, recaptcha and honeypot.
These logs table is used in the stats controller and allow user set different retention times per log type (from disabled to infinite).
Honeypot is used by the stats controller but more importantly it's also used by the firewall via buffer. recaptcha is used by the stats controller to provide statistics.
In case of problem I can remove those module functionalities by deleting the log table and calls and the honeypot, repcatcha functions. No problem.
Thanks again.
Comment #10
pedro-alves commentedkiamlaluno,
With the latest version both honeypot and recaptcha are used for text and graph statistical data but more importantly they are both being checked for spam in the local threats db and online via service rbl real time block lists checks.
I'm moving the issue to Needs Review.
Thanks
Comment #11
pedro-alves commentedJust noticed that module version. alert level, cms type, module status, protection number and probability percentage are state values.
Needs work tomorrow.
Comment #12
pedro-alves commentedAll state values are now implemented.
Changing status.
Thanks.
Comment #13
rohitrajputsahab commented22/22 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[ERROR] Found 49 errors (Drupal check). Please solve these errors also.
------ -----------------------------------------------------------------------
Line spammaster.install
------ -----------------------------------------------------------------------
250 Array has 5 duplicate keys with value 'name' ('name', 'name', 'name',
'name', 'name').
------ -----------------------------------------------------------------------
------ ---------------------------------------------------------------------
Line src/Form/SpamMasterBufferForm.php
------ ---------------------------------------------------------------------
27 Drupal\spammaster\Form\SpamMasterBufferForm::__construct() does not
call parent constructor from Drupal\Core\Form\ConfigFormBase.
------ ---------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/Form/SpamMasterLogForm.php
------ -----------------------------------------------------------------------
42 Drupal\spammaster\Form\SpamMasterLogForm::__construct() does not call
parent constructor from Drupal\Core\Form\ConfigFormBase.
------ -----------------------------------------------------------------------
------ -------------------------------------------------------------------------
Line src/Form/SpamMasterProtectionForm.php
------ -------------------------------------------------------------------------
33 Drupal\spammaster\Form\SpamMasterProtectionForm::__construct() does not
call parent constructor from Drupal\Core\Form\ConfigFormBase.
------ -------------------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/Form/SpamMasterSettingsForm.php
------ -----------------------------------------------------------------------
33 Drupal\spammaster\Form\SpamMasterSettingsForm::__construct() does not
call parent constructor from Drupal\Core\Form\ConfigFormBase.
34 Access to an undefined property
Drupal\spammaster\Form\SpamMasterSettingsForm::$SpamMasterLicService.
162 Access to an undefined property
Drupal\spammaster\Form\SpamMasterSettingsForm::$SpamMasterLicService.
193 Variable $license_status might not be defined.
202 Variable $spammaster_alert_level_label might not be defined.
202 Variable $spammaster_alert_level_text might not be defined.
215 Variable $protection_total_number_text might not be defined.
227 Variable $spammaster_alert_level_p_label might not be defined.
272 Result of function header (void) is used.
------ -----------------------------------------------------------------------
------ -------------------------------------------------------------------------
Line src/Form/SpamMasterWhiteForm.php
------ -------------------------------------------------------------------------
33 Drupal\spammaster\Form\SpamMasterWhiteForm::__construct() does not call
parent constructor from Drupal\Core\Form\ConfigFormBase.
------ -------------------------------------------------------------------------
------ --------------------------------------
Line src/SpamMasterCleanUpService.php
------ --------------------------------------
321 Undefined variable: $spammaster_date
357 Undefined variable: $spammaster_date
------ --------------------------------------
------ -------------------------------------------------------------------------
Line src/SpamMasterCommentService.php
------ -------------------------------------------------------------------------
90 Property Drupal\spammaster\SpamMasterCommentService::$spammasterip has
unknown class Drupal\spammmaster\SpamMasterCommentService as its type.
97 Property Drupal\spammaster\SpamMasterCommentService::$spammasteremail
has unknown class Drupal\spammmaster\SpamMasterCommentService as its
type.
104 Property Drupal\spammaster\SpamMasterCommentService::$spammastercomment
has unknown class Drupal\spammmaster\SpamMasterCommentService as its
type.
------ -------------------------------------------------------------------------
------ -------------------------------------------------------------------------
Line src/SpamMasterContactService.php
------ -------------------------------------------------------------------------
90 Property Drupal\spammaster\SpamMasterContactService::$spammasterip has
unknown class Drupal\spammmaster\spamMasterContactCheck as its type.
97 Property Drupal\spammaster\SpamMasterContactService::$spammasteremail
has unknown class Drupal\spammmaster\spamMasterContactCheck as its
type.
104 Property Drupal\spammaster\SpamMasterContactService::$spammastermessage
has unknown class Drupal\spammmaster\spamMasterContactCheck as its
type.
------ -------------------------------------------------------------------------
------ ---------------------------------------------------------------------
Line src/SpamMasterCronService.php
------ ---------------------------------------------------------------------
64 Access to an undefined property
Drupal\spammaster\SpamMasterCronService::$SpamMasterLicService.
65 Access to an undefined property
Drupal\spammaster\SpamMasterCronService::$SpamMasterMailService.
66 Access to an undefined property
Drupal\spammaster\SpamMasterCronService::$SpamMasterCleanUpService.
96 Access to an undefined property
Drupal\spammaster\SpamMasterCronService::$SpamMasterLicService.
100 Access to an undefined property
Drupal\spammaster\SpamMasterCronService::$SpamMasterMailService.
130 Access to an undefined property
Drupal\spammaster\SpamMasterCronService::$SpamMasterMailService.
138 Access to an undefined property
Drupal\spammaster\SpamMasterCronService::$SpamMasterCleanUpService.
------ ---------------------------------------------------------------------
------ -------------------------------------------------------------------------
Line src/SpamMasterHoneypotService.php
------ -------------------------------------------------------------------------
90 Property Drupal\spammaster\SpamMasterHoneypotService::$spammasterip has
unknown class Drupal\spammmaster\SpamMasterHoneypotService as its type.
97 Property Drupal\spammaster\SpamMasterHoneypotService::$spammasterpage
has unknown class Drupal\spammmaster\SpamMasterHoneypotService as its
type.
104 Property
Drupal\spammaster\SpamMasterHoneypotService::$spammasterextrafield1 has
unknown class Drupal\spammmaster\SpamMasterHoneypotService as its type.
111 Property
Drupal\spammaster\SpamMasterHoneypotService::$spammasterextrafield2 has
unknown class Drupal\spammmaster\SpamMasterHoneypotService as its type.
------ -------------------------------------------------------------------------
------ -----------------------------------------------------------------
Line src/SpamMasterLicService.php
------ -----------------------------------------------------------------
79 Access to an undefined property
Drupal\spammaster\SpamMasterLicService::$SpamMasterMailService.
310 Access to an undefined property
Drupal\spammaster\SpamMasterLicService::$SpamMasterMailService.
------ -----------------------------------------------------------------
------ -----------------------------------------------------------------------
Line src/SpamMasterMailService.php
------ -----------------------------------------------------------------------
420 Variable $spam_master_warning might not be defined.
423 Variable $spam_master_alert_level_deconstructed might not be defined.
429 Variable $spam_master_total_block_count_result might not be defined.
434 Variable $spam_master_warning_signature might not be defined.
628 Variable $spam_master_warning might not be defined.
630 Variable $spam_master_alert_level_deconstructed might not be defined.
640 Variable $spam_master_total_block_count_result might not be defined.
657 Variable $spam_master_warning_signature might not be defined.
834 Variable $spam_master_alert_level_deconstructed might not be defined.
844 Variable $spam_master_total_block_count_result might not be defined.
------ -----------------------------------------------------------------------
------ ------------------------------------------------------------------------
Line src/SpamMasterRecaptchaService.php
------ ------------------------------------------------------------------------
89 Property Drupal\spammaster\SpamMasterRecaptchaService::$spammasterpage
has unknown class Drupal\spammmaster\SpamMasterRecaptchaService as its
type.
96 Property Drupal\spammaster\SpamMasterRecaptchaService::$spammasterip
has unknown class Drupal\spammmaster\SpamMasterRecaptchaService as its
type.
------ ------------------------------------------------------------------------
------ -------------------------------------------------------------------------
Line src/SpamMasterRegistrationService.php
------ -------------------------------------------------------------------------
90 Property Drupal\spammaster\SpamMasterRegistrationService::$spammasterip
has unknown class Drupal\spammmaster\SpamMasterRegistrationService as
its type.
97 Property
Drupal\spammaster\SpamMasterRegistrationService::$spammasteremail has
unknown class Drupal\spammmaster\SpamMasterRegistrationService as its
type.
------ -------------------------------------------------------------------------
Comment #14
pedro-alves commentedThank you very much.
Fixed and status changed to needs review.
Comment #15
avpadernoThank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewers as well.
Comment #17
pedro-alves commentedComment #18
pedro-alves commentedComment #19
avpaderno