From 2192ba1f52139fec86a3552dc66cd458ad42b3b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 18 Jul 2013 12:22:51 +0000 Subject: [PATCH] Use constants TRUE/FALSE/NULL instead of keywords true/false/null --- application/hub/exceptions.php | 10 +++++----- application/hub/main/dht/class_BaseDht.php | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/application/hub/exceptions.php b/application/hub/exceptions.php index ed80b25d5..a6ca43ce1 100644 --- a/application/hub/exceptions.php +++ b/application/hub/exceptions.php @@ -130,11 +130,11 @@ function __assertHandler ($file, $line, $code) { set_exception_handler('hub_exception_handler'); // Init assert handling -assert_options(ASSERT_ACTIVE, true); -assert_options(ASSERT_WARNING, false); -assert_options(ASSERT_BAIL, false); -assert_options(ASSERT_QUIET_EVAL, false); -assert_options(ASSERT_CALLBACK, '__assertHandler'); +assert_options(ASSERT_ACTIVE , TRUE); +assert_options(ASSERT_WARNING , FALSE); +assert_options(ASSERT_BAIL , TRUE); +assert_options(ASSERT_QUIET_EVAL, FALSE); +assert_options(ASSERT_CALLBACK , '__assertHandler'); // [EOF] ?> diff --git a/application/hub/main/dht/class_BaseDht.php b/application/hub/main/dht/class_BaseDht.php index 8ccf5b081..691f12035 100644 --- a/application/hub/main/dht/class_BaseDht.php +++ b/application/hub/main/dht/class_BaseDht.php @@ -108,6 +108,9 @@ abstract class BaseDht extends BaseHubSystem { // Get next node data from stack $nodeData = $this->getStackerInstance()->popNamed(self::STACKER_NAME_INSERT_NODE); + // Make sure $nodeData is really an array and has at least one entry + assert((is_array($nodeData)) && (count($nodeData) > 0)); + // Insert the data $this->insertDataIntoDht($nodeData); } -- 2.39.5