Skip to content

Commit

Permalink
Merge pull request #12 from teppokoivula/master
Browse files Browse the repository at this point in the history
Fix page URL trailing slashes when urlSegmentsStr is set but current page does not use URL segments
  • Loading branch information
Fokke- authored Sep 21, 2023
2 parents f5e172e + 8da1318 commit 552f74e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MarkupMetadata.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MarkupMetadata extends WireData implements Module, ConfigurableModule {
public static function getModuleInfo() : array {
return [
'title' => 'Markup Metadata',
'version' => 121,
'version' => 122,
'summary' => 'Set and render meta tags for head section.',
'author' => 'Ville Fokke Saarivaara',
'singular' => true,
Expand Down Expand Up @@ -125,7 +125,8 @@ private function getPageUrl (?\ProcessWire\Language $language = null) : ?string
// Add trailing slash if required
if (
($this->page->template->urlSegments === 1 && $this->page->template->slashUrlSegments === 1 && $this->input->urlSegmentStr) ||
($this->page->template->slashUrls === 1 && !$this->input->urlSegmentStr)
($this->page->template->slashUrls === 1 && !$this->input->urlSegmentStr) ||
($this->page->template->slashUrls === 1 && $this->page->template->urlSegments === 0 && $this->input->urlSegmentStr !== '')
) {
$url .= '/';
}
Expand Down

0 comments on commit 552f74e

Please sign in to comment.