[Phplib-users] Windows absolute paths & template.inc
Brought to you by:
nhruby,
richardarcher
|
From: Mike G. <mi...@op...> - 2002-05-10 12:54:25
|
Hello,
A Back-End user suggested the following work around for Windows absolute
path names. I can't test this myself very easily (mostly because I try
not to work in Windows and don't have things set up for it) and wanted
to pass it along to the phplib team for consideration.
Mike
-----Forwarded Message-----
comments = Hi,
Maybe i found a little bug in the template.inc script.
There is no check for Windows absolute pathnames, eg c:\....
This workaround helps:
function filename($filename) {
// Check for Windows (c:/...) and UNIX relativ pathnames
if ( (substr($filename, 1, 1) != ':') and (substr($filename, 0, 1) != "/") ) {
$filename = $this->root . "/" . $filename;
}
if (!file_exists($filename)) {
$this->halt("filename: file $filename does not exist.");
}
return $filename;
}
--
Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca
Open Source Web Applications for Social Change
New Site Launched: http://www.patmartin.org/
War is a poor chisel to carve out tomorrows. ML King, Jr.
|