From 457f8c3e957859972b6b0c8a235d38da0986bcbf Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 18 Aug 2011 19:14:13 -0700 Subject: use mb_strlen when iterating utf8 --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index 803bf0e51..b13cf980f 100644 --- a/include/text.php +++ b/include/text.php @@ -147,7 +147,7 @@ if(! function_exists('xmlify')) { function xmlify($str) { $buffer = ''; - for($x = 0; $x < strlen($str); $x ++) { + for($x = 0; $x < mb_strlen($str); $x ++) { $char = $str[$x]; switch( $char ) { -- cgit v1.2.3 From 0d9d576aa642e02eb8673aa20bdf4b6a18ae6bc3 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 20 Aug 2011 04:53:11 -0700 Subject: move encryption functions to crypto file --- include/text.php | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index b13cf980f..66447069e 100644 --- a/include/text.php +++ b/include/text.php @@ -620,32 +620,6 @@ function valid_email($x){ }} -if(! function_exists('aes_decrypt')) { -function aes_decrypt($val,$ky) -{ - $key="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; - for($a=0;$a=0 and ord(substr($dec, strlen($dec)-1,1))<=16)? chr(ord( substr($dec,strlen($dec)-1,1))):null)); -}} - - -if(! function_exists('aes_encrypt')) { -function aes_encrypt($val,$ky) -{ - $key="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; - for($a=0;$a strlen($text)) return false; - if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return false; - return substr($text, 0, -1 * $pad); -} - function base64url_encode($s, $strip_padding = false) { -- cgit v1.2.3