ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     --TEST--
RarArchive::setAllowBroken has the desired effect
--SKIPIF--
<?php if(!extension_loaded("rar")) print "skip"; ?>
--FILE--
<?php

require __DIR__ . "/php8compat.php.inc";
function retnull() { return null; }
$b = dirname(__FILE__) . "/multi_broken.part1.rar";

echo "* broken file; bad arguments\n";
$a = RarArchive::open($b, null, 'retnull');
argerr(function() use ($a) {
    $a->setAllowBroken();
});
argerr(function() use ($a) {
    rar_allow_broken_set($a);
});

echo "\n* broken file; do not allow broken (default)\n";
$a = RarArchive::open($b, null, 'retnull');
var_dump($a->getEntries());
var_dump(count($a));

echo "\n* broken file; do not allow broken (explicit)\n";
$a = RarArchive::open($b, null, 'retnull');
$a->setAllowBroken(false);
var_dump($a->getEntries());
var_dump(count($a));

echo "\n* broken file; allow broken\n";
$a = RarArchive::open($b, null, 'retnull');
$a->setAllowBroken(true);
foreach ($a->getEntries() as $e) {
	echo "$e\n";
}
var_dump(count($a));

echo "\n* broken file; allow broken; non OOP\n";
$a = RarArchive::open($b, null, 'retnull');
rar_allow_broken_set($a, true);
foreach ($a->getEntries() as $e) {
	echo "$e\n";
}
var_dump(count($a));

echo "\n";
echo "Done.\n";
--EXPECTF--
* broken file; bad arguments

Warning: RarArchive::setAllowBroken() expects exactly 1 parameter, 0 given in %s on line %d

Warning: rar_allow_broken_set() expects exactly 2 parameters, 1 given in %s on line %d

* broken file; do not allow broken (default)

Warning: RarArchive::getEntries(): ERAR_EOPEN (file open error) in %s on line %d
bool(false)

Warning: %s(): ERAR_EOPEN (file open error) in %s on line %d
int(0)

* broken file; do not allow broken (explicit)

Warning: RarArchive::getEntries(): ERAR_EOPEN (file open error) in %s on line %d
bool(false)

Warning: %s(): ERAR_EOPEN (file open error) in %s on line %d
int(0)

* broken file; allow broken
RarEntry for file "file1.txt" (52b28202)
int(1)

* broken file; allow broken; non OOP
RarEntry for file "file1.txt" (52b28202)
int(1)

Done.
