summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2021-07-08 21:47:20 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2021-07-08 21:47:20 +0100
commitea1269577fcd9d9b05f4b29ae2ad0d7c4c9a6ca2 (patch)
tree1042a5c01b93e5786a626343b19e6d5ad4275d48
parent1155220fd5c94fa9769c55597575437581170c16 (diff)
Shorten urls
-rw-r--r--make_bookmarklet/index.php2
-rw-r--r--public/add/index.php (renamed from public/bookmarks/add/index.php)4
-rw-r--r--public/read/index.php (renamed from public/bookmarks/read/index.php)4
-rw-r--r--scripts/email_bookmarks.php2
4 files changed, 6 insertions, 6 deletions
diff --git a/make_bookmarklet/index.php b/make_bookmarklet/index.php
index f964003..67dea14 100644
--- a/make_bookmarklet/index.php
+++ b/make_bookmarklet/index.php
@@ -7,7 +7,7 @@ $config = require_once(__DIR__.'/../config.php');
$booklet = <<< EOF_JS
javascript: (() => {
async function bookmarkPage(page) {
- const response = await fetch('{$config['site']}/bookmarks/add/', {
+ const response = await fetch('{$config['site']}/add/', {
method: 'POST',
mode: 'cors',
cache: 'no-cache',
diff --git a/public/bookmarks/add/index.php b/public/add/index.php
index f387bc6..12119b6 100644
--- a/public/bookmarks/add/index.php
+++ b/public/add/index.php
@@ -2,9 +2,9 @@
error_reporting(E_ALL);
-require_once(__DIR__.'/../../../includes/functions.php');
+require_once(__DIR__.'/../../includes/functions.php');
-$config = require_once(__DIR__.'/../../../config.php');
+$config = require_once(__DIR__.'/../../config.php');
if ('OPTIONS' === filter_input(INPUT_SERVER, 'REQUEST_METHOD')) {
respondAndExit(200, 'OK', [
diff --git a/public/bookmarks/read/index.php b/public/read/index.php
index 6a4a216..87857da 100644
--- a/public/bookmarks/read/index.php
+++ b/public/read/index.php
@@ -2,9 +2,9 @@
error_reporting(E_ALL);
-require_once('../../../includes/functions.php');
+require_once(__DIR__.'/../../includes/functions.php');
-$config = require_once('../../../config.php');
+$config = require_once(__DIR__.'/../../config.php');
if ('GET' !== filter_input(INPUT_SERVER, 'REQUEST_METHOD')) {
respondAndExit(405, 'Method Not Allowed');
diff --git a/scripts/email_bookmarks.php b/scripts/email_bookmarks.php
index 4b616e7..9a63d94 100644
--- a/scripts/email_bookmarks.php
+++ b/scripts/email_bookmarks.php
@@ -29,7 +29,7 @@ function buildMessage(array $urls, string $site): string
{
$urls = array_map(function ($url) use ($site) {
return sprintf(
- '<li><a href="%s/bookmarks/read?url=%s">%s</a></li>',
+ '<li><a href="%s/read?url=%s">%s</a></li>',
$site,
urlencode($url),
htmlentities($url)