mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
libxml-2.9.2 compatibility
This commit is contained in:
parent
2ac31872ac
commit
af2b066911
1 changed files with 15 additions and 0 deletions
|
@ -306,6 +306,21 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
|
||||||
(xmlStrncmp(BAD_CAST uri->scheme, BAD_CAST "file", 4) == 0))) {
|
(xmlStrncmp(BAD_CAST uri->scheme, BAD_CAST "file", 4) == 0))) {
|
||||||
resolved_path = xmlURIUnescapeString(filename, 0, NULL);
|
resolved_path = xmlURIUnescapeString(filename, 0, NULL);
|
||||||
isescaped = 1;
|
isescaped = 1;
|
||||||
|
#if LIBXML_VERSION >= 20902 && defined(PHP_WIN32)
|
||||||
|
/* Libxml 2.9.2 prefixes local paths with file:/ instead of file://,
|
||||||
|
thus the php stream wrapper will fail on a valid case. For this
|
||||||
|
reason the prefix is rather better cut off. */
|
||||||
|
{
|
||||||
|
size_t pre_len = sizeof("file:/") - 1;
|
||||||
|
|
||||||
|
if (strncasecmp(resolved_path, "file:/", pre_len) == 0
|
||||||
|
&& '/' != resolved_path[pre_len]) {
|
||||||
|
xmlChar *tmp = xmlStrdup(resolved_path + pre_len);
|
||||||
|
xmlFree(resolved_path);
|
||||||
|
resolved_path = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
resolved_path = (char *)filename;
|
resolved_path = (char *)filename;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue