public function getResponse() { $msg = $this->result(); $msg = ltrim($msg, 'OK'); $msg = ltrim($msg, 'ERROR:'); $msg = trim($msg); if (empty($msg)) { return null; } if (!Helper::starts_with($msg, '<') && !Helper::ends_with($msg, '/>')) { return new Response('<IDP result="' . ($this->hasError() ? 7007 : 0) . '" message="' . htmlentities($msg) . '"/>'); } else { return new Response($msg); } }