Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4613 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78869 invoked by uid 1010); 30 Sep 2003 11:50:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78825 invoked from network); 30 Sep 2003 11:50:53 -0000 Received: from unknown (HELO phoebe.host4u.net) (209.150.128.26) by pb1.pair.com with SMTP; 30 Sep 2003 11:50:53 -0000 Received: from ctdrob (dsta-aa203.pivot.net [66.186.171.203]) by phoebe.host4u.net (8.11.6/8.11.6) with SMTP id h8UBoqo09551 for ; Tue, 30 Sep 2003 06:50:52 -0500 Message-ID: <01c201c38749$46b7aa30$f7dea8c0@cyberware.local> To: Date: Tue, 30 Sep 2003 07:52:08 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01BF_01C38727.BF5C08E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: filepaths, uris, safemode, etc.. From: rrichards@ctindustries.net ("Rob Richards") ------=_NextPart_000_01BF_01C38727.BF5C08E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Within the dom extension, I am trying to resolve an issue with uris and = local filepaths which are passed to libxml. When I get the filepath, I need to resolve any local filepaths to an = absoulte path. On top of this the safemode checks need to be done before = passing any of these to libxml. So far I started with taking the user supplied source string and running = that through the safemode checks. If this passes, then the source is tested as follows: If uri, then it is passed to libxml, otherwise it gets passed through = expand_filepath and the resolved path is passed to libxml. It has been noted that file uris should not be passed in directly, but = go through the same path resolutions as local files and that the = following block of code be used instead of just using expand_filepath on = all non uri and file uri source strings: #ifdef VIRTUAL_DIR virtual_filepath_ex(source, &resolved_path, NULL TSRMLS_CC); #else resolved_path =3D source; #endif My problem is that if VIRTUAL_DIR is not defined, then the resolved path = ends up being the origional source supplied, which means that relative = paths are not resolved. Also, should the path resolutions be done before = the safemode checks? On top of this I am looking at allowing additional registered streams to = be used, so not sure if that would change any of this. What is the correct way to implement this? Thanks, Rob ------=_NextPart_000_01BF_01C38727.BF5C08E0--