mirror of
https://github.com/danpros/htmly.git
synced 2026-04-19 12:06:22 +05:30
Cleaning up
This commit is contained in:
parent
416ce7e270
commit
5804cbcdd7
7 changed files with 28 additions and 28 deletions
|
|
@ -1325,16 +1325,16 @@ function get_keyword($keyword, $page, $perpage)
|
|||
|
||||
foreach ($posts as $index => $v) {
|
||||
|
||||
$filepath = $v['dirname'] . '/' . $v['basename'];
|
||||
$filepath = $v['dirname'] . '/' . $v['basename'];
|
||||
|
||||
$findRxWhole = '\b' . preg_quote($keyword, '~') . '\b'; // Add word boundaries (find whole-words only)
|
||||
$findRxWhole = '\b' . preg_quote($keyword, '~') . '\b'; // Add word boundaries (find whole-words only)
|
||||
|
||||
$findRx = "~{$findRxWhole}~iu"; // Case-insensitive and UTF-8 mode
|
||||
$findRx = "~{$findRxWhole}~iu"; // Case-insensitive and UTF-8 mode
|
||||
|
||||
$lines = file($filepath);
|
||||
$lines = file($filepath);
|
||||
|
||||
foreach ($lines as $line) {
|
||||
if (preg_match ($findRx, $line)) {
|
||||
if (preg_match ($findRx, $line)) {
|
||||
if (!in_array($v, $tmp)) {
|
||||
$tmp[] = $v;
|
||||
}
|
||||
|
|
@ -1519,21 +1519,21 @@ function keyword_count($keyword)
|
|||
|
||||
foreach ($posts as $index => $v) {
|
||||
|
||||
$filepath = $v['dirname'] . '/' . $v['basename'];
|
||||
$filepath = $v['dirname'] . '/' . $v['basename'];
|
||||
|
||||
$findRxWhole = '\b' . preg_quote($keyword, '~') . '\b'; // Add word boundaries (find whole-words only)
|
||||
$findRxWhole = '\b' . preg_quote($keyword, '~') . '\b'; // Add word boundaries (find whole-words only)
|
||||
|
||||
$findRx = "~{$findRxWhole}~iu"; // Case-insensitive and UTF-8 mode
|
||||
$findRx = "~{$findRxWhole}~iu"; // Case-insensitive and UTF-8 mode
|
||||
|
||||
$lines = file($filepath);
|
||||
$lines = file($filepath);
|
||||
|
||||
foreach ($lines as $line) {
|
||||
if (preg_match ($findRx, $line)) {
|
||||
if (!in_array($v, $tmp)) {
|
||||
$tmp[] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($lines as $line) {
|
||||
if (preg_match ($findRx, $line)) {
|
||||
if (!in_array($v, $tmp)) {
|
||||
$tmp[] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tmp = array_unique($tmp, SORT_REGULAR);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ function login()
|
|||
}
|
||||
}
|
||||
|
||||
if (rtrim($_SERVER['REQUEST_URI'], '/') != rtrim(site_path() . '/login-mfa', '/')) {
|
||||
if (rtrim($_SERVER['REQUEST_URI'], '/') != site_path() . '/login-mfa') {
|
||||
if (isset($_SESSION['mfa_pwd']) && isset($_SESSION['mfa_uid'])) {
|
||||
unset($_SESSION['mfa_pwd']);
|
||||
unset($_SESSION['mfa_uid']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue