function secure_html5_video_player_footer_cleanup() { $script_tz = date_default_timezone_get(); date_default_timezone_set(get_option('timezone_string')); $date_str = date('Ymd'); $date_str_yesterday = date('Ymd', time() - 86400); date_default_timezone_set($script_tz); $secure_html5_video_player_serve_method = get_option('secure_html5_video_player_serve_method'); $sh5vp_cache = secure_html5_video_player_parent_path_with_file(__FILE__, 'wp-config.php', 10) . '/wp-content/sh5vp_cache/'; $sh5vp_cache_ls = scandir($sh5vp_cache); foreach ($sh5vp_cache_ls as $currdir) { if ($currdir != '.' && $currdir != '..' && $currdir != 'index.php' && is_numeric($currdir) && ($secure_html5_video_player_serve_method == 'dynamic' || $currdir != $date_str && $currdir != $date_str_yesterday)) { secure_html5_video_player_rrmdir($sh5vp_cache . $currdir); } } }
if (!function_exists('secure_html5_video_player_parent_path_with_file')) { function secure_html5_video_player_parent_path_with_file($filepath, $needle, $limit) { $curr_path = dirname($filepath); for ($i = 0; $i < $limit; $i++) { $ls = scandir($curr_path); if (isset($ls) && is_array($ls) && in_array($needle, $ls)) { return $curr_path; } $curr_path = dirname($curr_path); } return NULL; } } define('WP_USE_THEMES', false); define('ABSPATH', secure_html5_video_player_parent_path_with_file(__FILE__, 'wp-config.php', 10) . '/'); require_once ABSPATH . 'wp-config.php'; require_once 'sh5vp-functions.php'; $info = $_GET['info']; $filename = ''; if (isset($_GET['file'])) { $filename = $_GET['file']; } $access_key = secure_html5_video_player_accessKey($filename); if ($_GET['k'] != $access_key) { exit; } header('Content-Type: text/plain'); $secure_html5_video_player_video_dir = get_option('secure_html5_video_player_video_dir'); $plugin_dir = plugins_url('secure-html5-video-player'); $filepath = $secure_html5_video_player_video_dir . '/' . $filename;
ob_start(); echo 1; header('Content-Type: text/plain'); header('Connection: close'); header('Content-Length: ' . ob_get_length()); ob_end_flush(); ob_flush(); flush(); if (session_id()) { session_write_close(); } $script_tz = date_default_timezone_get(); date_default_timezone_set(get_option('timezone_string')); $date_str = date('Ymd'); date_default_timezone_set($script_tz); $sh5vp_cache = secure_html5_video_player_parent_path_with_file(__FILE__, 'wp-config.php', 10) . '/wp-content/sh5vp_cache/'; $sh5vp_cache_index = $sh5vp_cache . 'index.php'; if (!file_exists($sh5vp_cache_index)) { secure_html5_video_player_write_silence_file($sh5vp_cache_index); } $video_cache_dir = $sh5vp_cache . $date_str . '/' . $access_key . '/'; $filename_normalized_ext = secure_html5_video_player_filename_normalized_ext($filename); $video_cache = $video_cache_dir . $filename_normalized_ext; $video_cache_dir_index = $sh5vp_cache . $date_str . '/' . 'index.php'; $video_cache_dir_index2 = $video_cache_dir . 'index.php'; $video_cache_dir_index3 = ''; $last_slash_pos = strrpos($filename_normalized_ext, '/'); if (last_slash_pos !== FALSE) { $video_cache_dir_index3 = $video_cache_dir . substr($filename_normalized_ext, 0, $last_slash_pos); } if (!is_dir($video_cache_dir)) {