[Cs-content-commits] SF.net SVN: cs-content:[477] trunk/1.0
PHP Templating & Includes System
Brought to you by:
crazedsanity
From: <cra...@us...> - 2010-07-07 15:06:03
|
Revision: 477 http://cs-content.svn.sourceforge.net/cs-content/?rev=477&view=rev Author: crazedsanity Date: 2010-07-07 15:05:57 +0000 (Wed, 07 Jul 2010) Log Message: ----------- Fix warnings & deprecated function usages. /contentSystem.class.php: * __construct(): -- replace ereg_replace() with preg_replace() -- use explode() instead of split(). * parse_section(): -- use explode() instead of split() * clean_url(): -- use preg_match() instead of ereg() -- use explode() instead of split() /cs_session.class.php: * get_cookie(): -- use isset() on $_COOKIE **and* $_COOKIE[$name] (avoids PHP notices/warnings. Modified Paths: -------------- trunk/1.0/contentSystem.class.php trunk/1.0/cs_session.class.php Modified: trunk/1.0/contentSystem.class.php =================================================================== --- trunk/1.0/contentSystem.class.php 2010-05-26 17:47:04 UTC (rev 476) +++ trunk/1.0/contentSystem.class.php 2010-07-07 15:05:57 UTC (rev 477) @@ -104,11 +104,11 @@ //setup the section stuff... $repArr = array($_SERVER['SCRIPT_NAME'], "/"); - $_SERVER['REQUEST_URI'] = ereg_replace('^/', "", $_SERVER['REQUEST_URI']); + $_SERVER['REQUEST_URI'] = preg_replace('/^\//', "", $_SERVER['REQUEST_URI']); //figure out the section & subsection stuff. $requestUri = preg_replace('/\/$/', '', $_SERVER['REQUEST_URI']); - $this->fullSectionArr = split('/', $requestUri); //TODO: will this cope with an APPURL being set? + $this->fullSectionArr = explode('/', $requestUri); //TODO: will this cope with an APPURL being set? $this->section = $this->clean_url($_SERVER['REQUEST_URI']); $this->initialize_locals($siteRoot); @@ -298,7 +298,7 @@ if(($this->section === 0 || is_null($this->section) || !strlen($this->section)) && defined('DEFAULT_SECTION')) { $this->section = preg_replace('/^\//', '', constant('DEFAULT_SECTION')); } - $myArr = split('/', $this->section); + $myArr = explode('/', $this->section); //if we've got something in the array, keep going. if(is_array($myArr) && count($myArr) > 0) { @@ -357,13 +357,13 @@ $section = $section[0]; } - if(ereg("\.", $section)) { + if(preg_match("/\./", $section)) { //disregard file extensions, but keep everything else... // i.e. "index.php/yermom.html" becomes "index/yermom" - $tArr = split('/', $section); + $tArr = explode('/', $section); $tSection = null; foreach($tArr as $tSecName) { - $temp = split("\.", $tSecName); + $temp = explode(".", $tSecName); if(strlen($temp[0]) > 1) { $tSecName = $temp[0]; } Modified: trunk/1.0/cs_session.class.php =================================================================== --- trunk/1.0/cs_session.class.php 2010-05-26 17:47:04 UTC (rev 476) +++ trunk/1.0/cs_session.class.php 2010-07-07 15:05:57 UTC (rev 477) @@ -76,7 +76,7 @@ */ public function get_cookie($name) { $retval = NULL; - if(isset($_COOKIE) && $_COOKIE[$name]) { + if(isset($_COOKIE) && isset($_COOKIE[$name])) { $retval = $_COOKIE[$name]; } return($retval); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |