Skip to content
Browse files

MDL-21638 cookieless session id not passed when loading images - need…

…ed for example for graphs which access session data
  • Loading branch information...
1 parent 72336b7 commit 62236dd1b11cee68867632a7b7b5a0b32e1fa4eb @jamiepratt jamiepratt committed Feb 17, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/cookieless.php
View
10 lib/cookieless.php
@@ -22,8 +22,8 @@
*/
function sid_ob_rewrite($buffer){
$replacements = array(
- '/(<\s*(a|link|script|frame|area)\s[^>]*(href|src)\s*=\s*")([^"]*)(")/i',
- '/(<\s*(a|link|script|frame|area)\s[^>]*(href|src)\s*=\s*\')([^\']*)(\')/i');
+ '/(<\s*(a|link|script|frame|area|img)\s[^>]*(href|src)\s*=\s*")([^"]*)(")/i',
+ '/(<\s*(a|link|script|frame|area|img)\s[^>]*(href|src)\s*=\s*\')([^\']*)(\')/i');
$buffer = preg_replace_callback($replacements, "sid_rewrite_link_tag", $buffer);
$buffer = preg_replace('/<form\s[^>]*>/i',
@@ -42,8 +42,8 @@ function sid_ob_rewrite($buffer){
*/
function sid_ob_rewrite_absolute($buffer){
$replacements = array(
- '/(<\s*(a|link|script|frame|area)\s[^>]*(href|src)\s*=\s*")((?:http|https)[^"]*)(")/i',
- '/(<\s*(a|link|script|frame|area)\s[^>]*(href|src)\s*=\s*\')((?:http|https)[^\']*)(\')/i');
+ '/(<\s*(a|link|script|frame|area|img)\s[^>]*(href|src)\s*=\s*")((?:http|https)[^"]*)(")/i',
+ '/(<\s*(a|link|script|frame|area|img)\s[^>]*(href|src)\s*=\s*\')((?:http|https)[^\']*)(\')/i');
$buffer = preg_replace_callback($replacements, "sid_rewrite_link_tag", $buffer);
$buffer = preg_replace('/<form\s[^>]*>/i',
@@ -133,7 +133,7 @@ function sid_start_ob(){
@ini_set('session.use_trans_sid', '1'); // try and turn on trans_sid
if (ini_get('session.use_trans_sid')!=0 ){
// use trans sid as its available
- ini_set('url_rewriter.tags', 'a=href,area=href,script=src,link=href,'
+ ini_set('url_rewriter.tags', 'a=href,img=src,area=href,script=src,link=href,'
. 'frame=src,form=fakeentry');
ob_start('sid_ob_rewrite_absolute');
}else{

0 comments on commit 62236dd

Please sign in to comment.
Something went wrong with that request. Please try again.