Skip to content

Commit

Permalink
If ID is Numeric, Convert to Integer!
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Aug 5, 2021
1 parent 1064655 commit 8c164df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lot/x/page/about.page
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Page
description: Convert file and folder structure into web pages.
author: Taufik Nurrohman
type: Markdown
version: 1.12.2
version: 1.12.3

use:
'.\lot\x\layout': 1
Expand Down
3 changes: 2 additions & 1 deletion lot/x/page/engine/kernel/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public function __toString() {
}

public function ID(...$lot) {
return $this->_get('id', $lot) ?? (($t = $this->time()->format('U')) ? sprintf('%u', $t) : null);
$id = $this->_get('id', $lot) ?? (($t = $this->time()->format('U')) ? sprintf('%u', $t) : null);
return is_string($id) && is_numeric($id) ? (int) $id : $id;
}

// Inherit to `File::URL()`
Expand Down

0 comments on commit 8c164df

Please sign in to comment.