From d82472b4e91b356165eb4cd647d9e7ed7019aefe Mon Sep 17 00:00:00 2001 From: pBlueG Date: Sun, 27 Apr 2014 13:39:51 +0200 Subject: [PATCH] command registry fix --- classes/commandhandler.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/classes/commandhandler.class.php b/classes/commandhandler.class.php index 81884ec..fcc5292 100644 --- a/classes/commandhandler.class.php +++ b/classes/commandhandler.class.php @@ -284,16 +284,15 @@ public function _registerCommand($sCommand, $sCode, $privilege, $description = N $iPermission = $aPrivileges[$privilege]; } else $iPermission = $privilege; + $finalCode = str_replace(array("\r", "\n", "\t"), "", $sCode); $this->m_aCommands[] = array( 'command' => $sCommand, - 'code' => $sCode, + 'code' => $finalCode, 'description' => $description, 'privilege' => $iPermission ); - if($save_to_db) { - $sCode = str_replace(array("\r", "\n", "\t"), '', $sCode); + if($save_to_db) Database::getInstance()->_insert($this->m_sTable, end($this->m_aCommands)); - } return true; } return false;