PluginProbe
VikBooking Hotel Booking Engine & PMS / trunk
VikBooking Hotel Booking Engine & PMS vtrunk
1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 All 36 releases
vikbooking / libraries / adapter / component / helper.php

helper.php in VikBooking Hotel Booking Engine & PMS trunk, at libraries/adapter/component/helper.php

84 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package VikWP - Libraries
4 * @subpackage adapter.component
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2023 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 JLoader::import('adapter.component.registry');
15
16 /**
17 * Component helper class
18 *
19 * @since 10.0
20 */
21 class JComponentHelper
22 {
23 /**
24 * Gets the parameter object for the component.
25 *
26 * @param string $option The option for the component.
27 * @param boolean $strict If set and the component does not exist, false will be returned.
28 *
29 * @return JComponentRegistry
30 */
31 public static function getParams($option, $strict = false)
32 {
33 return new JComponentRegistry($option);
34 }
35
36 /**
37 * Get the component information.
38 *
39 * @param string $option The component option.
40 * @param boolean $strict If set and the component does not exist, the enabled attribute will be set to false.
41 *
42 * @return mixed An object with the information for the component.
43 *
44 * @since 10.1.16
45 */
46 public static function getComponent($option, $strict = false)
47 {
48 // always return NULL on WordPress to avoid triggering native Joomla updates
49 return null;
50 }
51
52 /**
53 * Applies the global text filters to arbitrary text as per settings for current user groups.
54 *
55 * @param string $text The string to filter.
56 *
57 * @return string The filtered string.
58 *
59 * @since 10.1.33
60 */
61 public static function filterText($text)
62 {
63 // get all tags and attributes supported by WordPress
64 $allowed = wp_kses_allowed_html('post');
65
66 // always support iframe, mainly for YouTube videos
67 $allowed['iframe'] = array(
68 'name' => true,
69 'src' => true,
70 'width' => true,
71 'height' => true,
72 'allow' => true,
73 'allowfullscreen' => true,
74 );
75
76 /**
77 * Sanitize HTML by using wp_kses.
78 * It is possible to extend the supported HTML tags by
79 * using the "wp_kses_allowed_html" hook.
80 */
81 return wp_kses(wp_unslash($text), $allowed);
82 }
83 }
84