1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  phar: Fix broken return value of fflush() for phar file entries
This commit is contained in:
Niels Dossche
2025-11-15 13:57:59 +01:00
5 changed files with 30 additions and 4 deletions

1
NEWS
View File

@@ -25,6 +25,7 @@ PHP NEWS
- Phar:
. Fixed bug GH-20442 (Phar does not respect case-insensitiveness of
__halt_compiler() when reading stub). (ndossche, TimWolla)
. Fix broken return value of fflush() for phar file entries. (ndossche)
- PHPDBG:
. Fixed ZPP type violation in phpdbg_get_executable() and phpdbg_end_oplog().

View File

@@ -3185,7 +3185,7 @@ int phar_flush_ex(phar_archive_data *phar, zend_string *user_stub, bool is_defau
return EOF;
}
return EOF;
return 0;
cleanup:
if (shared_cfp != NULL) {

View File

@@ -1178,7 +1178,7 @@ nostub:
/* on error in the hash iterator above, error is set */
php_stream_close(newfile);
return;
return EOF;
}
/* add signature for executable tars or tars explicitly set with setSignatureAlgorithm */
@@ -1343,6 +1343,6 @@ nostub:
php_stream_close(newfile);
}
}
return EOF;
return 0;
}
/* }}} */

View File

@@ -0,0 +1,25 @@
--TEST--
fflush() on phar file should report success
--EXTENSIONS--
phar
--INI--
phar.readonly=0
--FILE--
<?php
$phar = new Phar(__DIR__.'/fflush_phar_file_report_success.phar');
$phar->addFromString('test', 'contents');
unset($phar);
$f = fopen('phar://' . __DIR__.'/fflush_phar_file_report_success.phar/test', 'w');
var_dump(fflush($f));
var_dump(fclose($f));
?>
--CLEAN--
<?php
@unlink(__DIR__.'/fflush_phar_file_report_success.phar');
?>
--EXPECT--
bool(true)
bool(true)

View File

@@ -1527,6 +1527,6 @@ nocentralerror:
if (must_close_old_file) {
php_stream_close(oldfile);
}
return EOF;
return 0;
}
/* }}} */