Revert "Implementierung des validators"

This reverts commit 1e6ac0fcd9.
This commit is contained in:
rirat-0
2026-06-17 20:14:59 +02:00
parent 1e6ac0fcd9
commit 1db77346d0
2 changed files with 6 additions and 87 deletions
+6 -12
View File
@@ -1,7 +1,4 @@
<?php
require_once __DIR__ . '/../../validators/search-validator.php';
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
@@ -11,16 +8,11 @@ $query = $_SESSION["search_query"] ?? "";
$totalResultsCount = count($all_results);
$limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 10;
if (!searchLimitValidator($limit)) {
$limit = 10; // Fallback auf Standardwert bei Manipulation
}
if (!empty($query) && !searchQueryValidator($query)) {
$all_results = [];
$totalResultsCount = 0;
$_SESSION["message"] = "missing_parameters";
if (!in_array($limit, [10, 20, 50, 100])) {
$limit = 10;
}
// Gesamtseitenzahl
$totalPages = max(1, ceil($totalResultsCount / $limit));
// Aktuelle Seite auslesen und validieren
@@ -31,8 +23,11 @@ if ($currentPage < 1) {
$currentPage = $totalPages;
}
// Startpunkt im Array berechnen (Offset)
$offset = ($currentPage - 1) * $limit;
// Nur die Ergebnisse für die aktuelle Seite ausschneiden
//$results = array_slice($all_results, $offset, $limit);
$results = $all_results;
$resultCount = count($results);
@@ -83,7 +78,6 @@ $resultCount = count($results);
</div>
</div>
<!-- Dropdown-Menu fuer Filter-Optionen -->
<div class="s-res-sidebar-box">
<h3 class="s-res-sidebar-title">Kategorie filtern</h3>
<select id="category-filter" class="s-res-limit-select" style="width: 100%; padding: 8px; border-radius: 6px; border: 1px solid #cbd5e1;">