Skip to content

Commit

Permalink
media button to deep search close #442
Browse files Browse the repository at this point in the history
 + fix deep search regex issues using preg_quote!
  • Loading branch information
vincent-peugnet committed Oct 16, 2024
1 parent 9831e14 commit ae102dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/class/Modelpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ protected function deepsearch(array $pagelist, string $regex, array $options): a
} else {
$case = 'i';
}
$regex = '/' . $regex . '/' . $case;
$regex = '/' . preg_quote($regex, '/') . '/';
$pageselected = [];
foreach ($pagelist as $page) {
$count = 0;
Expand Down
9 changes: 9 additions & 0 deletions app/view/templates/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
</th>
<th>user</th>
<th>perms</th>
<th>s</th>
<th>code</th>
</tr>
</thead>
Expand Down Expand Up @@ -204,6 +205,14 @@
<td class="nowrap" title="<?= $media->date('dmy') ?> <?= $media->date('ptime') ?>"><?= $media->date('hrdi') ?></td>
<td><?= $media->uid('name') ?></td>
<td><code><?= $media->permissions() ?></code></td>
<td>
<a
href="<?= $this->url('home', [], '?search=' . $media->getlocalpath() . '&id=1&title=1&description=1&content=1&other=1&case=1&submit=reset') ?>"
title="search if this media is used in your pages"
>
<i class="fa fa-search"></i>
</a>
</td>
<td>
<code class="select-all"><?= $this->e($media->getcode()) ?></code>
</td>
Expand Down

0 comments on commit ae102dc

Please sign in to comment.