Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not dynamically assign modProcessorResponse to modConnectorResponse #16564

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/Revolution/modConnectorResponse.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

Check failure on line 1 in core/src/Revolution/modConnectorResponse.php

View workflow job for this annotation

GitHub Actions / phpcs

Header blocks must be separated by a single blank line
/*
* This file is part of MODX Revolution.
*
Expand All @@ -25,11 +25,11 @@
* @var string
* @access private
*/
protected $_directory;

Check warning on line 28 in core/src/Revolution/modConnectorResponse.php

View workflow job for this annotation

GitHub Actions / phpcs

Property name "$_directory" should not be prefixed with an underscore to indicate visibility

public $responseCode = 200;

protected $_responseCodes = [

Check warning on line 32 in core/src/Revolution/modConnectorResponse.php

View workflow job for this annotation

GitHub Actions / phpcs

Property name "$_responseCodes" should not be prefixed with an underscore to indicate visibility
100 => 'Continue',
101 => 'Switching Protocols',
200 => 'OK',
Expand Down Expand Up @@ -107,21 +107,21 @@
if (empty($siteId) && (!defined('MODX_REQP') || MODX_REQP === true)) {
$this->responseCode = 401;
$this->body = $modx->error->failure($modx->lexicon('access_denied'), ['code' => 401]);
} /* Make sure we've got a token */

Check failure on line 110 in core/src/Revolution/modConnectorResponse.php

View workflow job for this annotation

GitHub Actions / phpcs

Expected 1 space after closing brace; newline found
elseif (!$isLogin && !isset($_SERVER['HTTP_MODAUTH']) && (!isset($_REQUEST['HTTP_MODAUTH']) || empty($_REQUEST['HTTP_MODAUTH']))) {

Check warning on line 111 in core/src/Revolution/modConnectorResponse.php

View workflow job for this annotation

GitHub Actions / phpcs

Line exceeds 120 characters; contains 139 characters
$this->responseCode = 401;
$this->body = $modx->error->failure($modx->lexicon('access_denied'), ['code' => 401]);
} /* If the token was passed as a request header (like in the manager), check if it's right */

Check failure on line 114 in core/src/Revolution/modConnectorResponse.php

View workflow job for this annotation

GitHub Actions / phpcs

Expected 1 space after closing brace; newline found
else {
if (!$isLogin && isset($_SERVER['HTTP_MODAUTH']) && $_SERVER['HTTP_MODAUTH'] != $siteId) {
$this->responseCode = 401;
$this->body = $modx->error->failure($modx->lexicon('access_denied'), ['code' => 401]);
} /* If the token was passed a request variable, check if it's right */

Check failure on line 119 in core/src/Revolution/modConnectorResponse.php

View workflow job for this annotation

GitHub Actions / phpcs

Expected 1 space after closing brace; newline found
else {
if (!$isLogin && isset($_REQUEST['HTTP_MODAUTH']) && $_REQUEST['HTTP_MODAUTH'] != $siteId) {
$this->responseCode = 401;
$this->body = $modx->error->failure($modx->lexicon('access_denied'), ['code' => 401]);
}

Check failure on line 124 in core/src/Revolution/modConnectorResponse.php

View workflow job for this annotation

GitHub Actions / phpcs

Expected 1 space after closing brace; newline found
/* verify the location and action */
/*else if (!isset($options['location']) || !isset($options['action'])) {
$this->responseCode = 404;
Expand All @@ -148,14 +148,14 @@
}

/* run processor */
$this->response = $this->modx->runProcessor($target, $scriptProperties, $options);
if (!$this->response) {
$response = $this->modx->runProcessor($target, $scriptProperties, $options);
if (!$response) {
$this->responseCode = 404;
$this->body = $this->modx->error->failure($this->modx->lexicon('processor_err_nf', [
'target' => $target,
]));
} else {
$this->body = $this->response->getResponse();
$this->body = $response->getResponse();
}
}
}
Expand Down
Loading