Update of /cvsroot/phpwebapp/web_app/session
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25213/session
Modified Files:
class.Session.php
Log Message:
Index: class.Session.php
===================================================================
RCS file: /cvsroot/phpwebapp/web_app/session/class.Session.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** class.Session.php 20 Sep 2004 13:28:06 -0000 1.12
--- class.Session.php 30 Jun 2005 06:24:43 -0000 1.13
***************
*** 144,170 ****
while (list($var_name,$var_value) = each($arrVars))
{
! $var_value = $this->js_decode($var_value);
$this->addVar($var_name, $var_value);
}
}
- function js_decode($str)
- {
- $str = str_replace("\\\\", "\\", $str);
- $str = str_replace('\"', '"', $str);
- $str = str_replace("\'", "'", $str);
- $str = str_replace('\n', "\n", $str);
- return $str;
- }
-
- /** Replace some chars that are bad for JS code. */
- function js_encode($str)
- {
- $str = str_replace("\\", "\\\\", $str);
- $str = str_replace("\n", '\n', $str);
- $str = str_replace("'", "\\'", $str);
- return $str;
- }
-
/** Get dbVars from DB. Requires the table session(id,vars) in DB. */
function getDBVars()
--- 144,152 ----
while (list($var_name,$var_value) = each($arrVars))
{
! $var_value = WebApp::js_decode($var_value);
$this->addVar($var_name, $var_value);
}
}
/** Get dbVars from DB. Requires the table session(id,vars) in DB. */
function getDBVars()
***************
*** 296,300 ****
while (list($var_name,$var_value) = each($this->Vars))
{
! $var_value = $this->js_encode($var_value);
$session_vars .= " session.addVar('$var_name','$var_value');\n";
}
--- 278,282 ----
while (list($var_name,$var_value) = each($this->Vars))
{
! $var_value = WebApp::js_encode($var_value);
$session_vars .= " session.addVar('$var_name','$var_value');\n";
}
|