Lines Matching full:if
37 if ($base == '' || $base == '/') {
43 if (!$dh) return;
45 if (preg_match('/^[\._]/', $file)) continue; //skip hidden files and upper dirs
46 if (is_dir($base . '/' . $dir . '/' . $file)) {
54 if (!empty($sort)) {
55 if ($sort == 'date') {
65 if (call_user_func_array($func, [&$data, $base, $dir, 'd', $lvl, $opts])) {
79 * decide if this directory should be traversed (true) or not (false)
177 * $opts['showmsg'] shows message if invalid media id is used
197 if ($type == 'd') {
198 if (empty($opts['depth'])) return true; // recurse forever
200 if ($depth >= $opts['depth']) return false; // depth reached
206 if ($info['id'] !== cleanID($info['id'])) {
207 if (!empty($opts['showmsg']))
214 if (empty($opts['skipacl']) && $info['perm'] < AUTH_READ) {
219 if (!empty($opts['pattern']) && !@preg_match($opts['pattern'], $info['id'])) {
227 if (preg_match("/\.(jpe?g|gif|png)$/", $file)) {
233 if (!empty($opts['hash'])) {
245 * $opts['showmsg'] shows message if invalid media id is used
265 if ($type == 'd') {
266 if (empty($opts['depth'])) return true; // recurse forever
268 if ($depth >= $opts['depth']) return false; // depth reached
273 if ($id != cleanID($id)) {
274 if ($opts['showmsg'])
281 if (empty($opts['skipacl']) && $info['perm'] < AUTH_READ) {
286 if (!empty($opts['pattern']) && !@preg_match($opts['pattern'], $id)) {
312 if ($type == 'd') return false;
314 if (str_ends_with($file, '.txt')) {
317 if (auth_quickaclcheck($id) < AUTH_READ) {
344 if ($type == 'd') return true;
346 if (!str_ends_with($file, '.txt')) return true;
349 if (!empty($opts['query'])) {
350 if (strpos($file, (string) $opts['query']) !== false) {
353 if (auth_quickaclcheck($id) < AUTH_READ) {
382 if (($opts['depth'] ?? 0) > 0) {
384 if (
393 if ($type == 'd') {
398 if (!str_ends_with($file, '.txt')) return true;
402 if (empty($opts['skipacl']) && auth_quickaclcheck($item['id']) < AUTH_READ) {
409 if (!empty($opts['hash'])) {
434 if ($a['count'] > $b['count']) {
458 if (!$keeptxt) $id = preg_replace('#\.txt$#', '', $id);
496 * @return bool if this directory should be traversed (true) or not (false)
506 // get ID and check if it is a valid one
508 if ($item['id'] !== cleanID($item['id'])) {
509 if (!empty($opts['showmsg'])) {
516 if ($type == 'd') {
517 // decide if to recursion into this directory is wanted
518 if (empty($opts['depth'])) {
522 if ($depth >= $opts['depth']) {
529 if ($return) {
531 if (!$match) {
538 if (empty($opts['skipacl'])) {
539 if ($type == 'd') {
549 if ($type == 'd') {
550 if (empty($opts['listdirs'])) return $return;
552 …if (empty($opts['skipacl']) && !empty($opts['sneakyacl']) && $item['perm'] < AUTH_READ) return fal…
553 …if (!empty($opts['dirmatch']) && !preg_match('/' . $opts['dirmatch'] . '/', $file)) return $return;
554 …if (!empty($opts['nsmatch']) && !preg_match('/' . $opts['nsmatch'] . '/', $item['ns'])) return $re…
556 if (empty($opts['listfiles'])) return $return;
557 if (empty($opts['skipacl']) && $item['perm'] < AUTH_READ) return $return;
558 if (!empty($opts['pagesonly']) && !str_ends_with($file, '.txt')) return $return;
559 if (empty($opts['showhidden']) && isHiddenPage($item['id'])) return $return;
560 …if (!empty($opts['filematch']) && !preg_match('/' . $opts['filematch'] . '/', $file)) return $retu…
561 …if (!empty($opts['idmatch']) && !preg_match('/' . $opts['idmatch'] . '/', $item['id'])) return $re…
569 if (!empty($opts['meta'])) {
578 if ($type == 'f') {
579 if (!empty($opts['hash'])) $item['hash'] = md5(io_readFile($base . '/' . $file, false));
580 …if (!empty($opts['firsthead'])) $item['title'] = p_get_first_heading($item['id'], METADATA_DONT_RE…