Permalink
Browse files

Move call of evo_sendcookies() outside of headers_content_mightcache()

  • Loading branch information...
1 parent 88f797a commit 76e7e50d8a8939099b1d9c7ebdd217ae4a821b6e @yurabakhtin yurabakhtin committed Jul 20, 2016
View
@@ -51,6 +51,9 @@
add_js_for_toolbar(); // Registers all the javascripts needed by the toolbar menu
+// Send the predefined cookies:
+evo_sendcookies();
+
headers_content_mightcache( 'text/html' ); // In most situations, you do NOT want to cache dynamic content!
?>
<!DOCTYPE html>
@@ -27,6 +27,9 @@
if( $action == 'exit' )
{ // Display messages and exit
+ // Send the predefined cookies:
+ evo_sendcookies();
+
headers_content_mightcache( 'text/html', 0 ); // Do NOT cache!
require_css( 'basic.css', 'rsc_url' ); // Basic styles
@@ -158,6 +161,9 @@
// No action => display the form
+// Send the predefined cookies:
+evo_sendcookies();
+
headers_content_mightcache( 'text/html', 0 ); // Do NOT cache!
$b2evo_icons_type = 'fontawesome';
View
@@ -106,6 +106,9 @@
require_css( 'basic.css', 'rsc_url' ); // Basic styles
require_css( 'viewfile.css', 'rsc_url' );
+// Send the predefined cookies:
+evo_sendcookies();
+
headers_content_mightcache( 'text/html' ); // In most situations, you do NOT want to cache dynamic content!
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -2740,6 +2740,9 @@ function debug_die( $additional_info = '', $params = array() )
$additional_info = $params['debug_info'];
}
+ // Send the predefined cookies:
+ evo_sendcookies();
+
if( $is_api_request )
{ // REST API or XMLRPC request:
@@ -2892,6 +2895,9 @@ function bad_request_die( $additional_info = '' )
{
global $debug, $baseurl, $is_api_request;
+ // Send the predefined cookies:
+ evo_sendcookies();
+
if( $is_api_request )
{ // REST API or XMLRPC request:
@@ -5729,6 +5735,9 @@ function send_javascript_message( $methods = array(), $send_as_html = false, $ta
}
}
+ // Send the predefined cookies:
+ evo_sendcookies();
+
if( $send_as_html )
{ // we want to send as a html document
if( ! headers_sent() )
@@ -7209,6 +7218,11 @@ function evo_sendcookies()
{
global $evo_cookies;
+ if( headers_sent() )
+ { // Exit to avoid errors because headers already were sent:
+ return;
+ }
+
if( empty( $evo_cookies ) )
{ // No cookies:
return;
@@ -54,9 +54,6 @@ function headers_content_mightcache( $type = 'text/html', $max_age = '#', $chars
global $Messages, $is_admin_page;
global $PageCache, $Debuglog;
- // Send the predefined cookies:
- evo_sendcookies();
-
header_content_type( $type, $charset );
if( empty($max_age) || $is_admin_page || is_logged_in() || $Messages->count() )
@@ -297,6 +297,9 @@ private function add_response( $key, $value = NULL, $type = 'raw' )
*/
private function display_response()
{
+ // Send the predefined cookies:
+ evo_sendcookies();
+
// Set JSON content type:
headers_content_mightcache( 'application/json' );
@@ -1573,9 +1573,6 @@ function siteskin_init()
// Include the additional required files
siteskin_include( '_skin_init.inc.php' );
}
-
- // Send the predefined cookies:
- evo_sendcookies();
}
@@ -505,9 +505,6 @@ function disp_html_head()
global $adminskins_path;
- // Send the predefined cookies:
- evo_sendcookies();
-
if( isset( $this->skin_name ) && file_exists( $adminskins_path.$this->skin_name.'/_html_header.inc.php' ) )
{ // Get header of the skin
require $adminskins_path.$this->skin_name.'/_html_header.inc.php';
@@ -22,6 +22,9 @@
global $month, $month_abbrev, $weekday, $weekday_abbrev; /* for localized calendar */
global $debug, $Hit;
+// Send the predefined cookies:
+evo_sendcookies();
+
headers_content_mightcache( 'text/html', 0 ); // Make extra sure we don't cache the admin pages!
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -22,6 +22,9 @@
global $month, $month_abbrev, $weekday, $weekday_abbrev; /* for localized calendar */
global $debug, $Hit, $AdminUI;
+// Send the predefined cookies:
+evo_sendcookies();
+
headers_content_mightcache( 'text/html', 0 ); // Make extra sure we don't cache the admin pages!
?>
<!DOCTYPE html>
@@ -96,6 +96,9 @@
$login_form_params['formstart'] = str_replace( '$form_links$', '', $login_form_params['formstart'] );
}
+// Send the predefined cookies:
+evo_sendcookies();
+
headers_content_mightcache( 'text/html', 0 ); // NEVER cache the login pages!
$wrap_styles = array();

0 comments on commit 76e7e50

Please sign in to comment.