PluginProbe
WP Courses LMS – Online Courses Builder, eLearning Courses, Courses Solution, Education Courses / trunk
WP Courses LMS – Online Courses Builder, eLearning Courses, Courses Solution, Education Courses vtrunk
3.2.30 trunk 3.1.40 3.1.41 3.1.42 3.1.43 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.23 3.2.24 3.2.25 All 36 releases
wp-courses / functions / security.php

security.php in WP Courses LMS – Online Courses Builder, eLearning Courses, Courses Solution, Education Courses trunk, at functions/security.php

84 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // sanitizes lesson video output
4 function wpc_sanitize_video($video) {
5 $video = wp_kses($video,
6 array(
7 'iframe' => array(
8 'src' => true,
9 'width' => true,
10 'height' => true,
11 'title' => true,
12 'frameborder' => true,
13 'allow' => true,
14 'allowfullscreen' => true
15 ),
16 'video' => array(
17 'autopictureinpicture' => true,
18 'controls' => true,
19 'controlslist' => true,
20 'crossorigin' => true,
21 'disablepictureinpicture' => true,
22 'disableremoteplayback' => true,
23 'height' => true,
24 'loop' => true,
25 'muted' => true,
26 'playsinline' => true,
27 'poster' => true,
28 'preload' => true,
29 'src' => true,
30 'width' => true
31 ),
32 'source' => array(
33 'src' => true,
34 'type' => true
35 )
36 )
37 );
38
39 if( strpos($video, 'javascript:') === false ){
40 return $video;
41 } else {
42 return;
43 }
44
45 }
46
47 function wpc_video_and_content_kses(){
48
49 $allowed = wp_kses_allowed_html( 'post' );
50 $allowed['style'] = array();
51 $allowed['iframe'] = array(
52 'src' => true,
53 'width' => true,
54 'height' => true,
55 'title' => true,
56 'frameborder' => true,
57 'allow' => true,
58 'allowfullscreen' => true
59 );
60 $allowed['video'] = array(
61 'autopictureinpicture' => true,
62 'controls' => true,
63 'controlslist' => true,
64 'crossorigin' => true,
65 'disablepictureinpicture' => true,
66 'disableremoteplayback' => true,
67 'height' => true,
68 'loop' => true,
69 'muted' => true,
70 'playsinline' => true,
71 'poster' => true,
72 'preload' => true,
73 'src' => true,
74 'width' => true
75 );
76 $allowed['source'] = array(
77 'src' => true,
78 'type' => true
79 );
80
81 return $allowed;
82 }
83
84 ?>