ShadowInTheDark /impact/lib/weltmeister/api/glob.php

Language PHP Lines 18
MD5 Hash 36b544ba45e09f150688fa8bf5f882d2
Repository https://github.com/jrittelmeyer/ShadowInTheDark.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<?php 
require_once( 'config.php' );

$globs = is_array($_GET['glob']) ? $_GET['glob'] : array($_GET['glob']);
$files = array();
foreach( $globs as $glob ) {
    $pattern = WM_Config::$fileRoot . str_replace( '..', '', $glob );
    $files = array_merge( $files, (array)glob( $pattern ) );
}

$fileRootLength = strlen( WM_Config::$fileRoot );
foreach( $files as $i => $f ) {
	$files[$i] = substr( $f, $fileRootLength );
}

echo json_encode( $files );

?>
Back to Top