mirror of
https://github.com/getgrav/grav.git
synced 2026-07-12 17:52:35 +02:00
Fix for multi-lang issues with Security report
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
- `text` (multiline), `textarea`: 65536
|
||||
3. [](#bugfix)
|
||||
* Fixed issue with `system.cache.gzip: true` resulted in admin "Fetch Failed" for PHP 8.0+
|
||||
* Fix for multi-lang issues with Security Report
|
||||
|
||||
# v1.7.31
|
||||
## 03/14/2022
|
||||
|
||||
@@ -97,7 +97,7 @@ class Security
|
||||
*/
|
||||
public static function detectXssFromPages(Pages $pages, $route = true, callable $status = null)
|
||||
{
|
||||
$routes = $pages->routes();
|
||||
$routes = $pages->getList(null, 0, true);
|
||||
|
||||
// Remove duplicate for homepage
|
||||
unset($routes['/']);
|
||||
@@ -110,26 +110,23 @@ class Security
|
||||
'steps' => count($routes),
|
||||
]);
|
||||
|
||||
foreach ($routes as $path) {
|
||||
foreach (array_keys($routes) as $route) {
|
||||
$status && $status([
|
||||
'type' => 'progress',
|
||||
]);
|
||||
|
||||
try {
|
||||
$page = $pages->get($path);
|
||||
$page = $pages->find($route);
|
||||
if ($page->exists()) {
|
||||
// call the content to load/cache it
|
||||
$header = (array) $page->header();
|
||||
$content = $page->value('content');
|
||||
|
||||
// call the content to load/cache it
|
||||
$header = (array) $page->header();
|
||||
$content = $page->value('content');
|
||||
$data = ['header' => $header, 'content' => $content];
|
||||
$results = static::detectXssFromArray($data);
|
||||
|
||||
$data = ['header' => $header, 'content' => $content];
|
||||
$results = static::detectXssFromArray($data);
|
||||
|
||||
if (!empty($results)) {
|
||||
if ($route) {
|
||||
$list[$page->route()] = $results;
|
||||
} else {
|
||||
$list[$page->filePathClean()] = $results;
|
||||
if (!empty($results)) {
|
||||
$list[$page->rawRoute()] = $results;
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user