} if (!preg_match("/^[a-z_]+\$/i", $module_name)) { die('unallowed characters in module name.'); } if (!preg_match("/^[a-z\\._\\-]+\$/i", $file_name) || stristr($file_name, '..')) { die("unallowed characters in language file name: '{$file_name}'"); } if ($module_name == 'global') { $langfile_path = trim(ISPC_LIB_PATH . "/lang/" . $selected_language . ".lng"); } else { $langfile_path = trim(ISPC_WEB_PATH . '/' . $module_name . '/lib/lang/' . $file_name); } } elseif (is_array($parts) && count($parts) > 1 && $parts[0] == '---' && $parts[1] == 'EOF') { // EOF line, ignore it. } else { $line = validate_line($line); if ($line === false) { $error .= "Language file contains invalid language entry on line {$ln}.<br />"; } else { $buffer .= $line . "\n"; } } } } } } $app->tpl->setVar('msg', $msg); $app->tpl->setVar('error', $error); //* SET csrf token $csrf_token = $app->auth->csrf_token_get('language_import'); $app->tpl->setVar('_csrf_id', $csrf_token['csrf_id']);
*/ $fd = fopen('php://stdin', 'r'); if (!$fd) { exit; } $FULLME = 'cron'; require_once dirname(dirname(__FILE__)) . '/config.php'; require_once $CFG->dirroot . '/lib/uploadlib.php'; // contains virus handling stuff. $site = get_site(); while (!feof($fd)) { $entry = fgets($fd); if (strlen(trim($entry)) == 0) { continue; } if (!($file = validate_line($entry))) { continue; } $bits = explode('/', $file); $a->filename = $bits[count($bits) - 1]; if (!($log = get_record("log", "module", "upload", "info", $file, "action", "upload"))) { $a->action = clam_handle_infected_file($file, 0, false); clam_replace_infected_file($file); notify_admins_unknown($file, $a); continue; } $action = clam_handle_infected_file($file, $log->userid, true); clam_replace_infected_file($file); $user = get_record("user", "id", $log->userid); $course = get_record("course", "id", $log->course); $subject = get_string('virusfoundsubject', 'moodle', format_string($site->fullname));