diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache/apc.php | 8 | ||||
-rw-r--r-- | lib/connector/sabre/auth.php | 2 | ||||
-rw-r--r-- | lib/json.php | 10 | ||||
-rwxr-xr-x | lib/util.php | 7 |
4 files changed, 23 insertions, 4 deletions
diff --git a/lib/cache/apc.php b/lib/cache/apc.php index f814afbe494..b1ce87f5267 100644 --- a/lib/cache/apc.php +++ b/lib/cache/apc.php @@ -44,3 +44,11 @@ class OC_Cache_APC { } } } +if(!function_exists('apc_exists')) { + function apc_exists($keys) + { + $result; + apc_fetch($keys, $result); + return $result; + } +} diff --git a/lib/connector/sabre/auth.php b/lib/connector/sabre/auth.php index 1c7a84f0f2a..ee680391626 100644 --- a/lib/connector/sabre/auth.php +++ b/lib/connector/sabre/auth.php @@ -33,7 +33,7 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic { protected function validateUserPass($username, $password){ OC_Util::setUpFS();//login hooks may need early access to the filesystem if(OC_User::login($username,$password)){ - OC_Util::setUpFS(); + OC_Util::setUpFS($username); return true; } else{ diff --git a/lib/json.php b/lib/json.php index dfc0a7b894e..4eab4fce9f6 100644 --- a/lib/json.php +++ b/lib/json.php @@ -82,6 +82,15 @@ class OC_JSON{ } /** + * Convert OC_L10N_String to string, for use in json encodings + */ + protected static function to_string(&$value){ + if ($value instanceof OC_L10N_String) { + $value = (string)$value; + } + } + + /** * Encode and print $data in json format */ public static function encodedPrint($data,$setContentType=true){ @@ -89,6 +98,7 @@ class OC_JSON{ if($setContentType){ self::setContentTypeHeader(); } + array_walk_recursive($data, array('OC_JSON', 'to_string')); echo json_encode($data); } } diff --git a/lib/util.php b/lib/util.php index 50955ebb87f..0d9f4129442 100755 --- a/lib/util.php +++ b/lib/util.php @@ -426,10 +426,11 @@ class OC_Util { /** * @brief Public function to sanitize HTML * - * This function is used to sanitize HTML and should be applied on any string or array of strings before displaying it on a web page. + * This function is used to sanitize HTML and should be applied on any + * string or array of strings before displaying it on a web page. * * @param string or array of strings - * @return array with sanitized strings or a single sinitized string, depends on the input parameter. + * @return array with sanitized strings or a single sanitized string, depends on the input parameter. */ public static function sanitizeHTML( &$value ){ if (is_array($value) || is_object($value)) array_walk_recursive($value,'OC_Util::sanitizeHTML'); @@ -439,7 +440,7 @@ class OC_Util { /** - * Check if the htaccess file is working buy creating a test file in the data directory and trying to access via http + * Check if the htaccess file is working by creating a test file in the data directory and trying to access via http */ public static function ishtaccessworking() { |