diff options
author | Brian Evans <grknight@gentoo.org> | 2020-10-02 14:32:39 -0400 |
---|---|---|
committer | Brian Evans <grknight@gentoo.org> | 2020-10-02 14:32:39 -0400 |
commit | 1f029fca0e032ee20673003d136f8603984b0841 (patch) | |
tree | 50d3a1748543abec2e7bbc3d94a7290cb57a78d2 /AbuseFilter/includes/parser/AFPUserVisibleException.php | |
parent | Update Echo to 1.35 (diff) | |
download | extensions-1f029fca0e032ee20673003d136f8603984b0841.tar.gz extensions-1f029fca0e032ee20673003d136f8603984b0841.tar.bz2 extensions-1f029fca0e032ee20673003d136f8603984b0841.zip |
Update AbuseFilter to 1.35
Signed-off-by: Brian Evans <grknight@gentoo.org>
Diffstat (limited to 'AbuseFilter/includes/parser/AFPUserVisibleException.php')
-rw-r--r-- | AbuseFilter/includes/parser/AFPUserVisibleException.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/AbuseFilter/includes/parser/AFPUserVisibleException.php b/AbuseFilter/includes/parser/AFPUserVisibleException.php index ab4b2264..0ffce7b1 100644 --- a/AbuseFilter/includes/parser/AFPUserVisibleException.php +++ b/AbuseFilter/includes/parser/AFPUserVisibleException.php @@ -20,9 +20,23 @@ class AFPUserVisibleException extends AFPException { $this->mPosition = $position; $this->mParams = $params; - // Exception message text for logs should be in English. - $msg = $this->getMessageObj()->inLanguage( 'en' )->useDatabase( false )->text(); - parent::__construct( $msg ); + parent::__construct( $exception_id ); + } + + /** + * Change the message of the exception to a localized version + */ + public function setLocalizedMessage() { + $this->message = $this->getMessageObj()->text(); + } + + /** + * Returns the error message in English for use in logs + * + * @return string + */ + public function getMessageForLogs() { + return $this->getMessageObj()->inLanguage( 'en' )->useDatabase( false )->text(); } /** @@ -39,6 +53,8 @@ class AFPUserVisibleException extends AFPException { // abusefilter-exception-overridebuiltin, abusefilter-exception-outofbounds // abusefilter-exception-notarray, abusefilter-exception-unclosedcomment // abusefilter-exception-invalidiprange, abusefilter-exception-disabledvar + // abusefilter-exception-variablevariable, abusefilter-exception-toomanyargs + // abusefilter-exception-negativeoffset return wfMessage( 'abusefilter-exception-' . $this->mExceptionID, $this->mPosition, ...$this->mParams |