Ejemplo n.º 1
0
 /**
  * Prints any header information for this output module
  *
  * @access	public
  * @return	@e void		Prints header() information
  */
 public function printHeader()
 {
     //-----------------------------------------
     // Start GZIP compression
     //-----------------------------------------
     if ($this->settings['disable_gzip'] != 1) {
         $buffer = "";
         if (count(ob_list_handlers())) {
             $buffer = ob_get_contents();
             ob_end_clean();
         }
         if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) and strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
             @ob_start('ob_gzhandler');
         } else {
             @ob_start();
         }
         print $buffer;
     }
     if (isset($_SERVER['SERVER_PROTOCOL']) and strstr($_SERVER['SERVER_PROTOCOL'], '/1.0')) {
         header("HTTP/1.0 " . $this->_headerCode . ' ' . $this->_headerStatus);
     } else {
         header("HTTP/1.1 " . $this->_headerCode . ' ' . $this->_headerStatus);
     }
     if ($this->settings['print_headers']) {
         /* Forcing a download? */
         if ($this->_forceDownload) {
             header("Content-type: unknown/unknown");
             header("Content-Disposition: attachment; filename=\"" . IPSText::alphanumericalClean(IPSText::transliterate(mb_strtolower($this->registry->output->getTitle()))) . ".html\"");
         } else {
             header("Content-type: text/html;charset=" . IPS_DOC_CHAR_SET);
         }
         if ($this->settings['nocache']) {
             $expires = $this->_headerExpire ? gmdate("D, d M Y H:i:s", time() + $this->_headerExpire) . " GMT" : gmdate("D, d M Y H:i:s", time() - 86400) . " GMT";
             $maxAge = $this->_headerExpire;
             $nocache = !$this->_headerExpire ? 'no-cache, ' : '';
             header("Cache-Control:  " . $nocache . "must-revalidate, max-age=" . $maxAge);
             header("Expires: " . $expires);
             if (!$this->_headerExpire) {
                 header("Pragma: no-cache");
             }
         }
     }
 }