[php-src] PHP-8.6: [`%pS` migration] Use `%pS` in ext/phar/phar_object.c

From: Date: Mon, 05 Oct 2026 06:53:03 +0000
Subject: [php-src] PHP-8.6: [`%pS` migration] Use `%pS` in ext/phar/phar_object.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141945@lists.php.net to get a copy of this message
Author: Daniel Scherzer (DanielEScherzer) Date: 2026-10-04T22:59:50-07:00 Commit: https://github.com/php/php-src/commit/fe1f83ecd03ecfb49a7f1603b24595f74f8f8898 Raw diff: https://github.com/php/php-src/commit/fe1f83ecd03ecfb49a7f1603b24595f74f8f8898.diff [%pS migration] Use %pS in ext/phar/phar_object.c Changed paths: M ext/phar/phar_object.c Diff: diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 2fc17e7b9cea..1ba650c83e15 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -493,14 +493,14 @@ PHP_METHOD(Phar, mount) } } - zend_throw_exception_ex(phar_ce_PharException, 0, "%s is not a phar archive, cannot mount", ZSTR_VAL(arch)); + zend_throw_exception_ex(phar_ce_PharException, 0, "%pS is not a phar archive, cannot mount", arch); zend_string_release_ex(arch, false); goto finish; } carry_on: if (SUCCESS != phar_mount_entry(pphar, actual, actual_len, path, path_len)) { - zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %s failed", path, actual, ZSTR_VAL(arch)); + zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %pS failed", path, actual, arch); } if (entry && path == ZSTR_VAL(entry)) { @@ -1268,10 +1268,10 @@ PHP_METHOD(Phar, unlinkArchive) if (FAILURE == phar_open_from_filename(ZSTR_VAL(fname), ZSTR_LEN(fname), NULL, REPORT_ERRORS, &phar, &error)) { if (error) { - zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"%s\": %s", ZSTR_VAL(fname), error); + zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"%pS\": %s", fname, error); efree(error); } else { - zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"%s\"", ZSTR_VAL(fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"%pS\"", fname); } RETURN_THROWS(); } @@ -1282,7 +1282,7 @@ PHP_METHOD(Phar, unlinkArchive) if (arch) { if (zend_string_equals(arch, fname)) { zend_string_release_ex(arch, false); - zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" cannot be unlinked from within itself", ZSTR_VAL(fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%pS\" cannot be unlinked from within itself", fname); RETURN_THROWS(); } zend_string_release_ex(arch, false); @@ -1290,12 +1290,12 @@ PHP_METHOD(Phar, unlinkArchive) } if (phar->is_persistent) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" is in phar.cache_list, cannot unlinkArchive()", ZSTR_VAL(fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%pS\" is in phar.cache_list, cannot unlinkArchive()", fname); RETURN_THROWS(); } if (phar->refcount) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%s\" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive()", ZSTR_VAL(fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar archive \"%pS\" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive()", fname); RETURN_THROWS(); } @@ -1399,7 +1399,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ if (!value) { /* failure in get_current_data */ - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned no value", ZSTR_VAL(ce->name)); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %pS returned no value", ce->name); return ZEND_HASH_APPLY_STOP; } @@ -1410,7 +1410,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ php_stream_from_zval_no_verify(fp, value); if (!fp) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %s returned an invalid stream handle", ZSTR_VAL(ce->name)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %pS returned an invalid stream handle", ce->name); return ZEND_HASH_APPLY_STOP; } @@ -1424,7 +1424,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ if (Z_TYPE(key) != IS_STRING) { zval_ptr_dtor(&key); - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name)); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %pS returned an invalid key (must return a string)", ce->name); return ZEND_HASH_APPLY_STOP; } @@ -1434,7 +1434,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ save = str_key; zval_ptr_dtor_str(&key); } else { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name)); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %pS returned an invalid key (must return a string)", ce->name); return ZEND_HASH_APPLY_STOP; } @@ -1446,7 +1446,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ spl_filesystem_object *intern = PHAR_FETCH_INTERNAL_EX(value); if (!base_len) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %s returns an SplFileInfo object, so base directory must be specified", ZSTR_VAL(ce->name)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Iterator %pS returns an SplFileInfo object, so base directory must be specified", ce->name); return ZEND_HASH_APPLY_STOP; } @@ -1506,7 +1506,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ } ZEND_FALLTHROUGH; default: - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid value (must return a string, a stream, or an SplFileInfo object)", ZSTR_VAL(ce->name)); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %pS returned an invalid value (must return a string, a stream, or an SplFileInfo object)", ce->name); return ZEND_HASH_APPLY_STOP; } @@ -1546,7 +1546,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ } } else { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned a path \"%s\" that is not in the base directory \"%s\"", ZSTR_VAL(ce->name), fname, base); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %pS returned a path \"%s\" that is not in the base directory \"%s\"", ce->name, fname, base); if (save) { efree(save); @@ -1566,7 +1566,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ if (Z_TYPE(key) != IS_STRING) { zval_ptr_dtor(&key); - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name)); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %pS returned an invalid key (must return a string)", ce->name); return ZEND_HASH_APPLY_STOP; } @@ -1576,13 +1576,13 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ save = str_key; zval_ptr_dtor_str(&key); } else { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned an invalid key (must return a string)", ZSTR_VAL(ce->name)); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %pS returned an invalid key (must return a string)", ce->name); return ZEND_HASH_APPLY_STOP; } } if (php_check_open_basedir(fname)) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned a path \"%s\" that open_basedir prevents opening", ZSTR_VAL(ce->name), fname); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %pS returned a path \"%s\" that open_basedir prevents opening", ce->name, fname); if (save) { efree(save); @@ -1599,7 +1599,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ fp = php_stream_open_wrapper(fname, "rb", STREAM_MUST_SEEK|0, &opened); if (!fp) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %s returned a file that could not be opened \"%s\"", ZSTR_VAL(ce->name), fname); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %pS returned a file that could not be opened \"%s\"", ce->name, fname); if (save) { efree(save); @@ -1765,7 +1765,7 @@ PHP_METHOD(Phar, buildFromDirectory) if (apply_reg) { zval_ptr_dtor(&regexiter); } - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" unable to create temporary file", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" unable to create temporary file", phar_obj->archive->fname); RETURN_THROWS(); } @@ -1775,7 +1775,7 @@ PHP_METHOD(Phar, buildFromDirectory) zval_ptr_dtor(&regexiter); } php_stream_close(pass.fp); - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } @@ -1833,7 +1833,7 @@ PHP_METHOD(Phar, buildFromIterator) } if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } @@ -1846,7 +1846,7 @@ PHP_METHOD(Phar, buildFromIterator) pass.count = 0; pass.fp = php_stream_fopen_tmpfile(); if (pass.fp == NULL) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\": unable to create temporary file", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\": unable to create temporary file", phar_obj->archive->fname); RETURN_THROWS(); } @@ -1915,11 +1915,11 @@ static zend_result phar_copy_file_contents(phar_entry_info *entry, php_stream *f if (FAILURE == phar_open_entry_fp(entry, &error, true)) { if (error) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "Cannot convert phar archive \"%s\", unable to open entry \"%s\" contents: %s", ZSTR_VAL(entry->phar->fname), ZSTR_VAL(entry->filename), error); + "Cannot convert phar archive \"%pS\", unable to open entry \"%pS\" contents: %s", entry->phar->fname, entry->filename, error); efree(error); } else { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "Cannot convert phar archive \"%s\", unable to open entry \"%s\" contents", ZSTR_VAL(entry->phar->fname), ZSTR_VAL(entry->filename)); + "Cannot convert phar archive \"%pS\", unable to open entry \"%pS\" contents", entry->phar->fname, entry->filename); } return FAILURE; } @@ -1929,7 +1929,7 @@ static zend_result phar_copy_file_contents(phar_entry_info *entry, php_stream *f offset = php_stream_tell(fp); if (SUCCESS != php_stream_copy_to_stream_ex(phar_get_efp(entry, false), fp, entry->uncompressed_filesize, NULL)) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "Cannot convert phar archive \"%s\", unable to copy entry \"%s\" contents", ZSTR_VAL(entry->phar->fname), ZSTR_VAL(entry->filename)); + "Cannot convert phar archive \"%pS\", unable to copy entry \"%pS\" contents", entry->phar->fname, entry->filename); return FAILURE; } @@ -2022,9 +2022,9 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* } else if (phar_path_check(&ext, &ext_len, &pcr_error) > pcr_is_ok) { if (phar->is_data) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar converted from \"%s\" has invalid extension %s", ZSTR_VAL(phar->fname), ext); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar converted from \"%pS\" has invalid extension %s", phar->fname, ext); } else { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar converted from \"%s\" has invalid extension %s", ZSTR_VAL(phar->fname), ext); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar converted from \"%pS\" has invalid extension %s", phar->fname, ext); } return NULL; } @@ -2086,7 +2086,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* efree(newname); if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_find_ptr(&cached_phars, newpath))) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars, new phar name is in phar.cache_list", ZSTR_VAL(phar->fname)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%pS\" to the list of phars, new phar name is in phar.cache_list", phar->fname); goto err_oldpath; } @@ -2111,17 +2111,17 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* } } - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars, a phar with that name already exists", ZSTR_VAL(phar->fname)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%pS\" to the list of phars, a phar with that name already exists", phar->fname); goto err_oldpath; } its_ok: if (SUCCESS == php_stream_stat_path(ZSTR_VAL(newpath), &ssb)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%s\" exists and must be unlinked prior to conversion", ZSTR_VAL(newpath)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%pS\" exists and must be unlinked prior to conversion", newpath); goto err_reused_oldpath; } if (!phar->is_data) { if (SUCCESS != phar_detect_phar_fname_ext(ZSTR_VAL(newpath), ZSTR_LEN(newpath), &(phar->ext), &ext_len, 1, 1, true)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%s\" has invalid extension %s", ZSTR_VAL(phar->fname), ext); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%pS\" has invalid extension %s", phar->fname, ext); goto err_reused_oldpath; } phar->ext_len = ext_len; @@ -2144,7 +2144,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* } else { if (SUCCESS != phar_detect_phar_fname_ext(ZSTR_VAL(newpath), ZSTR_LEN(newpath), &(phar->ext), &ext_len, 0, 1, true)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar \"%s\" has invalid extension %s", ZSTR_VAL(phar->fname), ext); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar \"%pS\" has invalid extension %s", phar->fname, ext); goto err_reused_oldpath; } phar->ext_len = ext_len; @@ -2157,7 +2157,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext) /* } if ((!pphar || phar == pphar) && NULL == zend_hash_update_ptr(&(PHAR_G(phar_fname_map)), newpath, phar)) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars", ZSTR_VAL(phar->fname)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%pS\" to the list of phars", phar->fname); goto err_oldpath; } @@ -2601,7 +2601,7 @@ PHP_METHOD(Phar, delete) } if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } if (NULL != (entry = zend_hash_find_ptr(&phar_obj->archive->manifest, file_name))) { @@ -2614,7 +2614,7 @@ PHP_METHOD(Phar, delete) phar_obj->archive->is_modified = 1; } } else { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist and cannot be deleted", ZSTR_VAL(file_name)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %pS does not exist and cannot be deleted", file_name); RETURN_THROWS(); } @@ -2697,16 +2697,16 @@ PHP_METHOD(Phar, setAlias) } if (NULL != (fd_ptr = zend_hash_find_ptr(&(PHAR_G(phar_alias_map)), new_alias))) { if (SUCCESS != phar_free_alias(fd_ptr)) { - zend_throw_exception_ex(phar_ce_PharException, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", ZSTR_VAL(new_alias), ZSTR_VAL(fd_ptr->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "alias \"%pS\" is already used for archive \"%pS\" and cannot be used for other archives", new_alias, fd_ptr->fname); RETURN_THROWS(); } } else if (!phar_validate_alias(ZSTR_VAL(new_alias), ZSTR_LEN(new_alias))) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "Invalid alias \"%s\" specified for phar \"%s\"", ZSTR_VAL(new_alias), ZSTR_VAL(phar_obj->archive->fname)); + "Invalid alias \"%pS\" specified for phar \"%pS\"", new_alias, phar_obj->archive->fname); RETURN_THROWS(); } if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } if (phar_obj->archive->alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), phar_obj->archive->alias, phar_obj->archive->alias_len))) { @@ -2843,7 +2843,7 @@ PHP_METHOD(Phar, setStub) if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "r|l", &zstub, &len) == SUCCESS) { zend_string *method_name = get_active_function_or_method_name(); - zend_error(E_DEPRECATED, "Calling %s(resource $stub, int $length) is deprecated", ZSTR_VAL(method_name)); + zend_error(E_DEPRECATED, "Calling %pS(resource $stub, int $length) is deprecated", method_name); zend_string_release(method_name); if (UNEXPECTED(EG(exception))) { RETURN_THROWS(); @@ -2851,7 +2851,7 @@ PHP_METHOD(Phar, setStub) if ((php_stream_from_zval_no_verify(stream, zstub)) != NULL) { if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } @@ -2863,7 +2863,7 @@ PHP_METHOD(Phar, setStub) } if (stub_file_content == NULL) { - zend_throw_exception_ex(phar_ce_PharException, 0, "unable to read resource to copy stub to new phar \"%s\"", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "unable to read resource to copy stub to new phar \"%pS\"", phar_obj->archive->fname); RETURN_THROWS(); } @@ -2881,7 +2881,7 @@ PHP_METHOD(Phar, setStub) } } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &stub) == SUCCESS) { if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } phar_flush_ex(phar_obj->archive, stub, /* is_default_stub */ false, &error); @@ -2962,7 +2962,7 @@ PHP_METHOD(Phar, setDefaultStub) } if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } phar_flush_ex(phar_obj->archive, stub, /* is_default_stub */ true, &error); @@ -3013,7 +3013,7 @@ PHP_METHOD(Phar, setSignatureAlgorithm) case PHAR_SIG_OPENSSL_SHA256: case PHAR_SIG_OPENSSL_SHA512: if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } phar_obj->archive->sig_flags = (uint32_t)algo; @@ -3323,7 +3323,7 @@ PHP_METHOD(Phar, compressFiles) } if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } pharobj_set_compression(&phar_obj->archive->manifest, flags); @@ -3362,7 +3362,7 @@ PHP_METHOD(Phar, decompressFiles) RETURN_TRUE; } else { if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } pharobj_set_compression(&phar_obj->archive->manifest, PHAR_ENT_COMPRESSED_NONE); @@ -3397,35 +3397,35 @@ PHP_METHOD(Phar, copy) if (PHAR_G(readonly) && !phar_obj->archive->is_data) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "Cannot copy \"%s\" to \"%s\", phar is read-only", ZSTR_VAL(old_file), ZSTR_VAL(new_file)); + "Cannot copy \"%pS\" to \"%pS\", phar is read-only", old_file, new_file); RETURN_THROWS(); } if (phar_is_magic_phar(old_file)) { /* can't copy a meta file */ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "file \"%s\" cannot be copied to file \"%s\", cannot copy Phar meta-file in %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), ZSTR_VAL(phar_obj->archive->fname)); + "file \"%pS\" cannot be copied to file \"%pS\", cannot copy Phar meta-file in %pS", old_file, new_file, phar_obj->archive->fname); RETURN_THROWS(); } if (phar_is_magic_phar(new_file)) { /* can't copy a meta file */ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "file \"%s\" cannot be copied to file \"%s\", cannot copy to Phar meta-file in %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), ZSTR_VAL(phar_obj->archive->fname)); + "file \"%pS\" cannot be copied to file \"%pS\", cannot copy to Phar meta-file in %pS", old_file, new_file, phar_obj->archive->fname); RETURN_THROWS(); } phar_entry_info *oldentry = zend_hash_find_ptr(&phar_obj->archive->manifest, old_file); if (!oldentry || oldentry->is_deleted) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "file \"%s\" cannot be copied to file \"%s\", file does not exist in %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), ZSTR_VAL(phar_obj->archive->fname)); + "file \"%pS\" cannot be copied to file \"%pS\", file does not exist in %pS", old_file, new_file, phar_obj->archive->fname); RETURN_THROWS(); } const phar_entry_info *temp = zend_hash_find_ptr(&phar_obj->archive->manifest, new_file); if (temp && !temp->is_deleted) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "file \"%s\" cannot be copied to file \"%s\", file must not already exist in phar %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), ZSTR_VAL(phar_obj->archive->fname)); + "file \"%pS\" cannot be copied to file \"%pS\", file must not already exist in phar %pS", old_file, new_file, phar_obj->archive->fname); RETURN_THROWS(); } @@ -3433,13 +3433,13 @@ PHP_METHOD(Phar, copy) char *tmp_new_file = ZSTR_VAL(new_file); if (phar_path_check(&tmp_new_file, &tmp_len, &pcr_error) > pcr_is_ok) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, - "file \"%s\" contains invalid characters %s, cannot be copied from \"%s\" in phar %s", ZSTR_VAL(new_file), pcr_error, ZSTR_VAL(old_file), ZSTR_VAL(phar_obj->archive->fname)); + "file \"%pS\" contains invalid characters %s, cannot be copied from \"%pS\" in phar %pS", new_file, pcr_error, old_file, phar_obj->archive->fname); RETURN_THROWS(); } if (phar_obj->archive->is_persistent) { if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } /* re-populate with copied-on-write entry */ @@ -3521,7 +3521,7 @@ PHP_METHOD(Phar, offsetGet) /* security is 0 here so that we can get a better error message than "entry doesn't exist" */ phar_entry_info *entry = phar_get_entry_info_dir(phar_obj->archive, ZSTR_VAL(file_name), ZSTR_LEN(file_name), 1, &error, false); if (!entry) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist%s%s", ZSTR_VAL(file_name), error?", ":"", error?error:""); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %pS does not exist%s%s", file_name, error?", ":"", error?error:""); } else { if (entry->is_temp_dir) { zend_string_efree(entry->filename); @@ -3529,12 +3529,12 @@ PHP_METHOD(Phar, offsetGet) } if (zend_string_equals_literal(file_name, ".phar/stub.php")) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot get stub \".phar/stub.php\" directly in phar \"%s\", use getStub", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot get stub \".phar/stub.php\" directly in phar \"%pS\", use getStub", phar_obj->archive->fname); RETURN_THROWS(); } if (zend_string_equals_literal(file_name, ".phar/alias.txt")) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot get alias \".phar/alias.txt\" directly in phar \"%s\", use getAlias", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot get alias \".phar/alias.txt\" directly in phar \"%pS\", use getAlias", phar_obj->archive->fname); RETURN_THROWS(); } @@ -3543,7 +3543,7 @@ PHP_METHOD(Phar, offsetGet) RETURN_THROWS(); } - zend_string *sfname = strpprintf(0, "phar://%s/%s", ZSTR_VAL(phar_obj->archive->fname), ZSTR_VAL(file_name)); + zend_string *sfname = strpprintf(0, "phar://%pS/%pS", phar_obj->archive->fname, file_name); zval zfname; ZVAL_NEW_STR(&zfname, sfname); @@ -3663,10 +3663,10 @@ static void phar_mkdir(phar_archive_data **pphar, zend_string *dir_name) ); if (!data) { if (error) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created: %s", ZSTR_VAL(dir_name), error); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %pS does not exist and cannot be created: %s", dir_name, error); efree(error); } else { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %s does not exist and cannot be created", ZSTR_VAL(dir_name)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Directory %pS does not exist and cannot be created", dir_name); } return; @@ -3706,12 +3706,12 @@ PHP_METHOD(Phar, offsetSet) } if (zend_string_equals_literal(file_name, ".phar/stub.php")) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set stub \".phar/stub.php\" directly in phar \"%s\", use setStub", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set stub \".phar/stub.php\" directly in phar \"%pS\", use setStub", phar_obj->archive->fname); RETURN_THROWS(); } if (zend_string_equals_literal(file_name, ".phar/alias.txt")) { - zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set alias \".phar/alias.txt\" directly in phar \"%s\", use setAlias", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set alias \".phar/alias.txt\" directly in phar \"%pS\", use setAlias", phar_obj->archive->fname); RETURN_THROWS(); } @@ -3750,7 +3750,7 @@ PHP_METHOD(Phar, offsetUnset) if (phar_obj->archive->is_persistent) { if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } /* re-populate entry after copy on write */ @@ -3804,13 +3804,13 @@ PHP_METHOD(Phar, addFile) PHAR_ARCHIVE_OBJECT(); if (!strstr(ZSTR_VAL(file_name), "://") && php_check_open_basedir(ZSTR_VAL(file_name))) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive, open_basedir restrictions prevent this", ZSTR_VAL(file_name)); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%pS\" to add to phar archive, open_basedir restrictions prevent this", file_name); RETURN_THROWS(); } php_stream *resource = php_stream_open_wrapper(ZSTR_VAL(file_name), "rb", 0, NULL); if (!resource) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive", ZSTR_VAL(file_name)); + zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%pS\" to add to phar archive", file_name); RETURN_THROWS(); } @@ -3861,7 +3861,7 @@ PHP_METHOD(Phar, getStub) } else { fp = php_stream_open_wrapper(ZSTR_VAL(phar_obj->archive->fname), "rb", 0, NULL); if (!fp) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to open phar \"%s\"", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to open phar \"%pS\"", phar_obj->archive->fname); RETURN_THROWS(); } if (stub->flags & PHAR_ENT_COMPRESSION_MASK) { @@ -3869,7 +3869,7 @@ PHP_METHOD(Phar, getStub) ZEND_ASSERT(decompression_filter_name && "Must have as this has a decompression flag set"); filter = php_stream_filter_create(decompression_filter_name, NULL, php_stream_is_persistent(fp)); if (UNEXPECTED(filter == NULL)) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to read stub of phar \"%s\" (cannot create %s filter)", ZSTR_VAL(phar_obj->archive->fname), decompression_filter_name); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "phar error: unable to read stub of phar \"%pS\" (cannot create %s filter)", phar_obj->archive->fname, decompression_filter_name); RETURN_THROWS(); } php_stream_filter_append(&fp->readfilters, filter); @@ -4012,7 +4012,7 @@ PHP_METHOD(Phar, setMetadata) } if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar_obj->archive->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar_obj->archive->fname); RETURN_THROWS(); } @@ -4296,7 +4296,7 @@ PHP_METHOD(Phar, extractTo) if (!fp) { zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, - "Invalid argument, %s cannot be found", ZSTR_VAL(phar_obj->archive->fname)); + "Invalid argument, %pS cannot be found", phar_obj->archive->fname); RETURN_THROWS(); } @@ -4317,12 +4317,12 @@ PHP_METHOD(Phar, extractTo) ret = php_stream_mkdir(ZSTR_VAL(path_to), 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL); if (!ret) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, - "Unable to create path \"%s\" for extraction", ZSTR_VAL(path_to)); + "Unable to create path \"%pS\" for extraction", path_to); RETURN_THROWS(); } } else if (!(ssb.sb.st_mode & S_IFDIR)) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, - "Unable to use path \"%s\" for extraction, it is a file, must be a directory", ZSTR_VAL(path_to)); + "Unable to use path \"%pS\" for extraction, it is a file, must be a directory", path_to); RETURN_THROWS(); } @@ -4340,14 +4340,14 @@ PHP_METHOD(Phar, extractTo) } switch (extract_helper(phar_obj->archive, Z_STR_P(zval_file), path_to, overwrite, &error)) { case -1: - zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", - ZSTR_VAL(phar_obj->archive->fname), error); + zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%pS\" failed: %s", + phar_obj->archive->fname, error); efree(error); RETURN_THROWS(); case 0: zend_throw_exception_ex(phar_ce_PharException, 0, - "phar error: attempted to extract non-existent file or directory \"%s\" from phar \"%s\"", - ZSTR_VAL(Z_STR_P(zval_file)), ZSTR_VAL(phar_obj->archive->fname)); + "phar error: attempted to extract non-existent file or directory \"%pS\" from phar \"%pS\"", + Z_STR_P(zval_file), phar_obj->archive->fname); RETURN_THROWS(); } } ZEND_HASH_FOREACH_END(); @@ -4356,13 +4356,13 @@ PHP_METHOD(Phar, extractTo) ret = extract_helper(phar_obj->archive, filename, path_to, overwrite, &error); if (-1 == ret) { - zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", - ZSTR_VAL(phar_obj->archive->fname), error); + zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%pS\" failed: %s", + phar_obj->archive->fname, error); efree(error); } else if (0 == ret && NULL != filename) { zend_throw_exception_ex(phar_ce_PharException, 0, - "phar error: attempted to extract non-existent file or directory \"%s\" from phar \"%s\"", - ZSTR_VAL(filename), ZSTR_VAL(phar_obj->archive->fname)); + "phar error: attempted to extract non-existent file or directory \"%pS\" from phar \"%pS\"", + filename, phar_obj->archive->fname); } else { RETURN_TRUE; } @@ -4421,8 +4421,8 @@ PHP_METHOD(PharFileInfo, __construct) phar_entry_info *entry_info = phar_get_entry_info_dir(phar_data, ZSTR_VAL(entry), ZSTR_LEN(entry), 1, &error, true); if (UNEXPECTED(!entry_info)) { zend_throw_exception_ex(spl_ce_RuntimeException, 0, - "Cannot access phar file entry '%s' in archive '%s'%s%s", - ZSTR_VAL(entry), ZSTR_VAL(arch), error ? ", " : "", error ? error : ""); + "Cannot access phar file entry '%pS' in archive '%pS'%s%s", + entry, arch, error ? ", " : "", error ? error : ""); zend_string_release_ex(entry, false); zend_string_release_ex(arch, false); RETURN_THROWS(); @@ -4586,12 +4586,12 @@ PHP_METHOD(PharFileInfo, chmod) if (entry_obj->entry->is_temp_dir) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \ - "Phar entry \"%s\" is a temporary directory (not an actual entry in the archive), cannot chmod", ZSTR_VAL(entry_obj->entry->filename)); \ + "Phar entry \"%pS\" is a temporary directory (not an actual entry in the archive), cannot chmod", entry_obj->entry->filename); \ RETURN_THROWS(); } if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) { - zend_throw_exception_ex(phar_ce_PharException, 0, "Cannot modify permissions for file \"%s\" in phar \"%s\", write operations are prohibited", ZSTR_VAL(entry_obj->entry->filename), ZSTR_VAL(entry_obj->entry->phar->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "Cannot modify permissions for file \"%pS\" in phar \"%pS\", write operations are prohibited", entry_obj->entry->filename, entry_obj->entry->phar->fname); RETURN_THROWS(); } @@ -4599,7 +4599,7 @@ PHP_METHOD(PharFileInfo, chmod) phar_archive_data *phar = entry_obj->entry->phar; if (FAILURE == phar_copy_on_write(&phar)) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar->fname); RETURN_THROWS(); } /* re-populate after copy-on-write */ @@ -4692,7 +4692,7 @@ PHP_METHOD(PharFileInfo, setMetadata) phar_archive_data *phar = entry_obj->entry->phar; if (FAILURE == phar_copy_on_write(&phar)) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar->fname); RETURN_THROWS(); } /* re-populate after copy-on-write */ @@ -4740,7 +4740,7 @@ PHP_METHOD(PharFileInfo, delMetadata) phar_archive_data *phar = entry_obj->entry->phar; if (FAILURE == phar_copy_on_write(&phar)) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar->fname); RETURN_THROWS(); } /* re-populate after copy-on-write */ @@ -4780,7 +4780,7 @@ PHP_METHOD(PharFileInfo, getContent) if (entry_obj->entry->is_dir) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, - "phar error: Cannot retrieve contents, \"%s\" in phar \"%s\" is a directory", ZSTR_VAL(entry_obj->entry->filename), ZSTR_VAL(entry_obj->entry->phar->fname)); + "phar error: Cannot retrieve contents, \"%pS\" in phar \"%pS\" is a directory", entry_obj->entry->filename, entry_obj->entry->phar->fname); RETURN_THROWS(); } @@ -4792,7 +4792,7 @@ PHP_METHOD(PharFileInfo, getContent) if (SUCCESS != phar_open_entry_fp(link, &error, false)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, - "phar error: Cannot retrieve contents, \"%s\" in phar \"%s\": %s", ZSTR_VAL(entry_obj->entry->filename), ZSTR_VAL(entry_obj->entry->phar->fname), error); + "phar error: Cannot retrieve contents, \"%pS\" in phar \"%pS\": %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error); efree(error); RETURN_THROWS(); } @@ -4800,7 +4800,7 @@ PHP_METHOD(PharFileInfo, getContent) php_stream *fp = phar_get_efp(link, false); if (!fp) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, - "phar error: Cannot retrieve contents of \"%s\" in phar \"%s\"", ZSTR_VAL(entry_obj->entry->filename), ZSTR_VAL(entry_obj->entry->phar->fname)); + "phar error: Cannot retrieve contents of \"%pS\" in phar \"%pS\"", entry_obj->entry->filename, entry_obj->entry->phar->fname); RETURN_THROWS(); } @@ -4854,7 +4854,7 @@ PHP_METHOD(PharFileInfo, compress) phar_archive_data *phar = entry_obj->entry->phar; if (FAILURE == phar_copy_on_write(&phar)) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar->fname); RETURN_THROWS(); } /* re-populate after copy-on-write */ @@ -4876,7 +4876,7 @@ PHP_METHOD(PharFileInfo, compress) /* decompress this file indirectly */ if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, - "phar error: Cannot decompress bzip2-compressed file \"%s\" in phar \"%s\" in order to compress with gzip: %s", ZSTR_VAL(entry_obj->entry->filename), ZSTR_VAL(entry_obj->entry->phar->fname), error); + "phar error: Cannot decompress bzip2-compressed file \"%pS\" in phar \"%pS\" in order to compress with gzip: %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error); efree(error); RETURN_THROWS(); } @@ -4907,7 +4907,7 @@ PHP_METHOD(PharFileInfo, compress) /* decompress this file indirectly */ if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, - "phar error: Cannot decompress gzip-compressed file \"%s\" in phar \"%s\" in order to compress with bzip2: %s", ZSTR_VAL(entry_obj->entry->filename), ZSTR_VAL(entry_obj->entry->phar->fname), error); + "phar error: Cannot decompress gzip-compressed file \"%pS\" in phar \"%pS\" in order to compress with bzip2: %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error); efree(error); RETURN_THROWS(); } @@ -4989,7 +4989,7 @@ PHP_METHOD(PharFileInfo, decompress) phar_archive_data *phar = entry_obj->entry->phar; if (FAILURE == phar_copy_on_write(&phar)) { - zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", ZSTR_VAL(phar->fname)); + zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%pS\" is persistent, unable to copy on write", phar->fname); RETURN_THROWS(); } /* re-populate after copy-on-write */ @@ -5010,7 +5010,7 @@ PHP_METHOD(PharFileInfo, decompress) /* decompress this file indirectly */ if (SUCCESS != phar_open_entry_fp(entry_obj->entry, &error, true)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, - "Phar error: Cannot decompress %s-compressed file \"%s\" in phar \"%s\": %s", compression_type, ZSTR_VAL(entry_obj->entry->filename), ZSTR_VAL(entry_obj->entry->phar->fname), error); + "Phar error: Cannot decompress %s-compressed file \"%pS\" in phar \"%pS\": %s", compression_type, entry_obj->entry->filename, entry_obj->entry->phar->fname, error); efree(error); RETURN_THROWS(); }

« previous php.cvs (#141945) next »