[FIX] strip HOST in urls

This commit is contained in:
Boris 2021-08-30 10:09:24 +02:00
parent 840bdedc2d
commit 892641bfac
5 changed files with 19 additions and 20 deletions

View File

@ -16,8 +16,7 @@ foreach ($videos as $v) {
list($category, $videoID, $p3, $videoName, $p5, $src, $p7, $definition, $videoURI) = explode(";", $v);
$videoURL = 'http://'. HOST. $videoURI;
$videoEco = 'http://'. HOST. '/ipns/' . $p7;
$videoEco = '/ipns/' . $p7;
$mimeType = guessTypeFromFilename($videoURI);
@ -38,7 +37,6 @@ foreach ($videos as $v) {
'thumbURL' => $thumbURL,
'category' => $category,
'mime' => $mimeType,
'url' => $videoURL,
'eco' => $videoEco,
'uri' => $videoURI,
'name' => $videoName,

View File

@ -2,7 +2,8 @@
require_once('functions.php');
require_once('conf.php');
$videoURL = 'http://'. HOST. htmlentities($_GET['uri']);
//$videoURL = 'http://'. HOST;
$videoURL = htmlentities($_GET['uri']);
$videoName = htmlentities(urldecode($_GET['name']));
$videoMIME = htmlentities($_GET['mime']);

View File

@ -4,13 +4,13 @@
<title>$TITLE in Astroport</title>
<meta charset="UTF-8">
<meta http-equiv="Refresh" content="7;URL=http://astroport/ipns/$IPNSLINK/${G1PUB}/">
<link rel='stylesheet' href='http://astroport/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='http://astroport/styles/astroport/logo.png' />
<link rel='stylesheet' href='/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
</head>
<body>
<header>
<h6>
<a href='http://astroport/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
<a href='/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
</h6>
</header>
<main>
@ -50,4 +50,4 @@
</article>
</main>
</body>
</html>
</html>

View File

@ -3,8 +3,8 @@
<head>
<title>$TITLE in Astroport</title>
<meta charset="UTF-8">
<link rel='stylesheet' href='http://astroport/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='http://astroport/styles/astroport/logo.png' />
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
</head>
<body>
<header>
@ -16,8 +16,8 @@
<main>
<article>
<video autoplay="autoplay" controls>
<source src="http://astroport/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">
<a href="http://astroport/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">$TITLE</a>
<source src="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">
<a href="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">$TITLE</a>
</video>
<h1 class="video-title">

View File

@ -298,13 +298,13 @@ cat >~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html <<EOF
<title>$TITLE in Astroport</title>
<meta charset="UTF-8">
<meta http-equiv="Refresh" content="7;URL=http://astroport/ipns/$IPNSLINK/${G1PUB}/">
<link rel='stylesheet' href='http://astroport/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='http://astroport/styles/astroport/logo.png' />
<link rel='stylesheet' href='/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
</head>
<body>
<header>
<h6>
<a href='http://astroport/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
<a href='/'><span>ASTROPORT</span> <q>${XZUID}</q></a>
</h6>
</header>
<main>
@ -344,7 +344,7 @@ cat >~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/index.html <<EOF
</article>
</main>
</body>
</html>
</html>
EOF
@ -358,8 +358,8 @@ cat > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html <<EOF
<head>
<title>$TITLE in Astroport</title>
<meta charset="UTF-8">
<link rel='stylesheet' href='http://astroport/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='http://astroport/styles/astroport/logo.png' />
<link rel='stylesheet' href='/styles/astroport/style.css' type='text/css' />
<link rel='icon' type='image/png' href='/styles/astroport/logo.png' />
</head>
<body>
<header>
@ -371,8 +371,8 @@ cat > ~/.zen/ipfs/.${IPFSNODEID}/KEY/${MEDIAKEY}/${G1PUB}/index.html <<EOF
<main>
<article>
<video autoplay="autoplay" controls>
<source src="http://astroport/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">
<a href="http://astroport/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">$TITLE</a>
<source src="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">
<a href="/ipfs/$IPFSREPFILEID/$URLENCODE_FILE_NAME">$TITLE</a>
</video>
<h1 class="video-title">