White-space fix.

This commit is contained in:
Thomas Tanghus 2012-06-14 12:57:30 +02:00
parent a34db3fbe0
commit 8fd9cbcc54
2 changed files with 43 additions and 47 deletions

View File

@ -90,12 +90,12 @@ class OC_Helper {
} }
/** /**
* @brief Returns the server protocol * @brief Returns the server protocol
* @returns the server protocol * @returns the server protocol
* *
* Returns the server protocol. It respects reverse proxy servers and load balancers * Returns the server protocol. It respects reverse proxy servers and load balancers
*/ */
public static function serverProtocol() { public static function serverProtocol() {
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
$proto = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']); $proto = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']);
@ -143,7 +143,7 @@ class OC_Helper {
* *
* Returns the path to the image. * Returns the path to the image.
*/ */
public static function imagePath( $app, $image ){ public static function imagePath( $app, $image ){
// Read the selected theme from the config file // Read the selected theme from the config file
$theme=OC_Config::getValue( "theme" ); $theme=OC_Config::getValue( "theme" );
@ -551,35 +551,35 @@ class OC_Helper {
} }
} }
/** /**
* Adds a suffix to the name in case the file exists * Adds a suffix to the name in case the file exists
* *
* @param $path * @param $path
* @param $filename * @param $filename
* @return string * @return string
*/ */
public static function buildNotExistingFileName($path, $filename){ public static function buildNotExistingFileName($path, $filename){
if($path==='/'){ if($path==='/'){
$path=''; $path='';
} }
if ($pos = strrpos($filename, '.')) { if ($pos = strrpos($filename, '.')) {
$name = substr($filename, 0, $pos); $name = substr($filename, 0, $pos);
$ext = substr($filename, $pos); $ext = substr($filename, $pos);
} else { } else {
$name = $filename; $name = $filename;
} }
$newpath = $path . '/' . $filename; $newpath = $path . '/' . $filename;
$newname = $filename; $newname = $filename;
$counter = 2; $counter = 2;
while (OC_Filesystem::file_exists($newpath)) { while (OC_Filesystem::file_exists($newpath)) {
$newname = $name . ' (' . $counter . ')' . $ext; $newname = $name . ' (' . $counter . ')' . $ext;
$newpath = $path . '/' . $newname; $newpath = $path . '/' . $newname;
$counter++; $counter++;
} }
return $newpath; return $newpath;
} }
/* /*
* checks if $sub is a subdirectory of $parent * checks if $sub is a subdirectory of $parent

View File

@ -145,15 +145,15 @@ class Util {
} }
/** /**
* @brief Creates an url * @brief Creates an url
* @param $app app * @param $app app
* @param $file file * @param $file file
* @returns the url * @returns the url
* *
* Returns a url to the given app and file. * Returns a url to the given app and file.
*/ */
public static function linkTo( $app, $file ){ public static function linkTo( $app, $file ){
return(\OC_Helper::linkTo( $app, $file )); return(\OC_Helper::linkTo( $app, $file ));
} }
@ -264,10 +264,6 @@ class Util {
public static function callCheck(){ public static function callCheck(){
return(\OC_Util::callCheck()); return(\OC_Util::callCheck());
} }
} }
?> ?>