PluginProbe
Tutor LMS – eLearning and online course solution / 3.4.2
Tutor LMS – eLearning and online course solution v3.4.2
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 3.9.15 3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 All 191 releases
← All changes | classes/Video_Stream.php +0 -33 trunk3.4.2 View file →
@@ -104,36 +104,8 @@
104 104 $this->path = $file_path;
105 105 }
106 106
107 107 /**
108 - * Whether the file is a real video inside the uploads directory.
109 - *
110 - * @since 4.0.2
111 - *
112 - * @param string $file_path file path.
113 - *
114 - * @return bool
115 - */
116 - private function is_allowed_path( $file_path ) {
117 - $real_file = $file_path ? realpath( $file_path ) : false;
118 - if ( ! $real_file || ! is_file( $real_file ) ) {
119 - return false;
120 - }
121 -
122 - $uploads = wp_get_upload_dir();
123 - $real_uploads = ! empty( $uploads['basedir'] ) ? realpath( $uploads['basedir'] ) : false;
124 - if ( ! $real_uploads ) {
125 - return false;
126 - }
127 -
128 - $real_file = wp_normalize_path( $real_file );
129 - $real_uploads = trailingslashit( wp_normalize_path( $real_uploads ) );
130 - $is_allowed = 0 === strpos( $real_file, $real_uploads );
131 -
132 - return (bool) apply_filters( 'tutor_video_stream_is_allowed_path', $is_allowed, $real_file );
133 - }
134 -
135 - /**
136 108 * Open stream
137 109 *
138 110 * @since 1.0.0
139 111 *
@@ -237,13 +209,8 @@
237 209 *
238 210 * @return void
239 211 */
240 212 public function start() {
241 - if ( ! $this->is_allowed_path( $this->path ) ) {
242 - status_header( 403 );
243 - exit;
244 - }
245 -
246 213 $this->open();
247 214 $this->set_header();
248 215 $this->stream();
249 216 $this->end();