note 70463 added to function.require

From: Date: Tue, 17 Oct 2006 20:06:56 +0000
Subject: note 70463 added to function.require
Groups: php.notes 
Request: Send a blank email to php-notes+get-118665@lists.php.net to get a copy of this message
// Looks like I might have a fix for some on the // relative path issue. if (!function_exists('bugFixRequirePath')) { function bugFixRequirePath($newPath) { $stringPath = dirname(__FILE__); if (strstr($stringPath,":")) $stringExplode = "\\"; else $stringExplode = "/"; $paths = explode($stringExplode,$stringPath); $newPaths = explode("/",$newPath); if (count($newPaths) > 0) { for($i=0;$i<count($newPaths);$i++) { if ($newPaths[$i] == "..") array_pop($paths); } for($i=0;$i<count($newPaths);$i++) { if ($newPaths[$i] == "..") unset($newPaths[$i]); } reset($newPaths); $stringNewPath = implode($stringExplode,$paths). $stringExplode.implode($stringExplode,$newPaths); return $stringNewPath; } } } require_once(bugFixRequirePath("../config.php")); ---- Server IP: 66.163.161.117 Probable Submitter: 70.244.68.130 ---- Manual Page -- http://www.php.net/manual/en/function.require.php Edit -- https://master.php.net/note/edit/70463 Del: integrated -- https://master.php.net/note/delete/70463/integrated Del: useless -- https://master.php.net/note/delete/70463/useless Del: bad code -- https://master.php.net/note/delete/70463/bad+code Del: spam -- https://master.php.net/note/delete/70463/spam Del: non-english -- https://master.php.net/note/delete/70463/non-english Del: in docs -- https://master.php.net/note/delete/70463/in+docs Del: other reasons-- https://master.php.net/note/delete/70463 Reject -- https://master.php.net/note/reject/70463 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#118665) next »