Re: [PHP] How to escape a local path so fopen() doesn't consider it a URL?

[email protected] (Adam Jon Richardson)
Newsgroups php.general
Message-ID <CAJzDObem611Pj7jKJEvfvr3TSCgm=QwY3Se+yZw8RMM7ivQEpQ@mail.gmail.com>
On Tue, Dec 20, 2016 at 2:06 AM, Adam Jon Richardson <[email protected]>
wrote:

> On Tue, Dec 20, 2016 at 1:58 AM, Jesse Schalken <[email protected]>
> wrote:
>>
>> If I have a local file path that happens to look like a URL (for example,
>> a
>> file called "data:foo"), what is the correct escaping or manipulation that
>> I have to do so that fopen() doesn't consider it a URL and it gets passed
>> verbatim to fopen() in C?
>>
>
> I believe you can use the backslash (\), as is noted in the documentation
> related to the use of Window's paths that utilize the backslash instead of
> the forward slash. That said, I also thought that the path had to begin
> with a valid scheme (e.g., "protocol://"), so I'm not sure "data:foo" would
> prove troublesome (but I didn't have time to test anything before hitting
> the hay.)
>

And, to clarify, I should have said, "I also thought that the path had to
begin a valid URL (in contrast to merely forming a URI, which doesn't have
to show the means of retrieval), ...

Tired, I am.

Adam
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.