Date: 05/30/01
- Next message: max: "[phplib-dev] cvs commit"
- Previous message: uw: "[phplib-dev] cvs commit"
- Next in thread: max: "[phplib-dev] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: max
Date: Wed May 30 10:37:44 2001
Modified files:
php-lib/php/session/session4.inc
Log message:
Changed trans_sid_enabled to trans_id_enabled in url().
Added checks for trans_id_enabled in hidden_session() and hidden_id().
Made some code for the first international PHP obfuscated code contest :)
Index: php-lib/php/session/session4.inc
diff -u php-lib/php/session/session4.inc:1.6 php-lib/php/session/session4.inc:1.7
--- php-lib/php/session/session4.inc:1.6 Tue May 29 17:14:58 2001
+++ php-lib/php/session/session4.inc Wed May 30 10:37:13 2001
@@ -7,7 +7,7 @@
* <email protected> 1998,1999 NetUSE AG, Boris Erdmann, Kristian Koehntopp
* 2000 Teodor Cimpoesu <teo <email protected>>
* <email protected> Teodor Cimpoesu <teo <email protected>>, Ulf Wendel <uw <email protected>>
-* <email protected> $Id: session4.inc,v 1.6 2001/05/29 15:14:58 uw Exp $
+* <email protected> $Id: session4.inc,v 1.7 2001/05/30 08:37:13 max Exp $
* <email protected> public
* <email protected> PHPLib
*/
@@ -148,7 +148,7 @@
/**
* <email protected> id()
- * <email protected> $Id: session4.inc,v 1.6 2001/05/29 15:14:58 uw Exp $
+ * <email protected> $Id: session4.inc,v 1.7 2001/05/30 08:37:13 max Exp $
* <email protected> public
*/
function get_id($sid = '') {
@@ -208,7 +208,7 @@
* doesn't seem to do (looking @ the session.c:940)
* uw: yes we should keep it to remain the same interface, but deprec.
*
- * <email protected> $Id: session4.inc,v 1.6 2001/05/29 15:14:58 uw Exp $
+ * <email protected> $Id: session4.inc,v 1.7 2001/05/30 08:37:13 max Exp $
* <email protected> public
* <email protected> $HTTP_COOKIE_VARS
*/
@@ -250,13 +250,13 @@
* <email protected> string rewritten url with session id included
* <email protected> $trans_id_enabled
* <email protected> $HTTP_COOKIE_VARS
- * <email protected> $Id: session4.inc,v 1.6 2001/05/29 15:14:58 uw Exp $
+ * <email protected> $Id: session4.inc,v 1.7 2001/05/30 08:37:13 max Exp $
* <email protected> public
*/
function url ($url) {
global $HTTP_COOKIE_VARS;
- if ($this->trans_sid_enabled)
+ if ($this->trans_id_enabled)
return $url;
$url = preg_replace("[&?]+$", "", $url);
@@ -269,24 +269,24 @@
return $url;
/*
+ Ulf:
Maxim, can you merge it? You're code looks more
sophisticated. I'll also vote for you on the first
international PHP obfuscated code contest if you can
add some bit operations and format the code like a "M" for
Maxim.
+ Maxim:
+ how about this? :)
+
+ $url .=(
+ strpos ( $url,
+ '?' ) ) ? chr (
+ ord ( '&') & ord ( '?'
+ ) ) : chr ( ord ( '&' )
+ | ord ( '?')) .urlencode (
+ $this->name). "=" .$this->id ;
- (strrpos ($url, '?') == false) && ($url .= '?');
- $sin = session_name();
- $sid = session_id();
- $_url = '';
-
- # How about?
- # (!strstr ((strrpos ($url, '?') == false) && ($url .= '?'), $this->name) and $_url = preg_replace ('/\?(.*)$/',"?{$this->name}={$this->id}&\\1", $url) ) or ( $_url = preg_replace ("/({$this->name}=[^&]+&|{$this->name}=[^&]+$)/","{$this->name}={$this->id}&",$url));
- #
- (!strstr ($url, $sin) and $_url = preg_replace ('/\?(.*)$/',"?$sin=$sid&\\1",$url) ) or ( $_url = preg_replace ("/($sin=[^&]+&|$sin=[^&]+$)/","$sin=$sid&",$url));
-
- return $_url;
*/
} // end func url
@@ -344,6 +344,9 @@
* <email protected> void
*/
function hidden_session() {
+ if ($this->trans_id_enabled)
+ return;
+
print $this->get_hidden_session();
} // end func hidden_session
@@ -360,6 +363,9 @@
* <email protected> hidden_session
*/
function hidden_id() {
+ if ($this->trans_id_enabled)
+ return;
+
print $this->get_hidden_session();
} // end func hidden_id
@@ -456,4 +462,4 @@
} // end func session
-?>
\ No newline at end of file
+?>
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>
- Next message: max: "[phplib-dev] cvs commit"
- Previous message: uw: "[phplib-dev] cvs commit"
- Next in thread: max: "[phplib-dev] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

