Update of /cvsroot/phpmp/phpMP/includes
In directory sc8-pr-cvs1:/tmp/cvs-serv26596/includes
Modified Files:
config.init.php template.php user.php
Log Message:
Began work on the module interface. Made some improvements to my (rather crappy) regex implementation.
Index: config.init.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/config.init.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** config.init.php 17 May 2003 07:43:41 -0000 1.3
--- config.init.php 19 May 2003 23:39:59 -0000 1.4
***************
*** 43,49 ****
function set($cfgkey, $cfgval)
{
! if( (!empty($cfgkey)) && (eregi('^[a-z]+[_a-z0-9-]*$', $cfgkey)) && (!empty($cfgval)) )
{
! $this->_cfgvars[strtolower($cfgkey)] = $cfgval;
return true;
}
--- 43,49 ----
function set($cfgkey, $cfgval)
{
! if( (!empty($cfgkey)) && (preg_match('/[^a-z][a-z0-9_-]/', $cfgkey)) && (!empty($cfgval)) )
{
! $this->_cfgvars[$cfgkey] = $cfgval;
return true;
}
***************
*** 56,62 ****
function get($cfgkey)
{
! if( !empty($this->_cfgvars[strtolower($cfgkey)]) )
{
! return $this->_cfgvars[strtolower($cfgkey)];
}
else
--- 56,62 ----
function get($cfgkey)
{
! if( !empty($this->_cfgvars[$cfgkey]) )
{
! return $this->_cfgvars[$cfgkey];
}
else
Index: template.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** template.php 17 May 2003 07:56:05 -0000 1.33
--- template.php 19 May 2003 23:39:59 -0000 1.34
***************
*** 87,91 ****
foreach( $new_tpl_var as $key => $val )
{
! if(eregi('^[a-z]+[_a-z0-9-]*$', $key))
{
$this->_tplvars[$key] = $val;
--- 87,91 ----
foreach( $new_tpl_var as $key => $val )
{
! if(preg_match('/[^A-z][A-z0-9_-]/', $key))
{
$this->_tplvars[$key] = $val;
***************
*** 94,98 ****
}
}
! elseif((!empty( $new_tpl_var )) && (eregi('^[a-z]+[_a-z0-9-]*$', $new_tpl_var)) && ($new_tpl_val != false))
{
// Assign one single var to the template vars hash.
--- 94,98 ----
}
}
! elseif((!empty( $new_tpl_var )) && (preg_match('/[^A-z][A-z0-9_-]/', $new_tpl_var)) && ($new_tpl_val != false))
{
// Assign one single var to the template vars hash.
Index: user.php
===================================================================
RCS file: /cvsroot/phpmp/phpMP/includes/user.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** user.php 17 May 2003 07:50:17 -0000 1.21
--- user.php 19 May 2003 23:39:59 -0000 1.22
***************
*** 34,46 ****
foreach( $userkey as $key => $val )
{
! if(eregi('^[a-z]+[_a-z0-9-]*$', $key))
{
! $this->_data[strtolower($key)] = $val;
}
}
}
! elseif( (!empty($userkey)) && (eregi('^[a-z]+[_a-z0-9-]*$', $userkey)) && (!empty($userval)) )
{
! $this->_data[strtolower($userkey)] = $userval;
return true;
}
--- 34,46 ----
foreach( $userkey as $key => $val )
{
! if(preg_match('/[^a-z][a-z0-9_-]/', $key))
{
! $this->_data[$key] = $val;
}
}
}
! elseif( (!empty($userkey)) && (preg_match('/[^a-z][a-z0-9_-]/', $userkey)) && (!empty($userval)) )
{
! $this->_data[$userkey] = $userval;
return true;
}
***************
*** 53,59 ****
function get($userkey)
{
! if( !empty($this->_data[strtolower($userkey)]) )
{
! return $this->_data[strtolower($userkey)];
}
else
--- 53,59 ----
function get($userkey)
{
! if( !empty($this->_data[$userkey]) )
{
! return $this->_data[$userkey];
}
else
|