PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / sabre / vobject / lib / StringUtil.php
ameliabooking / vendor / sabre / vobject / lib Last commit date
Component 1 year ago ITip 1 year ago Parser 1 year ago Property 1 year ago Recur 1 year ago Splitter 1 year ago TimezoneGuesser 1 year ago timezonedata 1 year ago BirthdayCalendarGenerator.php 1 year ago Cli.php 1 year ago Component.php 1 year ago DateTimeParser.php 1 year ago Document.php 1 year ago ElementList.php 1 year ago EofException.php 1 year ago FreeBusyData.php 1 year ago FreeBusyGenerator.php 1 year ago InvalidDataException.php 1 year ago Node.php 1 year ago PHPUnitAssertions.php 1 year ago Parameter.php 1 year ago ParseException.php 1 year ago Property.php 1 year ago Reader.php 1 year ago Settings.php 1 year ago StringUtil.php 1 year ago TimeZoneUtil.php 1 year ago UUIDUtil.php 1 year ago VCardConverter.php 1 year ago Version.php 1 year ago Writer.php 1 year ago
StringUtil.php
51 lines
1 <?php
2
3 namespace Sabre\VObject;
4
5 /**
6 * Useful utilities for working with various strings.
7 *
8 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
9 * @author Evert Pot (http://evertpot.com/)
10 * @license http://sabre.io/license/ Modified BSD License
11 */
12 class StringUtil
13 {
14 /**
15 * Returns true or false depending on if a string is valid UTF-8.
16 *
17 * @param string $str
18 *
19 * @return bool
20 */
21 public static function isUTF8($str)
22 {
23 // Control characters
24 if (preg_match('%[\x00-\x08\x0B-\x0C\x0E\x0F]%', $str)) {
25 return false;
26 }
27
28 return (bool) preg_match('%%u', $str);
29 }
30
31 /**
32 * This method tries its best to convert the input string to UTF-8.
33 *
34 * Currently only ISO-5991-1 input and UTF-8 input is supported, but this
35 * may be expanded upon if we receive other examples.
36 *
37 * @param string $str
38 *
39 * @return string
40 */
41 public static function convertToUTF8($str)
42 {
43 if (!mb_check_encoding($str, 'UTF-8') && mb_check_encoding($str, 'ISO-8859-1')) {
44 $str = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1');
45 }
46
47 // Removing any control characters
48 return preg_replace('%(?:[\x00-\x08\x0B-\x0C\x0E-\x1F\x7F])%', '', $str);
49 }
50 }
51