Skip to content

Commit 430b064

Browse files
Use lot() Function
1 parent 5ce135b commit 430b064

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

about.page

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ color: '#2a4b36'
66
author: Taufik Nurrohman
77
image: /lot/x/comment/index.png
88
type: Markdown
9-
version: 3.0.0
9+
version: 3.0.1
1010
...
1111

1212
### Installation

index.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ function comments(...$lot) {
99
}
1010
if (\class_exists("\\Layout") && !\Layout::of('comments')) {
1111
\Layout::set('comments', static function ($key, array $lot = []) {
12-
\extract($lot, \EXTR_SKIP);
13-
\extract($GLOBALS, \EXTR_SKIP);
12+
\extract(\lot($lot), \EXTR_SKIP);
1413
$any = \P . \uniqid() . \P; // Dummy value
1514
$c = \State::get('x.comment', true);
1615
$chunk = $c['page']['chunk'] ?? null;
@@ -104,7 +103,7 @@ function content($content) {
104103
if (!\class_exists("\\Asset")) {
105104
return $content;
106105
}
107-
\extract($GLOBALS, \EXTR_SKIP);
106+
\extract(\lot(), \EXTR_SKIP);
108107
if (!$state->is('page')) {
109108
return $content;
110109
}
@@ -122,7 +121,7 @@ function content($content) {
122121
// Set the comment state as quickly as possible, but as close as possible to the response body
123122
\Hook::set('content', __NAMESPACE__ . "\\content", -1);
124123
function route__comment($content, $path, $query) {
125-
\extract($GLOBALS, \EXTR_SKIP);
124+
\extract(\lot(), \EXTR_SKIP);
126125
$can_alert = \class_exists("\\Alert");
127126
$path = \trim($path ?? "", '/');
128127
$active = isset($state->x->user) && \Is::user();
@@ -291,7 +290,7 @@ function route__comment($content, $path, $query) {
291290
\kick('/' . $path . $query . '#comment');
292291
}
293292
function route__page($content, $path, $query, $hash) {
294-
\extract($GLOBALS, \EXTR_SKIP);
293+
\extract(\lot(), \EXTR_SKIP);
295294
$path = \trim($path ?? $state->route ?? 'index', '/');
296295
$route = \trim($state->x->comment->route ?? 'comment', '/');
297296
// `/comment/article/lorem-ipsum`

0 commit comments

Comments
 (0)