Skip to content

Commit 9fbdc18

Browse files
committed
Fix PHP deprecation warning
1 parent 77b91e1 commit 9fbdc18

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.29.1] - 2024-03-05
11+
12+
### Fixed
13+
- PHP deprecation warning from passing null to basename().
14+
1015
## [0.29.0] - 2024-01-10
1116

1217
### Added

Wireframe.info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "Wireframe",
33
"summary": "Wireframe is an output framework for ProcessWire CMS/CMF.",
4-
"version": "0.29.0",
4+
"version": "0.29.1",
55
"author": "Teppo Koivula",
66
"href": "https://wireframe-framework.com",
77
"requires": [

Wireframe.module.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @method static string|Page|NullPage page($source, $args = []) Static getter (factory) method for Pages.
1515
* @method static string|null partial(string $partial_name, array $args = []) Static getter (factory) method for Partials.
1616
*
17-
* @version 0.29.0
17+
* @version 0.29.1
1818
* @author Teppo Koivula <teppo@wireframe-framework.com>
1919
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
2020
*/
@@ -826,7 +826,9 @@ public function ___render(array $data = []): ?string {
826826
$view->setContext('view');
827827
$output = $view->render();
828828
}
829-
if ($filename = basename($view->getLayout())) {
829+
$layout = $view->getLayout();
830+
$filename = $layout ? basename($layout) : null;
831+
if ($filename) {
830832
// layouts make it possible to define a common base structure for multiple otherwise separate template
831833
// and view files (DRY)
832834
$layout_filename = $paths->layouts . $filename . $ext;

0 commit comments

Comments
 (0)