diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 15273cb6c46a4..989f84f1fdd1c 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -23,7 +23,7 @@ #include "ext/standard/php_filestat.h" #include "ext/standard/flock_compat.h" #include "ext/standard/scanf.h" -#include "ext/standard/php_string.h" +#include "ext/standard/php_string.h" /* For php_basename() */ #include "zend_attributes.h" #include "zend_exceptions.h" #include "zend_interfaces.h" @@ -1362,7 +1362,7 @@ PHP_METHOD(SplFileInfo, getPathInfo) path = spl_filesystem_object_get_pathname(intern); if (path && ZSTR_LEN(path)) { zend_string *dpath = zend_string_init(ZSTR_VAL(path), ZSTR_LEN(path), 0); - ZSTR_LEN(dpath) = php_dirname(ZSTR_VAL(dpath), ZSTR_LEN(path)); + ZSTR_LEN(dpath) = zend_dirname(ZSTR_VAL(dpath), ZSTR_LEN(path)); spl_filesystem_object_create_info(dpath, ce, return_value); zend_string_release(dpath); } diff --git a/ext/standard/link.c b/ext/standard/link.c index 0529006d4667c..df2831b878462 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -99,8 +99,9 @@ PHP_FUNCTION(linkinfo) Z_PARAM_PATH(link, link_len) ZEND_PARSE_PARAMETERS_END(); + // TODO Check for empty string dirname = estrndup(link, link_len); - php_dirname(dirname, link_len); + zend_dirname(dirname, link_len); if (php_check_open_basedir(dirname)) { efree(dirname); @@ -141,7 +142,7 @@ PHP_FUNCTION(symlink) } memcpy(dirname, source_p, sizeof(source_p)); - len = php_dirname(dirname, strlen(dirname)); + len = zend_dirname(dirname, strlen(dirname)); if (!expand_filepath_ex(topath, dest_p, dirname, len)) { php_error_docref(NULL, E_WARNING, "No such file or directory"); diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index bbb4b94814a48..6724f4fbfbffb 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -24,7 +24,6 @@ #include "ext/standard/info.h" #include "php_xmlwriter.h" #include "php_xmlwriter_arginfo.h" -#include "ext/standard/php_string.h" /* For php_dirname() */ static zend_class_entry *xmlwriter_class_entry_ce; @@ -158,7 +157,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i } memcpy(file_dirname, source, strlen(source)); - dir_len = php_dirname(file_dirname, strlen(source)); + dir_len = zend_dirname(file_dirname, strlen(source)); if (dir_len > 0) { zend_stat_t buf = {0}; diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 5d331c2fa4b82..342d6aabe7240 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -171,7 +171,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, const char *file, s is_dir_only = 1; } else { memcpy(file_dirname, path_cleaned, path_cleaned_len); - dir_len = php_dirname(file_dirname, path_cleaned_len); + dir_len = zend_dirname(file_dirname, path_cleaned_len); if (!dir_len || (dir_len == 1 && file_dirname[0] == '.')) { len = spprintf(&file_dirname_fullpath, 0, "%s", dest); diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index bd030c2010349..a720ce32e356c 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -95,7 +95,6 @@ #include "zend_smart_str.h" #include "ext/standard/html.h" #include "ext/standard/url.h" /* for php_raw_url_decode() */ -#include "ext/standard/php_string.h" /* for php_dirname() */ #include "ext/date/php_date.h" /* for php_format_date() */ #include "php_network.h"