static int php_plain_files_url_stater(php_stream_wrapper *wrapper, char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
{
+ char *p;
- if (strncmp(url, "file://", sizeof("file://") - 1) == 0) {
- url += sizeof("file://") - 1;
+ if ((p = strstr(url, "://")) != NULL) {
+ if (p < strchr(url, '/')) {
+ url = p + 3;
+ }
}
if (php_check_open_basedir_ex(url, (flags & PHP_STREAM_URL_STAT_QUIET) ? 0 : 1 TSRMLS_CC)) {
int ret;
if ((p = strstr(url, "://")) != NULL) {
- url = p + 3;
+ if (p < strchr(url, '/')) {
+ url = p + 3;
+ }
}
if (php_check_open_basedir(url TSRMLS_CC)) {
#endif
if ((p = strstr(url_from, "://")) != NULL) {
- url_from = p + 3;
+ if (p < strchr(url_from, '/')) {
+ url_from = p + 3;
+ }
}
if ((p = strstr(url_to, "://")) != NULL) {
- url_to = p + 3;
+ if (p < strchr(url_to, '/')) {
+ url_to = p + 3;
+ }
}
if (php_check_open_basedir(url_from TSRMLS_CC) || php_check_open_basedir(url_to TSRMLS_CC)) {
char *p;
if ((p = strstr(dir, "://")) != NULL) {
- dir = p + 3;
+ if (p < strchr(dir, '/')) {
+ dir = p + 3;
+ }
}
if (!recursive) {
#endif
if ((p = strstr(url, "://")) != NULL) {
- url = p + 3;
+ if (p < strchr(url, '/')) {
+ url = p + 3;
+ }
}
if (php_check_open_basedir(url TSRMLS_CC)) {