diff --git a/CHANGELOG.md b/CHANGELOG.md index 30dd12e3..5773b9e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), #### Fixed -* *Nothing* +* [#309](https://github.com/shlinkio/shlink/issues/309) Added missing favicon to prevent 404 errors logged when an error page is loaded in a browser. ## 1.15.0 - 2018-12-02 diff --git a/config/autoload/swoole.global.php b/config/autoload/swoole.global.php index 2218f7bb..5f82f0bc 100644 --- a/config/autoload/swoole.global.php +++ b/config/autoload/swoole.global.php @@ -9,9 +9,6 @@ return [ 'swoole-http-server' => [ 'host' => '0.0.0.0', 'process-name' => 'shlink', - 'static-files' => [ - 'enable' => false, - ], ], ], diff --git a/module/Common/src/Template/Extension/TranslatorExtension.php b/module/Common/src/Template/Extension/TranslatorExtension.php index 477730f2..775bd909 100644 --- a/module/Common/src/Template/Extension/TranslatorExtension.php +++ b/module/Common/src/Template/Extension/TranslatorExtension.php @@ -20,5 +20,6 @@ class TranslatorExtension implements ExtensionInterface public function register(Engine $engine): void { $engine->registerFunction('translate', [$this->translator, 'translate']); + $engine->registerFunction('locale', [$this->translator, 'getLocale']); } } diff --git a/module/Common/test/Template/Extension/TranslatorExtensionTest.php b/module/Common/test/Template/Extension/TranslatorExtensionTest.php index ab97b953..dd3462bc 100644 --- a/module/Common/test/Template/Extension/TranslatorExtensionTest.php +++ b/module/Common/test/Template/Extension/TranslatorExtensionTest.php @@ -25,11 +25,14 @@ class TranslatorExtensionTest extends TestCase public function properFunctionsAreReturned() { $engine = $this->prophesize(Engine::class); - $registerFunction = $engine->registerFunction('translate', Argument::type('callable'))->will(function () { + $registerTranslate = $engine->registerFunction('translate', Argument::type('callable'))->will(function () { + }); + $registerLocale = $engine->registerFunction('locale', Argument::type('array'))->will(function () { }); $this->extension->register($engine->reveal()); - $registerFunction->shouldHaveBeenCalledOnce(); + $registerTranslate->shouldHaveBeenCalledOnce(); + $registerLocale->shouldHaveBeenCalledOnce(); } } diff --git a/module/Core/templates/layout/default.phtml b/module/Core/templates/layout/default.phtml index 431c1d73..2a8dcd98 100644 --- a/module/Core/templates/layout/default.phtml +++ b/module/Core/templates/layout/default.phtml @@ -1,31 +1,32 @@ <!DOCTYPE html> -<html> -<head> - <title><?= $this->section('title', '') ?> | URL shortener</title> - <meta charset="utf-8" /> - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" /> - <style> - body {padding-top: 60px;} - .app {display: flex; min-height: 100vh; flex-direction: column;} - .app-content {flex: 1;} - .app-footer p {margin-bottom: 20px;} - </style> - <?= $this->section('stylesheets', '') ?> -</head> -<body class="app"> - <div class="app-content"> - <main class="container"> - <?= $this->section('main', '') ?> - </main> - </div> - - <footer class="app-footer"> - <div class="container"> - <hr /> - <p>© <?= date('Y') ?> <a href="https://shlink.io">Shlink</a></p> +<html lang="<?= $this->locale() ?>"> + <head> + <title><?= $this->section('title', '') ?> | URL shortener</title> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> + <link rel="shortcut icon" href="/favicon.ico"> + <style> + body {padding-top: 60px;} + .app {display: flex; min-height: 100vh; flex-direction: column;} + .app-content {flex: 1;} + .app-footer p {margin-bottom: 20px;} + </style> + <?= $this->section('stylesheets', '') ?> + </head> + <body class="app"> + <div class="app-content"> + <main class="container"> + <?= $this->section('main', '') ?> + </main> </div> - </footer> -</body> + + <footer class="app-footer"> + <div class="container"> + <hr> + <p>© <?= date('Y') ?> <a href="https://shlink.io">Shlink</a></p> + </div> + </footer> + </body> </html> diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 00000000..8157d0e0 Binary files /dev/null and b/public/favicon.ico differ