aboutsummaryrefslogtreecommitdiff
path: root/p/api
diff options
context:
space:
mode:
Diffstat (limited to 'p/api')
-rw-r--r--p/api/fever.php6
-rw-r--r--p/api/greader.php4
-rw-r--r--p/api/index.php4
-rw-r--r--p/api/misc.php4
-rw-r--r--p/api/pshb.php4
-rw-r--r--p/api/query.php6
6 files changed, 14 insertions, 14 deletions
diff --git a/p/api/fever.php b/p/api/fever.php
index 92ddb82b8..01e6d7b61 100644
--- a/p/api/fever.php
+++ b/p/api/fever.php
@@ -16,8 +16,8 @@ header('X-Content-Type-Options: nosniff');
// ================================================================================================
// BOOTSTRAP FreshRSS
-require(__DIR__ . '/../../constants.php');
-require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader
+require dirname(__DIR__, 2) . '/constants.php';
+require LIB_PATH . '/lib_rss.php'; //Includes class autoloader
FreshRSS_Context::initSystem();
// check if API is enabled globally
@@ -355,7 +355,7 @@ final class FeverAPI
return [];
}
- require_once(LIB_PATH . '/favicons.php');
+ require_once LIB_PATH . '/favicons.php';
$favicons = [];
$salt = FreshRSS_Context::systemConf()->salt;
diff --git a/p/api/greader.php b/p/api/greader.php
index 40fb5dc72..88afb3656 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -25,8 +25,8 @@ Server-side API compatible with Google Reader API layer 2
* https://github.com/bazqux/bazqux-api
*/
-require(__DIR__ . '/../../constants.php');
-require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader
+require dirname(__DIR__, 2) . '/constants.php';
+require LIB_PATH . '/lib_rss.php'; //Includes class autoloader
header("Content-Security-Policy: default-src 'none'; frame-ancestors 'none'; sandbox");
header('X-Content-Type-Options: nosniff');
diff --git a/p/api/index.php b/p/api/index.php
index def8d4890..1db1273dc 100644
--- a/p/api/index.php
+++ b/p/api/index.php
@@ -13,8 +13,8 @@
<script src="../scripts/api.js" defer="defer"></script>
<script id="jsonVars" type="application/json">
<?php
-require(__DIR__ . '/../../constants.php');
-require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader
+require dirname(__DIR__, 2) . '/constants.php';
+require LIB_PATH . '/lib_rss.php'; //Includes class autoloader
FreshRSS_Context::initSystem();
echo json_encode([
'greader' => Minz_Url::display('/api/greader.php', 'php', true),
diff --git a/p/api/misc.php b/p/api/misc.php
index 7724caa7a..fe75b5be7 100644
--- a/p/api/misc.php
+++ b/p/api/misc.php
@@ -5,8 +5,8 @@ declare(strict_types=1);
* `/api/misc.php/Extension%20name/` or `/api/misc.php?ext=Extension%20name`
*/
-require(__DIR__ . '/../../constants.php');
-require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader
+require dirname(__DIR__, 2) . '/constants.php';
+require LIB_PATH . '/lib_rss.php'; //Includes class autoloader
function badRequest(): never {
header('HTTP/1.1 400 Bad Request');
diff --git a/p/api/pshb.php b/p/api/pshb.php
index b6cbc5089..37b3fe056 100644
--- a/p/api/pshb.php
+++ b/p/api/pshb.php
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
-require(__DIR__ . '/../../constants.php');
-require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader
+require dirname(__DIR__, 2) . '/constants.php';
+require LIB_PATH . '/lib_rss.php'; //Includes class autoloader
const MAX_PAYLOAD = 3_145_728;
diff --git a/p/api/query.php b/p/api/query.php
index 5d8fb3dec..8aedd8ecf 100644
--- a/p/api/query.php
+++ b/p/api/query.php
@@ -3,8 +3,8 @@ declare(strict_types=1);
header('X-Content-Type-Options: nosniff');
-require(__DIR__ . '/../../constants.php');
-require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader
+require dirname(__DIR__, 2) . '/constants.php';
+require LIB_PATH . '/lib_rss.php'; //Includes class autoloader
Minz_Request::init();
@@ -48,7 +48,7 @@ if (!FreshRSS_Context::hasUserConf() || !FreshRSS_Context::userConf()->enabled)
usleep(rand(20, 200));
}
-require(LIB_PATH . '/http-conditional.php');
+require LIB_PATH . '/http-conditional.php';
$dateLastModification = max(
FreshRSS_UserDAO::ctime($user),
FreshRSS_UserDAO::mtime($user),