Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
# report every PHP version, not only the first failing one
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
php: ['8.2', '8.3', '8.4', '8.5']
deps: ['locked']
include:
# composer.lock is resolved for PHP 8.2; projects on a newer PHP get newer
# dependencies (e.g. symfony/html-sanitizer 8), so test them as well
- php: '8.4'
- php: '8.5'
deps: 'latest'

steps:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ All notable changes to this project are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
and the project follows [Semantic Versioning](https://semver.org/).

## [4.8.1] - unreleased

### Fixed

- `UploadField` uses `finfo` as an object to get the mime type of the file. `finfo_close()`
is deprecated as of PHP 8.5, so every upload with a type check gave a deprecation notice.
- `ImageConverter` (`resizeImage()`, `mergeImage()`) frees its images with `unset()`.
`imagedestroy()` is deprecated as of PHP 8.5; it has no effect since PHP 8.0, when GD
images became objects.

### Changed

- GitHub Actions runs the tests on PHP 8.5 too, and the job with the latest dependencies
on PHP 8.5 instead of 8.4.

## [4.8.0] - 2026-11-01

### Added
Expand Down
4 changes: 2 additions & 2 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FormHandler – Development setup

FormHandler is developed and tested with **PHP 8.2 in a Docker container**. You do
not need a local PHP installation. GitHub Actions runs the tests on PHP 8.2, 8.3 and 8.4.
not need a local PHP installation. GitHub Actions runs the tests on PHP 8.2, 8.3, 8.4 and 8.5.

## Requirements

Expand Down Expand Up @@ -82,7 +82,7 @@ Then open <http://localhost:8088/examples/>. Another port: `FH_WEB_PORT=8090 doc

| Workflow | File | Runs |
|---|---|---|
| PHPUnit | `.github/workflows/phpunit.yml` | tests with coverage on PHP 8.2, 8.3 and 8.4 |
| PHPUnit | `.github/workflows/phpunit.yml` | tests with coverage on PHP 8.2, 8.3, 8.4 and 8.5 |
| PHPStan | `.github/workflows/phpstan.yml` | static analysis on PHP 8.2 |
| Examples | `.github/workflows/examples.yml` | requests every example page on the PHP built-in server |

Expand Down
10 changes: 5 additions & 5 deletions src/fields/class.UploadField.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,12 @@ public function isValid()
// does build in function exists for retrieving the mime type of the file?
// if so, get the type of the mime from that function (more secure)
// otherwise, use the one from the browser
// as of php 5.3 mime_content_type is deprecated, use finfo_open instead
if (function_exists('finfo_open'))
// as of php 5.3 mime_content_type is deprecated, use finfo instead
// (the object is freed by itself, finfo_close() is deprecated as of php 8.5)
if (class_exists('finfo'))
{
$finfo = finfo_open(FILEINFO_MIME);
$sTypeRaw = finfo_file($finfo, $aFile['tmp_name']);
finfo_close($finfo);
$finfo = new finfo(FILEINFO_MIME);
$sTypeRaw = $finfo->file($aFile['tmp_name']);
list($sType) = preg_split('/;/', $sTypeRaw);
}
else
Expand Down
12 changes: 6 additions & 6 deletions src/includes/class.ImageConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ public function doResize($sDestination, $iNewWidth, $iNewHeight)
$this->_aSize[1] = $iNewHeight;
}

// clean up
ImageDestroy($rOrg);
ImageDestroy($rImgResized);
// clean up (GD images are objects since php 8.0, imagedestroy() is deprecated as of php 8.5)
unset($rOrg);
unset($rImgResized);
}
}

Expand Down Expand Up @@ -251,7 +251,7 @@ public function doMerge($sStamp, $sAlign, $sValign, $aTransparant = null)

// Copy the current file to the new one
ImageCopy($rImgDest, $rImgSrc, 0, 0, 0, 0, $this->_aSize[0], $this->_aSize[1]);
ImageDestroy($rImgSrc);
unset($rImgSrc);

// get the new position for the stamp
$x = ImageSX($rImgStamp);
Expand All @@ -264,11 +264,11 @@ public function doMerge($sStamp, $sAlign, $sValign, $aTransparant = null)
//ImageCopy( $rImgDest, $rImgStamp, $posX, $posY, 0, 0, $x, $y ); # transparant isnt working!
//ImageCopyResampled( $rImgDest, $rImgStamp, 0, 0, $x, $y, $x, $y ); # transparant isnt working!

ImageDestroy($rImgStamp);
unset($rImgStamp);

// Save the new image
$this->_saveImage($rImgDest, $this->_sImage, 100);
ImageDestroy($rImgDest);
unset($rImgDest);
}
else
{
Expand Down