-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved all non-store related function to there proper location.
- Loading branch information
1 parent
8f3031f
commit 0913837
Showing
2 changed files
with
38 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
class expString { | ||
|
||
static function convertUTF($string) { | ||
return $string = str_replace('?', '', htmlspecialchars($string, ENT_IGNORE, 'UTF-8')); | ||
} | ||
|
||
static function validUTF($string) { | ||
if(!mb_check_encoding($string, 'UTF-8') OR !($string === mb_convert_encoding(mb_convert_encoding($string, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
static function onlyReadables($string) { | ||
for ($i=0;$i<strlen($string);$i++) { | ||
$chr = $string{$i}; | ||
$ord = ord($chr); | ||
if ($ord<32 or $ord>126) { | ||
$chr = "~"; | ||
$string{$i} = $chr; | ||
} | ||
} | ||
return str_replace("~", "", $string); | ||
} | ||
|
||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters