From: Maryana Rozhankivska Date: Fri, 25 Apr 2014 10:25:03 +0000 (+0300) Subject: fix of putenv warning under safe mode, issue #646 X-Git-Tag: 1.7.0^2~13^2~1 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=b6413975c36a5f912ed95ee749a5a1bd2d868f40;p=github%2Fwallabag%2Fwallabag.git fix of putenv warning under safe mode, issue #646 --- diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 7e3e6afe..5aa6ea07 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -72,7 +72,7 @@ class Poche # l10n $language = $this->user->getConfigValue('language'); - putenv('LC_ALL=' . $language); + @putenv('LC_ALL=' . $language); setlocale(LC_ALL, $language); bindtextdomain($language, LOCALE); textdomain($language); @@ -241,12 +241,12 @@ class Poche $filter = new Twig_SimpleFilter('getReadingTime', 'Tools::getReadingTime'); $this->tpl->addFilter($filter); } - + public function createNewUser() { if (isset($_GET['newuser'])){ if ($_POST['newusername'] != "" && $_POST['password4newuser'] != ""){ $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))) { 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 logout ?'),$newusername)); @@ -265,7 +265,7 @@ class Poche } } } - + public function deleteUser(){ if (isset($_GET['deluser'])){ if ($this->store->listUsers() > 1) {