1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-11-27 11:22:17 -05:00

fix of putenv warning under safe mode, issue #646

This commit is contained in:
Maryana Rozhankivska 2014-04-25 13:25:03 +03:00
parent d151b51c67
commit b6413975c3

View File

@ -72,7 +72,7 @@ class Poche
# l10n # l10n
$language = $this->user->getConfigValue('language'); $language = $this->user->getConfigValue('language');
putenv('LC_ALL=' . $language); @putenv('LC_ALL=' . $language);
setlocale(LC_ALL, $language); setlocale(LC_ALL, $language);
bindtextdomain($language, LOCALE); bindtextdomain($language, LOCALE);
textdomain($language); textdomain($language);
@ -241,12 +241,12 @@ class Poche
$filter = new Twig_SimpleFilter('getReadingTime', 'Tools::getReadingTime'); $filter = new Twig_SimpleFilter('getReadingTime', 'Tools::getReadingTime');
$this->tpl->addFilter($filter); $this->tpl->addFilter($filter);
} }
public function createNewUser() { public function createNewUser() {
if (isset($_GET['newuser'])){ if (isset($_GET['newuser'])){
if ($_POST['newusername'] != "" && $_POST['password4newuser'] != ""){ if ($_POST['newusername'] != "" && $_POST['password4newuser'] != ""){
$newusername = filter_var($_POST['newusername'], FILTER_SANITIZE_STRING); $newusername = filter_var($_POST['newusername'], FILTER_SANITIZE_STRING);
if (!$this->store->userExists($newusername)){ if (!$this->store->userExists($newusername)){
if ($this->store->install($newusername, Tools::encodeString($_POST['password4newuser'] . $newusername))) { if ($this->store->install($newusername, Tools::encodeString($_POST['password4newuser'] . $newusername))) {
Tools::logm('The new user '.$newusername.' has been installed'); Tools::logm('The new user '.$newusername.' has been installed');
$this->messages->add('s', sprintf(_('The new user %s has been installed. Do you want to <a href="?logout">logout ?</a>'),$newusername)); $this->messages->add('s', sprintf(_('The new user %s has been installed. Do you want to <a href="?logout">logout ?</a>'),$newusername));
@ -265,7 +265,7 @@ class Poche
} }
} }
} }
public function deleteUser(){ public function deleteUser(){
if (isset($_GET['deluser'])){ if (isset($_GET['deluser'])){
if ($this->store->listUsers() > 1) { if ($this->store->listUsers() > 1) {