/**
  * Creates a new PackageUpdateAuthForm object.
  * 
  * @param	PackageUpdateAuthorizationRequiredException	$exception
  */
 public function __construct(PackageUpdateAuthorizationRequiredException $exception = null)
 {
     $this->exception = $exception;
     if ($this->exception !== null) {
         $this->packageUpdateServerID = $this->exception->getPackageUpdateServerID();
         $this->url = $this->exception->getURL();
         $this->header = $this->exception->getResponseHeader();
         // get message
         $this->message = $this->exception->getResponseContent();
         // find out response charset
         if (preg_match('/charset=([a-z0-9\\-]+)/i', $this->header, $match)) {
             $charset = strtoupper($match[1]);
             if ($charset != 'UTF-8') {
                 $this->message = @StringUtil::convertEncoding($charset, 'UTF-8', $this->message);
             }
         }
         // format message
         $this->message = nl2br(preg_replace("/\n{3,}/", "\n\n", StringUtil::unifyNewlines(StringUtil::trim(strip_tags($this->message)))));
     }
     parent::__construct();
 }