Browse Source

add notice on URL request does not match node settings

main
ghost 1 year ago
parent
commit
38d1649361
  1. 11
      src/webui/search.php

11
src/webui/search.php

@ -50,9 +50,9 @@ $q = !empty($_GET['q']) ? trim($_GET['q']) : '';
$p = !empty($_GET['p']) ? (int) $_GET['p'] : 1; $p = !empty($_GET['p']) ? (int) $_GET['p'] : 1;
// Register new URL by request on enabled // Register new URL by request on enabled
if ($config->webui->search->index->request->url->enabled) if ($config->webui->search->index->request->url->enabled && filter_var($q, FILTER_VALIDATE_URL))
{ {
if (filter_var($q, FILTER_VALIDATE_URL) && preg_match($config->webui->search->index->request->url->regex, $q)) if (preg_match($config->webui->search->index->request->url->regex, $q))
{ {
// Prepare URL // Prepare URL
$url = $q; $url = $q;
@ -93,6 +93,13 @@ if ($config->webui->search->index->request->url->enabled)
); );
} }
} }
else {
$response = sprintf(
_('URL "%s" does not match node settings!'),
htmlentities($q)
);
}
} }
// Extended syntax corrections // Extended syntax corrections

Loading…
Cancel
Save