all repos — wp-ffpc @ cdd4f4e6c6ed08d52b5047eb45eb74f0d77eec08

added PHPSESSID cookie to uri key possibilities
Peter Molnar hello@petermolnar.eu
Mon, 17 Jun 2013 14:22:46 +0100
commit

cdd4f4e6c6ed08d52b5047eb45eb74f0d77eec08

parent

23ee5f0109e2e68e4d875ba889fb80672619f5e2

3 files changed, 12 insertions(+), 4 deletions(-)

jump to
M wp-ffpc-acache.phpwp-ffpc-acache.php

@@ -141,7 +141,7 @@

/*** SERVING CACHED PAGE ***/ /* if we reach this point it means data was found & correct, serve it */ -header('Content-Type: ' . $wp_ffpc_values['meta']['mime']); +if ( isset( $wp_ffpc_values['meta']['mime'] )) header('Content-Type: ' . $wp_ffpc_values['meta']['mime']); /* don't allow browser caching of page */ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0');
M wp-ffpc-backend.phpwp-ffpc-backend.php

@@ -62,11 +62,17 @@ $this->cookies = array ( 'comment_author_' , 'wordpressuser_' , 'wp-postpass_', 'wordpress_logged_in_' );

$this->utilities = WP_Plugins_Utilities_v1::Utility(); + $ruser = isset ( $_SERVER['REMOTE_USER'] ) ? $_SERVER['REMOTE_USER'] : ''; + $ruri = isset ( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : ''; + $rhost = isset ( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : ''; + $scookie = isset ( $_COOKIE['PHPSESSID'] ) ? $_COOKIE['PHPSESSID'] : ''; + $this->urimap = array( '$scheme' => str_replace ( '://', '', $this->utilities->replace_if_ssl ( 'http://' ) ), - '$host' => $_SERVER['HTTP_HOST'], - '$request_uri' => $_SERVER['REQUEST_URI'], - '$remote_user' => $_SERVER['REMOTE_USER'], + '$host' => $rhost, + '$request_uri' => $ruri, + '$remote_user' => $ruser, + '$cookie_PHPSESSID' => $scookie, ); /* no config, nothing is going to work */

@@ -82,6 +88,7 @@ $init = $this->proxy( 'init' );

$this->log ( __translate__('init starting', $this->plugin_constant )); $this->$init(); + } /*********************** PUBLIC FUNCTIONS ***********************/
M wp-ffpc-class.phpwp-ffpc-class.php

@@ -134,6 +134,7 @@ '$scheme' => __('The HTTP scheme (i.e. http, https).', $this->plugin_constant ),

'$host' => __('Host in the header of request or name of the server processing the request if the Host header is not available.', $this->plugin_constant ), '$request_uri' => __('The *original* request URI as received from the client including the args', $this->plugin_constant ), '$remote_user' => __('Name of user, authenticated by the Auth Basic Module', $this->plugin_constant ), + '$cookie_PHPSESSID' => __('PHP Session Cookie ID, if set ( empty if not )', $this->plugin_constant ), //'$cookie_COOKnginy IE' => __('Value of COOKIE', $this->plugin_constant ), //'$http_HEADER' => __('Value of HTTP request header HEADER ( lowercase, dashes converted to underscore )', $this->plugin_constant ), //'$query_string' => __('Full request URI after rewrites', $this->plugin_constant ),