diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-10-24 15:32:29 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-10-24 15:32:29 +0200 |
commit | 7b150dfa963d81889b8d40bf3956795c9a712aec (patch) | |
tree | 30b73d83b7e59791848480a741390060d60c7605 /lib | |
parent | 56c7ee799cb13f7a4db60663f60b76cdf223614b (diff) | |
parent | 41898a473e8ece37c92e709f685c90d7952d1694 (diff) | |
download | nextcloud-server-7b150dfa963d81889b8d40bf3956795c9a712aec.tar.gz nextcloud-server-7b150dfa963d81889b8d40bf3956795c9a712aec.zip |
merge master into filesystem
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/app.php | 7 | ||||
-rw-r--r-- | lib/appconfig.php | 2 | ||||
-rw-r--r-- | lib/base.php | 2 | ||||
-rw-r--r-- | lib/eventsource.php | 6 | ||||
-rw-r--r-- | lib/filechunking.php | 2 | ||||
-rw-r--r-- | lib/fileproxy.php | 4 | ||||
-rw-r--r-- | lib/files.php | 6 | ||||
-rw-r--r-- | lib/helper.php | 10 | ||||
-rw-r--r-- | lib/l10n.php | 7 | ||||
-rw-r--r-- | lib/migrate.php | 4 | ||||
-rw-r--r-- | lib/ocsclient.php | 26 | ||||
-rw-r--r-- | lib/updater.php | 2 | ||||
-rw-r--r-- | lib/user.php | 6 | ||||
-rwxr-xr-x | lib/util.php | 8 | ||||
-rw-r--r-- | lib/vobject.php | 14 |
15 files changed, 54 insertions, 52 deletions
diff --git a/lib/app.php b/lib/app.php index 03f4a1316bd..393eac87911 100755 --- a/lib/app.php +++ b/lib/app.php @@ -549,17 +549,14 @@ class OC_App{ foreach ( OC::$APPSROOTS as $apps_dir ) { if(! is_readable($apps_dir['path'])) { - OC_Log::write('core', 'unable to read app folder : ' .$apps_dir['path'] , OC_Log::WARN); + OC_Log::write('core', 'unable to read app folder : ' .$apps_dir['path'], OC_Log::WARN); continue; } $dh = opendir( $apps_dir['path'] ); while( $file = readdir( $dh ) ) { - if ( - $file[0] != '.' - and is_file($apps_dir['path'].'/'.$file.'/appinfo/app.php' ) - ) { + if ($file[0] != '.' and is_file($apps_dir['path'].'/'.$file.'/appinfo/app.php')) { $apps[] = $file; diff --git a/lib/appconfig.php b/lib/appconfig.php index 6604e854d55..ed0e8f1d0bd 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -123,7 +123,7 @@ class OC_Appconfig{ */ public static function setValue( $app, $key, $value ) { // Does the key exist? yes: update. No: insert - if(! self::hasKey($app,$key)) { + if(! self::hasKey($app, $key)) { $query = OC_DB::prepare( 'INSERT INTO `*PREFIX*appconfig` ( `appid`, `configkey`, `configvalue` ) VALUES( ?, ?, ? )' ); $query->execute( array( $app, $key, $value )); } diff --git a/lib/base.php b/lib/base.php index 6c291b6457c..778f0fe7326 100644 --- a/lib/base.php +++ b/lib/base.php @@ -182,7 +182,7 @@ class OC{ OC::$SERVERROOT.'/lib'.PATH_SEPARATOR. OC::$SERVERROOT.'/config'.PATH_SEPARATOR. OC::$THIRDPARTYROOT.'/3rdparty'.PATH_SEPARATOR. - implode($paths,PATH_SEPARATOR).PATH_SEPARATOR. + implode($paths, PATH_SEPARATOR).PATH_SEPARATOR. get_include_path().PATH_SEPARATOR. OC::$SERVERROOT ); diff --git a/lib/eventsource.php b/lib/eventsource.php index 900b5b101e6..3bada131bdd 100644 --- a/lib/eventsource.php +++ b/lib/eventsource.php @@ -38,7 +38,7 @@ class OC_EventSource{ if($this->fallback) { $this->fallBackId=$_GET['fallback_id']; header("Content-Type: text/html"); - echo str_repeat('<span></span>'.PHP_EOL,10); //dummy data to keep IE happy + echo str_repeat('<span></span>'.PHP_EOL, 10); //dummy data to keep IE happy }else{ header("Content-Type: text/event-stream"); } @@ -78,6 +78,6 @@ class OC_EventSource{ * close the connection of the even source */ public function close() { - $this->send('__internal__','close');//server side closing can be an issue, let the client do it + $this->send('__internal__', 'close');//server side closing can be an issue, let the client do it } -}
\ No newline at end of file +} diff --git a/lib/filechunking.php b/lib/filechunking.php index e616e3b12d8..d63a0d72c83 100644 --- a/lib/filechunking.php +++ b/lib/filechunking.php @@ -59,7 +59,7 @@ class OC_FileChunking { for($i=0; $i < $this->info['chunkcount']; $i++) { $chunk = $cache->get($prefix.$i); $cache->remove($prefix.$i); - $count += fwrite($f,$chunk); + $count += fwrite($f, $chunk); } return $count; } diff --git a/lib/fileproxy.php b/lib/fileproxy.php index 17380c656a3..3e7f1aa1c41 100644 --- a/lib/fileproxy.php +++ b/lib/fileproxy.php @@ -52,7 +52,7 @@ class OC_FileProxy{ * this implements a dummy proxy for all operations */ public function __call($function,$arguments) { - if(substr($function,0,3)=='pre') { + if(substr($function, 0, 3)=='pre') { return true; }else{ return $arguments[1]; @@ -70,7 +70,7 @@ class OC_FileProxy{ public static function getProxies($operation) { $proxies=array(); foreach(self::$proxies as $proxy) { - if(method_exists($proxy,$operation)) { + if(method_exists($proxy, $operation)) { $proxies[]=$proxy; } } diff --git a/lib/files.php b/lib/files.php index a5eec1f2a63..ff9befa89e5 100644 --- a/lib/files.php +++ b/lib/files.php @@ -141,8 +141,8 @@ class OC_Files { /** * return the content of a file or return a zip file containning multiply files * - * @param dir $dir - * @param file $file ; seperated list of files to download + * @param string $dir + * @param string $file ; seperated list of files to download * @param boolean $only_header ; boolean to only send header of the request */ public static function get($dir, $files, $only_header = false) { @@ -162,7 +162,7 @@ class OC_Files { foreach ($files as $file) { $file = $dir . '/' . $file; if (\OC\Files\Filesystem::is_file($file)) { - $tmpFile = OC_F\OC\Files\Filesystemilesystem::toTmpFile($file); + $tmpFile = \OC\Files\Filesystem::toTmpFile($file); self::$tmpFiles[] = $tmpFile; $zip->addFile($tmpFile, basename($file)); } elseif (\OC\Files\Filesystem::is_dir($file)) { diff --git a/lib/helper.php b/lib/helper.php index 1951a742a21..6bbcd6c19d9 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -274,18 +274,18 @@ class OC_Helper { if($file != '.' && $file != '..') { $fullpath = $path.'/'.$file; if(is_link($fullpath)) - return FALSE; + return false; elseif(!is_dir($fullpath) && !@chmod($fullpath, $filemode)) - return FALSE; + return false; elseif(!self::chmodr($fullpath, $filemode)) - return FALSE; + return false; } } closedir($dh); if(@chmod($path, $filemode)) - return TRUE; + return true; else - return FALSE; + return false; } /** diff --git a/lib/l10n.php b/lib/l10n.php index 41c89a7d4b5..f1a2523c307 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -223,7 +223,12 @@ class OC_L10N{ $locales[] = $locales[0].'_'.strtoupper($locales[0]); } setlocale(LC_TIME, $locales); - return strftime($this->localizations[$type], $data); + $format = $this->localizations[$type]; + // Check for Windows to find and replace the %e modifier correctly + if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { + $format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format); + } + return strftime($format, $data); break; case 'firstday': case 'jsdate': diff --git a/lib/migrate.php b/lib/migrate.php index 3694ea877a0..409d77a1a96 100644 --- a/lib/migrate.php +++ b/lib/migrate.php @@ -347,7 +347,7 @@ class OC_Migrate{ OC_Log::write( 'migration', 'Zip not found', OC_Log::ERROR ); return false; } - if ( self::$zip->open( $path ) != TRUE ) { + if ( self::$zip->open( $path ) != true ) { OC_Log::write( 'migration', "Failed to open zip file", OC_Log::ERROR ); return false; } @@ -576,7 +576,7 @@ class OC_Migrate{ OC_Log::write('migration', 'createZip() called but $zip and/or $zippath have not been set', OC_Log::ERROR); return false; } - if ( self::$zip->open( self::$zippath, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ) !== TRUE ) { + if ( self::$zip->open( self::$zippath, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ) !== true ) { OC_Log::write('migration', 'Failed to create the zip with error: '.self::$zip->getStatusString(), OC_Log::ERROR); return false; } else { diff --git a/lib/ocsclient.php b/lib/ocsclient.php index 3c80f319662..32c2cfe6e48 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -76,12 +76,12 @@ class OC_OCSClient{ */ public static function getCategories() { if(OC_Config::getValue('appstoreenabled', true)==false) { - return NULL; + return null; } $url=OC_OCSClient::getAppStoreURL().'/content/categories'; $xml=OC_OCSClient::getOCSresponse($url); - if($xml==FALSE) { - return NULL; + if($xml==false) { + return null; } $data=simplexml_load_string($xml); @@ -122,8 +122,8 @@ class OC_OCSClient{ $apps=array(); $xml=OC_OCSClient::getOCSresponse($url); - if($xml==FALSE) { - return NULL; + if($xml==false) { + return null; } $data=simplexml_load_string($xml); @@ -156,14 +156,14 @@ class OC_OCSClient{ */ public static function getApplication($id) { if(OC_Config::getValue('appstoreenabled', true)==false) { - return NULL; + return null; } $url=OC_OCSClient::getAppStoreURL().'/content/data/'.urlencode($id); $xml=OC_OCSClient::getOCSresponse($url); - if($xml==FALSE) { + if($xml==false) { OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL); - return NULL; + return null; } $data=simplexml_load_string($xml); @@ -194,14 +194,14 @@ class OC_OCSClient{ */ public static function getApplicationDownload($id,$item) { if(OC_Config::getValue('appstoreenabled', true)==false) { - return NULL; + return null; } $url=OC_OCSClient::getAppStoreURL().'/content/download/'.urlencode($id).'/'.urlencode($item); $xml=OC_OCSClient::getOCSresponse($url); - if($xml==FALSE) { + if($xml==false) { OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL); - return NULL; + return null; } $data=simplexml_load_string($xml); @@ -237,9 +237,9 @@ class OC_OCSClient{ $kbe=array(); $xml=OC_OCSClient::getOCSresponse($url); - if($xml==FALSE) { + if($xml==false) { OC_Log::write('core','Unable to parse knowledgebase content',OC_Log::FATAL); - return NULL; + return null; } $data=simplexml_load_string($xml); diff --git a/lib/updater.php b/lib/updater.php index cb22da4f906..483570b050a 100644 --- a/lib/updater.php +++ b/lib/updater.php @@ -52,7 +52,7 @@ class OC_Updater{ ) ); $xml=@file_get_contents($url, 0, $ctx); - if($xml==FALSE) { + if($xml==false) { return array(); } $data=@simplexml_load_string($xml); diff --git a/lib/user.php b/lib/user.php index 77bfe0de92a..eff93b501bb 100644 --- a/lib/user.php +++ b/lib/user.php @@ -491,8 +491,8 @@ class OC_User { unset($_COOKIE["oc_username"]); unset($_COOKIE["oc_token"]); unset($_COOKIE["oc_remember_login"]); - setcookie("oc_username", NULL, -1); - setcookie("oc_token", NULL, -1); - setcookie("oc_remember_login", NULL, -1); + setcookie("oc_username", null, -1); + setcookie("oc_token", null, -1); + setcookie("oc_remember_login", null, -1); } } diff --git a/lib/util.php b/lib/util.php index 100a1a447c2..2736c4df529 100755 --- a/lib/util.php +++ b/lib/util.php @@ -612,14 +612,14 @@ class OC_Util { // Try to use openssl_random_pseudo_bytes if(function_exists('openssl_random_pseudo_bytes')) { $pseudo_byte = bin2hex(openssl_random_pseudo_bytes($length, $strong)); - if($strong == TRUE) { + if($strong == true) { return substr($pseudo_byte, 0, $length); // Truncate it to match the length } } // Try to use /dev/urandom $fp = @file_get_contents('/dev/urandom', false, null, 0, $length); - if ($fp !== FALSE) { + if ($fp !== false) { $string = substr(bin2hex($fp), 0, $length); return $string; } @@ -646,14 +646,14 @@ class OC_Util { // Check openssl_random_pseudo_bytes if(function_exists('openssl_random_pseudo_bytes')) { openssl_random_pseudo_bytes(1, $strong); - if($strong == TRUE) { + if($strong == true) { return true; } } // Check /dev/urandom $fp = @file_get_contents('/dev/urandom', false, null, 0, 1); - if ($fp !== FALSE) { + if ($fp !== false) { return true; } diff --git a/lib/vobject.php b/lib/vobject.php index b5a04b4bf65..2ccf8eda685 100644 --- a/lib/vobject.php +++ b/lib/vobject.php @@ -62,7 +62,7 @@ class OC_VObject{ foreach($value as &$i ) { $i = implode("\\\\;", explode(';', $i)); } - return implode(';',$value); + return implode(';', $value); } /** @@ -71,15 +71,15 @@ class OC_VObject{ * @return array */ public static function unescapeSemicolons($value) { - $array = explode(';',$value); + $array = explode(';', $value); for($i=0;$i<count($array);$i++) { - if(substr($array[$i],-2,2)=="\\\\") { + if(substr($array[$i], -2, 2)=="\\\\") { if(isset($array[$i+1])) { - $array[$i] = substr($array[$i],0,count($array[$i])-2).';'.$array[$i+1]; + $array[$i] = substr($array[$i], 0, count($array[$i])-2).';'.$array[$i+1]; unset($array[$i+1]); } else{ - $array[$i] = substr($array[$i],0,count($array[$i])-2).';'; + $array[$i] = substr($array[$i], 0, count($array[$i])-2).';'; } $i = $i - 1; } @@ -127,8 +127,8 @@ class OC_VObject{ } public function setUID() { - $uid = substr(md5(rand().time()),0,10); - $this->vobject->add('UID',$uid); + $uid = substr(md5(rand().time()), 0, 10); + $this->vobject->add('UID', $uid); } public function setString($name, $string) { |