e107inc/e107

View on GitHub
e107_handlers/message_handler.php

Summary

Maintainability
A
0 mins
Test Coverage
F
47%

Variable $emessage was undeclared, but array fields are being added to it.
Open

        $emessage[1] = "<b>".LAN_ERROR_25."</b>";
Severity: Info
Found in e107_handlers/message_handler.php by phan

Returning type null but getSession() is declared to return array|string
Open

        if(!session_id()) return null;
Severity: Minor
Found in e107_handlers/message_handler.php by phan

Argument 1 (type) is false but \eMessage::get() takes string defined at /code/e107_handlers/message_handler.php:448
Open

        return ($this->get($type, $mstack, true, false) || ($session && $this->getSession($type, $mstack, true, false)));
Severity: Minor
Found in e107_handlers/message_handler.php by phan

When fetching an array index from a value of type array|array{1:'\x3cb\x3e\x5b1\x5d: Unable to read core settings from database - Core settings exist but cannot be unserialized. Attempting to restore core backup ...\x3c/b\x3e'}|array{2:'\x3cb\x3e\x5b2\x5d: Unable to read core settings from database - non-existent core settings.\x3c/b\x3e'}|array{3:'\x3cb\x3e\x5b3\x5d: Core settings saved - backup made active.\x3c/b\x3e'}|array{4:'\x3cb\x3e\x5b4\x5d: No core backup found. Check that your database has valid content. \x3c/b\x3e'}|array{5:'\x5b5\x5d: Field\x28s\x29 have been left blank. Please resubmit the form and fill in the required fields.'}|array{6:'\x3cb\x3e\x5b6\x5d: Unable to form a valid connection to mySQL. Please check that your e107_config.php contains the correct information.\x3c/b\x3e'}|array{7:string}|array{8:string}, found an array index of type string, but expected the index to be of type int
Open

            $message = !empty($emessage[$message]) ? $emessage[$message] : $message;
Severity: Minor
Found in e107_handlers/message_handler.php by phan

When fetching an array index from a value of type array|array{1:'\x3cb\x3e\x5b1\x5d: Unable to read core settings from database - Core settings exist but cannot be unserialized. Attempting to restore core backup ...\x3c/b\x3e'}|array{2:'\x3cb\x3e\x5b2\x5d: Unable to read core settings from database - non-existent core settings.\x3c/b\x3e'}|array{3:'\x3cb\x3e\x5b3\x5d: Core settings saved - backup made active.\x3c/b\x3e'}|array{4:'\x3cb\x3e\x5b4\x5d: No core backup found. Check that your database has valid content. \x3c/b\x3e'}|array{5:'\x5b5\x5d: Field\x28s\x29 have been left blank. Please resubmit the form and fill in the required fields.'}|array{6:'\x3cb\x3e\x5b6\x5d: Unable to form a valid connection to mySQL. Please check that your e107_config.php contains the correct information.\x3c/b\x3e'}|array{7:string}|array{8:string}, found an array index of type string, but expected the index to be of type int
Open

            $message = isset($emessage[$message]) ? $emessage[$message] : $message;
Severity: Minor
Found in e107_handlers/message_handler.php by phan

Argument 1 (type) is false but \eMessage::getSession() takes string defined at /code/e107_handlers/message_handler.php:488
Open

        return ($this->get($type, $mstack, true, false) || ($session && $this->getSession($type, $mstack, true, false)));
Severity: Minor
Found in e107_handlers/message_handler.php by phan

Reference to undeclared constant \e_EMAIL_CRITICAL
Open

                    @file_put_contents(e_LOG.'criticalErrorEmail'.date('Ymd').'.log', 'Critical Error email sent to '.e_EMAIL_CRITICAL);
Severity: Minor
Found in e107_handlers/message_handler.php by phan

Argument 2 (mstack) is string but \eMessage::mergeWithSession() takes bool|false defined at /code/e107_handlers/message_handler.php:711
Open

            $this->mergeWithSession(true, $mstack);
Severity: Minor
Found in e107_handlers/message_handler.php by phan

Reference to undeclared constant \e_EMAIL_CRITICAL
Open

                    @mail(e_EMAIL_CRITICAL, $subject, $date."\t\t". strip_tags($message));
Severity: Minor
Found in e107_handlers/message_handler.php by phan

There are no issues that match your filters.

Category
Status