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;