diff --git a/bureau/class/db_mysql.php b/bureau/class/db_mysql.php index 9ec79968..e6b59d42 100644 --- a/bureau/class/db_mysql.php +++ b/bureau/class/db_mysql.php @@ -178,7 +178,8 @@ class DB_Sql { } if( defined("THROW_EXCEPTIONS") && THROW_EXCEPTIONS ){ - throw new \Exception("Mysql query failed : $this->Error"); + $error_msg=$this->Error[2]; + throw new \Exception("Mysql query failed : $error_msg"); } $this->halt("SQL Error: ".$Query_String); return FALSE; diff --git a/bureau/class/m_action.php b/bureau/class/m_action.php index 27351686..d78fb62e 100644 --- a/bureau/class/m_action.php +++ b/bureau/class/m_action.php @@ -325,7 +325,7 @@ class m_action { */ function reset_job($id) { global $db, $msg; - if (!$db->query("update actions set end=0,begin=0,status='' where id= ?;", array($id))) { + if (!$db->query("update actions set end=0,begin=0,status=0 where id= ?;", array($id))) { $msg->raise("ERROR", "action", _("Error unlocking the action : $id")); return false; } diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 79c9e68b..578729ae 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -944,7 +944,7 @@ class m_dom { $out=array(); exec("dig +short NS ".escapeshellarg($parent),$out); $loopmax--; - } while (!count($out) && $loopmax); // will stop when : we have no parent, or + } while (!count($out) && $loopmax && strpos($parent, '.')); if (!count($out)) { return false; // bad exit of the loop } diff --git a/phpunit/tests/_datasets/actions-began.yml b/phpunit/tests/_datasets/actions-began.yml index 8a3f5310..46ac0ce1 100644 --- a/phpunit/tests/_datasets/actions-began.yml +++ b/phpunit/tests/_datasets/actions-began.yml @@ -1,10 +1,10 @@ actions: - id: 999 - type: "file" + type: CREATE_FILE parameters: "phpunit" creation: "2000-01-01 00:00:00" begin: "2020-12-31 23:59:58" end: "2020-12-31 23:59:59" user: "phpunit" - status: 0 \ No newline at end of file + status: 0 diff --git a/phpunit/tests/_datasets/actions-purgeable.yml b/phpunit/tests/_datasets/actions-purgeable.yml index b0f79635..2d993b36 100644 --- a/phpunit/tests/_datasets/actions-purgeable.yml +++ b/phpunit/tests/_datasets/actions-purgeable.yml @@ -1,10 +1,10 @@ actions: - id: 999 - type: "file" + type: CREATE_FILE parameters: "phpunit" creation: "2000-01-01 00:00:00" begin: "0000-00-00 00:00:00" end: "0000-00-00 00:00:00" user: "phpunit" - status: 0 \ No newline at end of file + status: 0 diff --git a/phpunit/tests/_datasets/actions-ready.yml b/phpunit/tests/_datasets/actions-ready.yml index d7d8ac34..3c6a87bd 100644 --- a/phpunit/tests/_datasets/actions-ready.yml +++ b/phpunit/tests/_datasets/actions-ready.yml @@ -1,10 +1,10 @@ actions: - id: 999 - type: "file" + type: CREATE_FILE parameters: "phpunit" creation: "2000-01-01 00:00:00" begin: "2020-12-31 23:59:58" end: "0000-00-00 00:00:00" user: "phpunit" - status: 0 \ No newline at end of file + status: 0 diff --git a/phpunit/tests/bureau/class/m_domTest.php b/phpunit/tests/bureau/class/m_domTest.php index aec95d38..0941f705 100644 --- a/phpunit/tests/bureau/class/m_domTest.php +++ b/phpunit/tests/bureau/class/m_domTest.php @@ -350,6 +350,7 @@ class m_domTest extends TestCase { // Remove the following lines when you implement this test. $ns = $this->object->whois('alternc.org'); + sort($ns); $expected_ns = array( 'primary.heberge.info', 'secondary.heberge.info',