REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.49 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/API/JSON/Endpoint.php
Text
Base64
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\API\JSON; if (!defined('ABSPATH')) exit; use MailPoet\Config\AccessControl; abstract class Endpoint { const TYPE_POST = 'POST'; const TYPE_GET = 'GET'; public $permissions = [ 'global' => AccessControl::PERMISSION_MANAGE_SETTINGS, 'methods' => [], ]; protected static $getMethods = []; public function successResponse( $data = [], $meta = [], $status = Response::STATUS_OK ) { return new SuccessResponse($data, $meta, $status); } public function errorResponse( $errors = [], $meta = [], $status = Response::STATUS_NOT_FOUND ) { if (empty($errors)) { $errors = [ Error::UNKNOWN => __('An unknown error occurred.', 'mailpoet'), ]; } return new ErrorResponse($errors, $meta, $status); } public function badRequest($errors = [], $meta = []) { if (empty($errors)) { $errors = [ Error::BAD_REQUEST => __('Invalid request parameters', 'mailpoet'), ]; } return new ErrorResponse($errors, $meta, Response::STATUS_BAD_REQUEST); } public function isMethodAllowed($name, $type) { // Block GET requests on POST endpoints, but allow POST requests on GET endpoints (some plugins // change REQUEST_METHOD to POST on GET requests, which caused them to be blocked) if ($type === self::TYPE_GET && !in_array($name, static::$getMethods)) { return false; } return true; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ResponseBuilders
DIR
-
drwxr-xr-x
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
v1
DIR
-
drwxr-xr-x
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
API.php
9.36 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Endpoint.php
1.49 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Error.php
398 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ErrorHandler.php
790 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ErrorResponse.php
921 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.php
0 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Response.php
1.07 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SuccessResponse.php
519 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).