fixed problem with hashbang crawling, set expire headers correctly
This commit is contained in:
parent
10fd286b53
commit
ede84e2cb8
@ -53,7 +53,7 @@ abstract class api_default extends api_system implements api_default_interface {
|
||||
public static function static__escaped_fragment_($_escaped_fragment_){
|
||||
\libxml_use_internal_errors(true);
|
||||
$html = new \DOMDocument();
|
||||
$html->loadHTML(static::default_page($_escaped_fragment_ ? $_escaped_fragment_ : true));
|
||||
$html->loadHTML(static::default_page($_escaped_fragment_ ? $_escaped_fragment_ : true),LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
||||
if($error = \libxml_get_last_error()){
|
||||
//new \SYSTEM\LOG\ERROR('Parse Error: '.$error->message.' line:'.$error->line.' html: '.$html->saveHTML());
|
||||
\libxml_clear_errors();}
|
||||
@ -63,7 +63,7 @@ abstract class api_default extends api_system implements api_default_interface {
|
||||
parse_str(\parse_url($row['url'],PHP_URL_QUERY), $params);
|
||||
$class = static::get_class();
|
||||
if($class){
|
||||
$frag->loadHTML(mb_convert_encoding(\SYSTEM\API\api::run('\SYSTEM\API\verify', $class, $params, static::get_apigroup(), true, false),'HTML-ENTITIES', 'UTF-8'));
|
||||
$frag->loadHTML(mb_convert_encoding(\SYSTEM\API\api::run('\SYSTEM\API\verify', $class, $params, static::get_apigroup(), true, false),'HTML-ENTITIES', 'UTF-8'),LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
||||
if($error = \libxml_get_last_error()){
|
||||
//new \SYSTEM\LOG\ERROR('Parse Error: '.$error->message.' line:'.$error->line.' html: '.$frag->saveHTML());
|
||||
\libxml_clear_errors();}
|
||||
@ -71,7 +71,7 @@ abstract class api_default extends api_system implements api_default_interface {
|
||||
//Load subpage css
|
||||
foreach($row['css'] as $css){
|
||||
$css_frag = new \DOMDocument();
|
||||
$css_frag->loadHTML('<link href="'.$css.'" rel="stylesheet" type="text/css">');
|
||||
$css_frag->loadHTML('<link href="'.$css.'" rel="stylesheet" type="text/css">',LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
||||
$html->getElementsByTagName('head')[0]->appendChild($html->importNode($css_frag->documentElement,true));
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,6 +56,7 @@ class files {
|
||||
call_user_func('\SYSTEM\HEADER::'.$ext);
|
||||
}else{
|
||||
\SYSTEM\HEADER::FILE($id);}
|
||||
\session_cache_limiter('private_no_expire');
|
||||
header("Last-Modified: " . gmdate('D, d M Y H:i:s \G\M\T', filemtime(self::$folders[$cat].$id)));
|
||||
|
||||
//Allow Caching for all files
|
||||
|
||||
@ -356,6 +356,7 @@ class security {
|
||||
*/
|
||||
protected static function startSession(){
|
||||
if(!isset($_SESSION) && !headers_sent()){
|
||||
//\session_cache_limiter('private_no_expire');
|
||||
\session_start();}
|
||||
//respect locale from db if not set(right place here?)
|
||||
if( isset($_SESSION[\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)]) &&
|
||||
|
||||
@ -56,7 +56,7 @@ class HEADER {
|
||||
*/
|
||||
public static function PNG(){
|
||||
if(self::checkHeader()){
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
//header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7*4*52))); // 1 week
|
||||
header('content-type:image/png');}}
|
||||
/**
|
||||
* Send JPG Headers, if Header was not sent yet
|
||||
@ -65,7 +65,7 @@ class HEADER {
|
||||
*/
|
||||
public static function JPG(){
|
||||
if(self::checkHeader()){
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
//header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
header('content-type:image/jpeg');}}
|
||||
/**
|
||||
* Send JPEG Headers, if Header was not sent yet
|
||||
@ -74,7 +74,7 @@ class HEADER {
|
||||
*/
|
||||
public static function JPEG(){
|
||||
if(self::checkHeader()){
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
//header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
header('content-type:image/jpeg');}}
|
||||
/**
|
||||
* Send GIF Headers, if Header was not sent yet
|
||||
@ -83,7 +83,7 @@ class HEADER {
|
||||
*/
|
||||
public static function GIF(){
|
||||
if(self::checkHeader()){
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
//header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
header('content-type:image/gif');}}
|
||||
/**
|
||||
* Send JS Headers, if Header was not sent yet
|
||||
@ -92,7 +92,7 @@ class HEADER {
|
||||
*/
|
||||
public static function JS(){
|
||||
if(self::checkHeader()){
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
//header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
header('content-type:application/javascript');}}
|
||||
/**
|
||||
* Send CSS Headers, if Header was not sent yet
|
||||
@ -101,7 +101,7 @@ class HEADER {
|
||||
*/
|
||||
public static function CSS(){
|
||||
if(self::checkHeader()){
|
||||
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
//header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 7))); // 1 week
|
||||
header('content-type:text/css');}}
|
||||
/**
|
||||
* Send LESS Headers, if Header was not sent yet
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user