Fix strict standards warnings in "web/html/pkgsubmit.php".

end() expects a reference but we pass a function return value here.
Using list() is a bit hacky as well as it expects a 0-based array
whereas unpack() returns a 1-based array - thus we use "list(, $foo)".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2011-03-30 12:27:25 +02:00
parent 47faf88f14
commit e4130fcca6

View file

@ -30,7 +30,7 @@ if ($_COOKIE["AURSID"]):
if (!$error) {
$fh = fopen($_FILES['pfile']['tmp_name'], 'rb');
fseek($fh, 0, SEEK_SET);
$magic = end(unpack('v', fread($fh, 2)));
list(, $magic) = unpack('v', fread($fh, 2));
if ($magic != 0x8b1f) {
$error = __("Error - unsupported file format (please submit gzip'ed tarballs generated by makepkg(8) only).");
@ -40,7 +40,7 @@ if ($_COOKIE["AURSID"]):
# Check uncompressed file size (ZIP bomb protection)
if (!$error && $MAX_FILESIZE_UNCOMPRESSED) {
fseek($fh, -4, SEEK_END);
$filesize_uncompressed = end(unpack('V', fread($fh, 4)));
list(, $filesize_uncompressed) = unpack('V', fread($fh, 4));
if ($filesize_uncompressed > $MAX_FILESIZE_UNCOMPRESSED) {
$error = __("Error - uncompressed file size too large.");