Clean URLs for HTTPS

This commit is contained in:
Pierre Rudloff 2015-10-31 11:35:18 +01:00
parent da81168256
commit 78670d73a5
5 changed files with 217 additions and 11 deletions

View file

@ -8,7 +8,8 @@
"smarty/smarty": "~3.1", "smarty/smarty": "~3.1",
"rg3/youtube-dl": "2015.10.24", "rg3/youtube-dl": "2015.10.24",
"slim/slim": "~2.6.2", "slim/slim": "~2.6.2",
"slim/views": "~0.1.3" "slim/views": "~0.1.3",
"rudloff/smarty-plugin-noscheme": "~0.1.0"
}, },
"require-dev": { "require-dev": {
"symfony/var-dumper": "~2.7.6" "symfony/var-dumper": "~2.7.6"

214
composer.lock generated
View file

@ -4,9 +4,183 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "a3bd183ffb07dc7dd09cf58f9b44f849", "hash": "82f7ed8800ea2323a9c82063c52a5aec",
"content-hash": "171a72e54b647ef8b67a785971c887fa", "content-hash": "d0cc534e5934271396a1b66d8d0ff51b",
"packages": [ "packages": [
{
"name": "jeremykendall/php-domain-parser",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/jeremykendall/php-domain-parser.git",
"reference": "896e7e70f02bd4fd77190052799bc61e4d779672"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jeremykendall/php-domain-parser/zipball/896e7e70f02bd4fd77190052799bc61e4d779672",
"reference": "896e7e70f02bd4fd77190052799bc61e4d779672",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-intl": "*",
"ext-mbstring": "*",
"php": ">=5.3.0"
},
"require-dev": {
"jeremykendall/debug-die": "0.0.1.*",
"mikey179/vfsstream": "~1.4",
"phpunit/phpunit": "~4.4"
},
"bin": [
"bin/parse",
"bin/update-psl"
],
"type": "library",
"autoload": {
"psr-0": {
"Pdp\\": "src/"
},
"files": [
"src/pdp-parse-url.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
},
{
"name": "Contributors",
"homepage": "https://github.com/jeremykendall/php-domain-parser/graphs/contributors"
}
],
"description": "Public Suffix List based URL parsing implemented in PHP.",
"homepage": "https://github.com/jeremykendall/php-domain-parser",
"keywords": [
"Public Suffix List",
"domain parsing",
"url parsing"
],
"time": "2015-03-30 12:49:45"
},
{
"name": "league/uri",
"version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri.git",
"reference": "a22120c5937814dbadaffccef32bf11040f46c0b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri/zipball/a22120c5937814dbadaffccef32bf11040f46c0b",
"reference": "a22120c5937814dbadaffccef32bf11040f46c0b",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"ext-intl": "*",
"ext-mbstring": "*",
"jeremykendall/php-domain-parser": "^3.0",
"php": ">=5.5.9",
"psr/http-message": "^1.0"
},
"require-dev": {
"fabpot/php-cs-fixer": "^1.9",
"phpunit/phpunit": "^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://github.com/nyamsprod/",
"role": "Developer"
}
],
"description": "URI manipulation library",
"homepage": "http://url.thephpleague.com",
"keywords": [
"ftp",
"http",
"parse_url",
"psr-7",
"rfc3986",
"uri",
"url",
"ws"
],
"time": "2015-09-23 11:09:45"
},
{
"name": "psr/http-message",
"version": "1.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
"reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2015-05-04 20:22:00"
},
{ {
"name": "rg3/youtube-dl", "name": "rg3/youtube-dl",
"version": "2015.10.24", "version": "2015.10.24",
@ -17,6 +191,42 @@
}, },
"type": "library" "type": "library"
}, },
{
"name": "rudloff/smarty-plugin-noscheme",
"version": "0.1.0",
"source": {
"type": "git",
"url": "https://github.com/Rudloff/smarty-plugin-noscheme.git",
"reference": "537bcb2f7576252af70d8f9f817bfe050d873072"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Rudloff/smarty-plugin-noscheme/zipball/537bcb2f7576252af70d8f9f817bfe050d873072",
"reference": "537bcb2f7576252af70d8f9f817bfe050d873072",
"shasum": ""
},
"require": {
"league/uri": "~4.0"
},
"require-dev": {
"symfony/var-dumper": "~2.7.6"
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-3.0"
],
"authors": [
{
"name": "Pierre Rudloff",
"email": "contact@rudloff.pro",
"homepage": "https://rudloff.pro/",
"role": "Developer"
}
],
"description": "Smarty modifier that removes the scheme in URLs",
"time": "2015-10-31 10:25:47"
},
{ {
"name": "slim/slim", "name": "slim/slim",
"version": "2.6.2", "version": "2.6.2",

View file

@ -23,7 +23,7 @@ $app = new \Slim\Slim(
$view = $app->view(); $view = $app->view();
$view->parserExtensions = array( $view->parserExtensions = array(
__DIR__.'/vendor/slim/views/SmartyPlugins', __DIR__.'/vendor/slim/views/SmartyPlugins',
__DIR__.'/smarty' __DIR__.'/vendor/rudloff/smarty-plugin-noscheme/'
); );
$app->get( $app->get(
'/', '/',

View file

@ -1,5 +0,0 @@
<?php
function smarty_modifier_noscheme($url) {
$info = parse_url($url);
return '//'.$info['host'].$info['path'];
}

View file

@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name=viewport content="width=device-width, initial-scale=1"> <meta name=viewport content="width=device-width, initial-scale=1">
<meta name="description" content="Easily download videos from Youtube, Dailymotion, Vimeo and other websites." /> <meta name="description" content="Easily download videos from Youtube, Dailymotion, Vimeo and other websites." />
<link rel="stylesheet" href="{siteUrl url='dist/main.css'}" /> <link rel="stylesheet" href="{siteUrl|noscheme url='dist/main.css'}" />
<link rel="author" href="https://plus.google.com/110403274854419000481?rel=author" /> <link rel="author" href="https://plus.google.com/110403274854419000481?rel=author" />
<link rel="author" href="https://plus.google.com/103696815796116179392?rel=author" /> <link rel="author" href="https://plus.google.com/103696815796116179392?rel=author" />
<link href="https://plus.google.com/108799967445657477255" rel="publisher" /> <link href="https://plus.google.com/108799967445657477255" rel="publisher" />
@ -21,7 +21,7 @@
<meta name="twitter:creator" content="@Tael67" /> <meta name="twitter:creator" content="@Tael67" />
<meta name="twitter:description" content="Easily download videos from Youtube, Dailymotion, Vimeo and other websites." /> <meta name="twitter:description" content="Easily download videos from Youtube, Dailymotion, Vimeo and other websites." />
<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script> <script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<script src="dist/main.js"></script> <script src="{siteUrl|noscheme url='dist/main.js'}"></script>
<meta itemprop="applicationCategory" content="Download" /> <meta itemprop="applicationCategory" content="Download" />
<meta itemprop="operatingSystem" content="Linux" /> <meta itemprop="operatingSystem" content="Linux" />
<meta itemprop="operatingSystem" content="Mac OS X" /> <meta itemprop="operatingSystem" content="Mac OS X" />