aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-08-22 13:56:08 +0200
committerfabrixxm <fabrix.xm@gmail.com>2011-08-22 13:56:08 +0200
commitd8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75 (patch)
treedbdc1dbffe5c56dcff18669e957f679b5ae37bb3 /include/text.php
parentafdc639f17f0f5e12f291b512ccc12b3df6b2acf (diff)
parent564ade0685470158ac487d9a9f18a21079c729bb (diff)
downloadvolse-hubzilla-d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75.tar.gz
volse-hubzilla-d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75.tar.bz2
volse-hubzilla-d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75.zip
Merge branch 'master' into newui
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php42
1 files changed, 1 insertions, 41 deletions
diff --git a/include/text.php b/include/text.php
index 803bf0e51..66447069e 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 ) {
@@ -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<strlen($ky);$a++)
- $key[$a%16]=chr(ord($key[$a%16]) ^ ord($ky[$a]));
- $mode = MCRYPT_MODE_ECB;
- $enc = MCRYPT_RIJNDAEL_128;
- $dec = @mcrypt_decrypt($enc, $key, $val, $mode, @mcrypt_create_iv( @mcrypt_get_iv_size($enc, $mode), MCRYPT_DEV_URANDOM ) );
- return rtrim($dec,(( ord(substr($dec,strlen($dec)-1,1))>=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($ky);$a++)
- $key[$a%16]=chr(ord($key[$a%16]) ^ ord($ky[$a]));
- $mode=MCRYPT_MODE_ECB;
- $enc=MCRYPT_RIJNDAEL_128;
- $val=str_pad($val, (16*(floor(strlen($val) / 16)+(strlen($val) % 16==0?2:1))), chr(16-(strlen($val) % 16)));
- return mcrypt_encrypt($enc, $key, $val, $mode, mcrypt_create_iv( mcrypt_get_iv_size($enc, $mode), MCRYPT_DEV_URANDOM));
-}}
-
-
/**
*
* Function: linkify
@@ -903,20 +877,6 @@ function generate_user_guid() {
}
-function pkcs5_pad ($text, $blocksize)
-{
- $pad = $blocksize - (strlen($text) % $blocksize);
- return $text . str_repeat(chr($pad), $pad);
-}
-
-function pkcs5_unpad($text)
-{
- $pad = ord($text{strlen($text)-1});
- if ($pad > 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) {