Skip to content

Commit

Permalink
Allow arbitrary search regex
Browse files Browse the repository at this point in the history
Closes #492.
  • Loading branch information
nikic committed Dec 9, 2023
1 parent 7cfb405 commit 1ba5a2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apc.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function defaults($d,$v) {
'SORT1' => '/^[AHSMCDTZ]$/', // first sort key
'SORT2' => '/^[DA]$/', // second sort key
'AGGR' => '/^\d+$/', // aggregation by dir level
'SEARCH' => '~^[a-zA-Z0-9/_.-]*$~' // aggregation by dir level
'SEARCH' => '/^.*$/' // search regex
);

// cache scope
Expand Down Expand Up @@ -961,7 +961,7 @@ function block_sort($array1, $array2)
'<option value=500',$MYREQUEST['COUNT']=='500'? ' selected':'','>Top 500</option>',
'<option value=0 ',$MYREQUEST['COUNT']=='0' ? ' selected':'','>All</option>',
'</select>',
'&nbsp; Search: <input name=SEARCH value="',$MYREQUEST['SEARCH'],'" type=text size=25/>',
'&nbsp; Search: <input name=SEARCH value="',isset($MYREQUEST['SEARCH']) ? htmlspecialchars($MYREQUEST['SEARCH']) : '','" type=text size=25/>',
'&nbsp;<input type=submit value="GO!">',
'</form></div>';

Expand Down

0 comments on commit 1ba5a2d

Please sign in to comment.