Skip to content

Commit bb8a974

Browse files
authored
Merge pull request #109 from mgroensmit/main
Update IndexBlogUrls.php
2 parents 7593445 + 902959a commit bb8a974

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
- Fix second parameter non-default error for Mooore\WordpressIntegrationCms\Cron\IndexBlogUrls::createUrl()
810

911
## [0.10.9] - 2023-01-11
1012
### Fixed

Cron/IndexBlogUrls.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,12 @@ public function createRewriteRules($siteId, $postId, $entityId, $slug)
194194
return $rewrites;
195195
}
196196

197-
public function createUrl($prefix = '', $slug)
197+
public function createUrl($prefix = '', $slug = '')
198198
{
199+
if (empty($slug)) {
200+
throw new \InvalidArgumentException('Slug can not be empty');
201+
}
202+
199203
$prefix = ltrim($prefix, '/'); // Remove trailing slash
200204

201205
return "$prefix/$slug";

0 commit comments

Comments
 (0)