facebook / facebook/hhvm

xinclude doesn't handle encoded urls

Open
#4,972 0 comments 0 reactions 0 assignees View on GitHub
php5 incompatibility probably easy
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

In php, if you want to use an xinclude to a file containing whitespace you need to encode the filename/path using url encoding. So to include "test include.xml" one needs to use ``.
In hhvm this triggers an error (with and without encoding)

given:

> "test include.xml"
>
> ``` xml
>
>
> test include
>
> ```
>
> "main.xml"
>
> ``` xml
>
>
>
>
> ```

The script:

``` php
load(__DIR__ . '/main.xml');
$doc->xinclude();
echo $doc->saveXML();
```

produces with php

``` xml


test include

```

and a warning with hhvm (and the x:include doesn't get executed)

``` xml
I/O warning : failed to load external entity "/path/test+include.xml"
/path/main.xml:3: element include: XInclude error : could not load /path/test+include.xml, and no fallback was found

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.