summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornashe <thomas@chauchefoin.fr>2017-07-07 23:42:27 +0100
committernashe <thomas@chauchefoin.fr>2017-07-07 23:42:27 +0100
commit28a1dd7b5c068360968dfb648fe1b620e8902645 (patch)
treee5e527f4f4f81db0a4a422fdf957ea3dc8e082c9
parent435bc5c33f2428b181d6c41c037dcc993ba50b66 (diff)
downloadplanet-28a1dd7b5c068360968dfb648fe1b620e8902645.tar
planet-28a1dd7b5c068360968dfb648fe1b620e8902645.tar.gz
planet-28a1dd7b5c068360968dfb648fe1b620e8902645.tar.bz2
planet-28a1dd7b5c068360968dfb648fe1b620e8902645.tar.xz
planet-28a1dd7b5c068360968dfb648fe1b620e8902645.zip
Add spanish choice in install
Fixes #90.
-rwxr-xr-xinstall.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/install.php b/install.php
index bdab378..6a206fc 100755
--- a/install.php
+++ b/install.php
@@ -13,12 +13,19 @@ include __DIR__ . '/admin/inc/pwd.inc.php';
if (file_exists(__DIR__ . '/custom/config.yml') && isset($login) && isset($password)) {
$status = 'installed';
} elseif (isset($_REQUEST['url'])) {
+
+ // Do no try to use the file of an invalid locale
+ if (strstr($_REQUEST['locale'], '..') !== false
+ || !file_exists(__DIR__ . "/app/l10n/${_REQUEST['locale']}.lang")) {
+ $_REQUEST['locale'] = 'en';
+ }
+
$save = array();
//Save config file
$config = array(
'url' => $_REQUEST['url'],
'name' => filter_var($_REQUEST['title'], FILTER_SANITIZE_SPECIAL_CHARS),
- 'locale' => filter_var($_REQUEST['locale'], FILTER_SANITIZE_SPECIAL_CHARS),
+ 'locale' => $_REQUEST['locale'],
'items' => 10,
'shuffle' => 0,
'refresh' => 240,
@@ -164,6 +171,7 @@ if (file_exists(__DIR__ . '/custom/config.yml') && isset($login) && isset($passw
<label for="locale">Language:</label>
<select name="locale" id="locale">
<option selected="selected" value="en">English</option>
+ <option value="es">Español</option>
<option value="fr">Français</option>
</select>
</p>