Parse template scripting in 'wcf.ajax.error.*'
authorFabii547 <fabiangossner@gmail.com>
Wed, 10 Aug 2016 08:06:57 +0000 (10:06 +0200)
committerFabii547 <fabiangossner@gmail.com>
Wed, 10 Aug 2016 08:26:38 +0000 (10:26 +0200)
wcfsetup/install/files/lib/action/AJAXInvokeAction.class.php
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/WCFACP.class.php
wcfsetup/install/files/lib/system/exception/AJAXException.class.php
wcfsetup/install/files/lib/system/exception/InvalidSecurityTokenException.class.php
wcfsetup/install/files/lib/system/request/RequestHandler.class.php

index c48fb2c941e3185e4bf6e1ae034dd86c64a63c38..4a86c292dc84d2d531483d1d75d0e4a991740120 100644 (file)
@@ -174,10 +174,10 @@ class AJAXInvokeAction extends AbstractSecureAction {
                }
                
                if ($e instanceof InvalidSecurityTokenException) {
-                       throw new AJAXException(WCF::getLanguage()->get('wcf.ajax.error.sessionExpired'), AJAXException::SESSION_EXPIRED, $e->getTraceAsString());
+                       throw new AJAXException(WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.sessionExpired'), AJAXException::SESSION_EXPIRED, $e->getTraceAsString());
                }
                else if ($e instanceof PermissionDeniedException) {
-                       throw new AJAXException(WCF::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS, $e->getTraceAsString());
+                       throw new AJAXException(WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS, $e->getTraceAsString());
                }
                else if ($e instanceof IllegalLinkException) {
                        throw new AJAXException(WCF::getLanguage()->get('wcf.ajax.error.illegalLink'), AJAXException::ILLEGAL_LINK, $e->getTraceAsString());
index badbd5f0cd2b6ec5644a8d3e80ab07a6718c851a..843ba33c5ae8966747e03d3497d1b2dbf0011643 100644 (file)
@@ -397,7 +397,7 @@ class WCF {
                if (defined('BLACKLIST_IP_ADDRESSES') && BLACKLIST_IP_ADDRESSES != '') {
                        if (!StringUtil::executeWordFilter(UserUtil::convertIPv6To4(self::getSession()->ipAddress), BLACKLIST_IP_ADDRESSES)) {
                                if ($isAjax) {
-                                       throw new AJAXException(self::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
+                                       throw new AJAXException(self::getLanguage()->getDynamicVariable('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
                                }
                                else {
                                        throw new PermissionDeniedException();
@@ -405,7 +405,7 @@ class WCF {
                        }
                        else if (!StringUtil::executeWordFilter(self::getSession()->ipAddress, BLACKLIST_IP_ADDRESSES)) {
                                if ($isAjax) {
-                                       throw new AJAXException(self::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
+                                       throw new AJAXException(self::getLanguage()->getDynamicVariable('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
                                }
                                else {
                                        throw new PermissionDeniedException();
@@ -415,7 +415,7 @@ class WCF {
                if (defined('BLACKLIST_USER_AGENTS') && BLACKLIST_USER_AGENTS != '') {
                        if (!StringUtil::executeWordFilter(self::getSession()->userAgent, BLACKLIST_USER_AGENTS)) {
                                if ($isAjax) {
-                                       throw new AJAXException(self::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
+                                       throw new AJAXException(self::getLanguage()->getDynamicVariable('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
                                }
                                else {
                                        throw new PermissionDeniedException();
@@ -425,7 +425,7 @@ class WCF {
                if (defined('BLACKLIST_HOSTNAMES') && BLACKLIST_HOSTNAMES != '') {
                        if (!StringUtil::executeWordFilter(@gethostbyaddr(self::getSession()->ipAddress), BLACKLIST_HOSTNAMES)) {
                                if ($isAjax) {
-                                       throw new AJAXException(self::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
+                                       throw new AJAXException(self::getLanguage()->getDynamicVariable('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
                                }
                                else {
                                        throw new PermissionDeniedException();
index 065c6bdf9d351298f7c600a01dfae9f09b435aac..467e32a4511888bee08b807921b8764f45b6a058 100644 (file)
@@ -141,7 +141,7 @@ class WCFACP extends WCF {
                        if (WCF::getUser()->userID == 0) {
                                // work-around for AJAX-requests within ACP
                                if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
-                                       throw new AJAXException(WCF::getLanguage()->get('wcf.ajax.error.sessionExpired'), AJAXException::SESSION_EXPIRED, '');
+                                       throw new AJAXException(WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.sessionExpired'), AJAXException::SESSION_EXPIRED, '');
                                }
                                
                                // build redirect path
@@ -165,7 +165,7 @@ class WCFACP extends WCF {
                                                WCF::getSession()->checkPermissions(['admin.general.canUseAcp']);
                                        }
                                        catch (PermissionDeniedException $e) {
-                                               throw new AJAXException(self::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS, $e->getTraceAsString());
+                                               throw new AJAXException(self::getLanguage()->getDynamicVariable('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS, $e->getTraceAsString());
                                        }
                                }
                                else {
index bcb892ba3e242791d5d9de122505f69fa62bbcc5..6f1a7490b52ce9f7c6bb20501c40f5ad3fef3d6b 100644 (file)
@@ -104,7 +104,7 @@ class AJAXException extends LoggedException {
                                $responseData['code'] = self::INTERNAL_ERROR;
                                $responseData['exceptionID'] = $exceptionID;
                                if (!WCF::debugModeIsEnabled()) {
-                                       $responseData['message'] = WCF::getLanguage()->get('wcf.ajax.error.internalError');
+                                       $responseData['message'] = WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.internalError');
                                }
                        break;
                }
index 1153b72d639720a7532e3e6eadcfd8ad02483eff..da99180883af5870c29da0997c410d2e586ca9d7 100644 (file)
@@ -15,6 +15,6 @@ class InvalidSecurityTokenException extends NamedUserException {
         * Creates a new InvalidSecurityTokenException object.
         */
        public function __construct() {
-               parent::__construct(WCF::getLanguage()->get('wcf.ajax.error.sessionExpired'));
+               parent::__construct(WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.sessionExpired'));
        }
 }
index f8446989550c24d354b3258e75a69588d25787fe..cbf49e1561e297ebc08185ccb196fdfff199bb2c 100644 (file)
@@ -73,7 +73,7 @@ class RequestHandler extends SingletonFactory {
                        if (!$isACPRequest && defined('OFFLINE') && OFFLINE) {
                                if (!WCF::getSession()->getPermission('admin.general.canViewPageDuringOfflineMode') && !$this->activeRequest->isAvailableDuringOfflineMode()) {
                                        if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')) {
-                                               throw new AJAXException(WCF::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
+                                               throw new AJAXException(WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
                                        }
                                        else {
                                                @header('HTTP/1.1 503 Service Unavailable');