- Added function isEmptyString to fhc_helper

- Added function isEmptyArray to fhc_helper
- Adapted the code in application/* to use as much as possible this two new functions
- Removed the php function empty almost everywhere
This commit is contained in:
Paolo
2018-06-27 15:06:04 +02:00
parent d04b0450da
commit 25e66bf9dd
23 changed files with 214 additions and 200 deletions
+3 -3
View File
@@ -48,7 +48,7 @@ class Phrases extends FHC_Controller
*/
public function view($phrase_id)
{
if (empty($phrase_id))
if (!is_numeric($phrase_id))
show_error('Invalid phrase_id parameter');
$phrase = $this->phraseslib->getPhrase($phrase_id);
@@ -71,7 +71,7 @@ class Phrases extends FHC_Controller
*/
public function deltext($phrasentext_id, $phrase_id)
{
if (empty($phrasentext_id) || empty($phrase_id))
if (!is_numeric($phrasentext_id) || !is_numeric($phrase_id))
show_error('Invalid phrasentext_id or phrase_id parameter');
$phrase_inhalt = $this->phraseslib->delPhrasentext($phrasentext_id);
@@ -86,7 +86,7 @@ class Phrases extends FHC_Controller
*/
public function edit($phrase_id = null)
{
if (empty($phrase_id)) return;
if (!is_numeric($phrase_id)) return;
$phrase = $this->phraseslib->getPhrase($phrase_id);
if ($phrase->error)