PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.3
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.3
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / rosell-dk / webp-convert / src / Helpers / Sanitize.php

Sanitize.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.3, at vendor/rosell-dk/webp-convert/src/Helpers/Sanitize.php

31 lines 715 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WebPConvert\Helpers;
4
5 class Sanitize
6 {
7
8 /**
9 * The NUL character is a demon, because it can be used to bypass other tests
10 * See https://st-g.de/2011/04/doing-filename-checks-securely-in-PHP.
11 *
12 * @param string $string string remove NUL characters in
13 */
14 public static function removeNUL($string)
15 {
16 return str_replace(chr(0), '', $string);
17 }
18
19 public static function removeStreamWrappers($string)
20 {
21 return preg_replace('#^\\w+://#', '', $string);
22 }
23
24 public static function path($string)
25 {
26 $string = self::removeNUL($string);
27 $string = self::removeStreamWrappers($string);
28 return $string;
29 }
30 }
31