Commit 3a1cb9e5 authored by Alexandre Bailly's avatar Alexandre Bailly

Rewriting of part of the tests for the search. That should solve the last issues encountered.

parent 4758c1d8
Pipeline #8484 passed with stage
in 32 seconds
......@@ -80,8 +80,14 @@
<?php
$hasResults = false;
$searchCriteria = '';
if(!isset($_GET['frame']) || isset($_GET['s'])) {
if(!isset($_GET['frame']))
$searchCriteria = '§*§'; //We have some titles with one or more'*' in them.
if(isset($_GET['s']) && $_GET['s'] !== '')
$searchCriteria = iconv('UTF-8', 'ASCII//TRANSLIT',$_GET['s']);
if($showall || $searchCriteria !== '') {
// Output list of videos
foreach ($names as $series => $video_array)
{
......@@ -93,11 +99,12 @@
// Skip r18 if not defined
if(!isset($_GET['r18']) && isset($data['r18'])) continue;
if(!isset($_GET['frame'])
|| (stripos($series, $_GET['s']) !== false)
|| (stripos(iconv('UTF-8', 'ASCII//TRANSLIT',$data['song']['title']), iconv('UTF-8', 'ASCII//TRANSLIT',$_GET['s'])) !== false)
|| (stripos(iconv('UTF-8', 'ASCII//TRANSLIT',$data['song']['artist']), iconv('UTF-8', 'ASCII//TRANSLIT',$_GET['s'])) !== false)
|| (stripos(iconv('UTF-8', 'ASCII//TRANSLIT',$data['subtitles']), iconv('UTF-8', 'ASCII//TRANSLIT',$_GET['s'])) !== false)
if(
$searchCriteria === '§*§'
|| (stripos(iconv('UTF-8', 'ASCII//TRANSLIT',$series), $searchCriteria) !== false)
|| (stripos(iconv('UTF-8', 'ASCII//TRANSLIT',$data['song']['title']), $searchCriteria) !== false)
|| (stripos(iconv('UTF-8', 'ASCII//TRANSLIT',$data['song']['artist']), $searchCriteria) !== false)
|| (stripos(iconv('UTF-8', 'ASCII//TRANSLIT',$data['subtitles']), $searchCriteria) !== false)
) {
// Generate HTML for each video
$html .= ' <i class="fa fa-plus" data-file="' . htmlspecialchars($data['file']) . '" data-mime="' . htmlspecialchars(json_encode($data['mime'])) . '"';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment