1 | <?php |
||
11 | abstract class NativeGenerator |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * Make data "safe" - all dangerous html/js/etc will be removed |
||
16 | * @param string $data |
||
17 | * @param bool $quotes |
||
18 | * @return string |
||
19 | */ |
||
20 | public static function safe($data, $quotes = false) |
||
25 | |||
26 | /** |
||
27 | * Remove all html tags from data |
||
28 | * @param string $data |
||
29 | * @return string |
||
30 | */ |
||
31 | public static function nohtml($data) |
||
35 | |||
36 | /** |
||
37 | * Build property for html element from array. |
||
38 | * IMPORTANT: $property can be null-string (some times this happend's) - do not remove NULL!! |
||
39 | * @param array $property |
||
40 | * @return null|string |
||
41 | */ |
||
42 | public static function applyProperty(array $property = null) |
||
58 | |||
59 | /** |
||
60 | * Fast building single tag based on property's array |
||
61 | * @param string $tagName |
||
62 | * @param array|null $property |
||
63 | * @return string |
||
64 | */ |
||
65 | public static function buildSingleTag($tagName, array $property = null) |
||
69 | |||
70 | /** |
||
71 | * Fast building container type tag based on property's and value |
||
72 | * @param string $tagName |
||
73 | * @param array|null $property |
||
74 | * @param null|string $value |
||
75 | * @param bool $valueHtml |
||
76 | * @return string |
||
77 | */ |
||
78 | public static function buildContainerTag($tagName, array $property = null, $value = null, $valueHtml = false) |
||
86 | |||
87 | /** |
||
88 | * Make parts of URI safe and usable |
||
89 | * @param string $string |
||
90 | * @param bool $encode |
||
91 | * @return string |
||
92 | */ |
||
93 | public static function safeUri($string, $encode = true) |
||
102 | |||
103 | /** |
||
104 | * Check if uri $source is equal to current uri point with array of $aliases and active $order set |
||
105 | * @param null $source |
||
106 | * @param array|null $aliases |
||
107 | * @param bool $order |
||
108 | * @return bool |
||
109 | */ |
||
110 | public static function isCurrentLink($source = null, array $aliases = null, $order = false) |
||
163 | |||
164 | /** |
||
165 | * Apply security for string to output as html |
||
166 | * @param string|null $object |
||
167 | * @param bool $html |
||
168 | * @param bool $secure |
||
169 | * @return null|string |
||
170 | */ |
||
171 | public static function applyEscape($object = null, $html = false, $secure = false) |
||
182 | |||
183 | /** |
||
184 | * Convert link-binding type to classic link with security filter |
||
185 | * @param string|array $uri |
||
186 | * @return string |
||
187 | */ |
||
188 | public static function convertLink($uri) |
||
202 | |||
203 | |||
204 | } |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.