$filename) { if (! preg_match("@^\.+$@", $filename) && preg_match("@^[\w\.-]+$@", $filename) ) { // Disallow "." and ".." alone // Allow alphanumeric, "." and "-" chars only $script_name .= DIRECTORY_SEPARATOR . $filename; } } // Output file contents if (preg_match("@\.js$@", $script_name) && is_readable($script_name)) { readfile($script_name); echo ";\n\n"; } } } ?>