summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/Http.php2
-rw-r--r--lib/private/AppFramework/Middleware/OCSMiddleware.php2
-rw-r--r--lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php2
-rw-r--r--lib/private/Authentication/TwoFactorAuth/Manager.php4
-rw-r--r--lib/private/Comments/Comment.php8
-rw-r--r--lib/private/DB/MySQLMigrator.php38
-rw-r--r--lib/private/Group/Database.php16
-rw-r--r--lib/private/Group/MetaData.php14
-rw-r--r--lib/private/IntegrityCheck/Checker.php24
-rw-r--r--lib/private/Preview/Generator.php6
-rw-r--r--lib/private/Security/TrustedDomainHelper.php8
-rw-r--r--lib/private/Share/Share.php2
-rw-r--r--lib/private/Share20/DefaultShareProvider.php6
-rw-r--r--lib/private/Share20/Manager.php2
-rw-r--r--lib/private/SubAdmin.php2
-rw-r--r--lib/private/Tagging/Tag.php12
-rw-r--r--lib/private/Tags.php2
-rw-r--r--lib/private/User/Database.php14
-rw-r--r--lib/private/legacy/OC_Defaults.php2
-rw-r--r--lib/private/legacy/OC_Files.php44
-rw-r--r--lib/private/legacy/OC_Hook.php4
-rw-r--r--lib/public/AppFramework/ApiController.php100
-rw-r--r--lib/public/AppFramework/Controller.php2
-rw-r--r--lib/public/AppFramework/Http/DataDisplayResponse.php2
-rw-r--r--lib/public/AppFramework/Http/DataResponse.php2
-rw-r--r--lib/public/AppFramework/Http/Response.php4
-rw-r--r--lib/public/AppFramework/Http/TemplateResponse.php2
-rw-r--r--lib/public/Share.php2
28 files changed, 164 insertions, 164 deletions
diff --git a/lib/private/AppFramework/Http.php b/lib/private/AppFramework/Http.php
index 56503ce9595..91d13b9e231 100644
--- a/lib/private/AppFramework/Http.php
+++ b/lib/private/AppFramework/Http.php
@@ -118,7 +118,7 @@ class Http extends BaseHttp {
* @return string
*/
public function getStatusHeader($status, \DateTime $lastModified=null,
- $ETag=null) {
+ $ETag=null) {
if(!is_null($lastModified)) {
$lastModified = $lastModified->format(\DateTime::RFC2822);
diff --git a/lib/private/AppFramework/Middleware/OCSMiddleware.php b/lib/private/AppFramework/Middleware/OCSMiddleware.php
index d52163246c7..fe0f58c1ab5 100644
--- a/lib/private/AppFramework/Middleware/OCSMiddleware.php
+++ b/lib/private/AppFramework/Middleware/OCSMiddleware.php
@@ -101,7 +101,7 @@ class OCSMiddleware extends Middleware {
*/
if ($controller instanceof OCSController && !($response instanceof BaseResponse)) {
if ($response->getStatus() === Http::STATUS_UNAUTHORIZED ||
- $response->getStatus() === Http::STATUS_FORBIDDEN) {
+ $response->getStatus() === Http::STATUS_FORBIDDEN) {
$message = '';
if ($response instanceof JSONResponse) {
diff --git a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
index 16f1fb35a82..0ae2d37b374 100644
--- a/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
+++ b/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php
@@ -212,7 +212,7 @@ class SecurityMiddleware extends Middleware {
if($exception instanceof SecurityException) {
if($exception instanceof StrictCookieMissingException) {
return new RedirectResponse(\OC::$WEBROOT);
- }
+ }
if (stripos($this->request->getHeader('Accept'),'html') === false) {
$response = new JSONResponse(
['message' => $exception->getMessage()],
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php
index 170048f451b..1cde13ef27e 100644
--- a/lib/private/Authentication/TwoFactorAuth/Manager.php
+++ b/lib/private/Authentication/TwoFactorAuth/Manager.php
@@ -198,8 +198,8 @@ class Manager {
$missing[] = $providerId;
$this->logger->alert("two-factor auth provider '$providerId' failed to load",
[
- 'app' => 'core',
- ]);
+ 'app' => 'core',
+ ]);
}
}
diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php
index 3b4a523b884..a45b1e05cfe 100644
--- a/lib/private/Comments/Comment.php
+++ b/lib/private/Comments/Comment.php
@@ -300,8 +300,8 @@ class Comment implements IComment {
*/
public function setActor($actorType, $actorId) {
if(
- !is_string($actorType) || !trim($actorType)
- || !is_string($actorId) || $actorId === ''
+ !is_string($actorType) || !trim($actorType)
+ || !is_string($actorId) || $actorId === ''
) {
throw new \InvalidArgumentException('String expected.');
}
@@ -386,8 +386,8 @@ class Comment implements IComment {
*/
public function setObject($objectType, $objectId) {
if(
- !is_string($objectType) || !trim($objectType)
- || !is_string($objectId) || trim($objectId) === ''
+ !is_string($objectType) || !trim($objectType)
+ || !is_string($objectId) || trim($objectId) === ''
) {
throw new \InvalidArgumentException('String expected.');
}
diff --git a/lib/private/DB/MySQLMigrator.php b/lib/private/DB/MySQLMigrator.php
index e178cfb55d8..fe56a9563e2 100644
--- a/lib/private/DB/MySQLMigrator.php
+++ b/lib/private/DB/MySQLMigrator.php
@@ -53,25 +53,25 @@ class MySQLMigrator extends Migrator {
return $schemaDiff;
}
- /**
- * Speed up migration test by disabling autocommit and unique indexes check
- *
- * @param \Doctrine\DBAL\Schema\Table $table
- * @throws \OC\DB\MigrationException
- */
- protected function checkTableMigrate(Table $table) {
- $this->connection->exec('SET autocommit=0');
- $this->connection->exec('SET unique_checks=0');
+ /**
+ * Speed up migration test by disabling autocommit and unique indexes check
+ *
+ * @param \Doctrine\DBAL\Schema\Table $table
+ * @throws \OC\DB\MigrationException
+ */
+ protected function checkTableMigrate(Table $table) {
+ $this->connection->exec('SET autocommit=0');
+ $this->connection->exec('SET unique_checks=0');
- try {
- parent::checkTableMigrate($table);
- } catch (\Exception $e) {
- $this->connection->exec('SET unique_checks=1');
- $this->connection->exec('SET autocommit=1');
- throw new MigrationException($table->getName(), $e->getMessage());
- }
- $this->connection->exec('SET unique_checks=1');
- $this->connection->exec('SET autocommit=1');
- }
+ try {
+ parent::checkTableMigrate($table);
+ } catch (\Exception $e) {
+ $this->connection->exec('SET unique_checks=1');
+ $this->connection->exec('SET autocommit=1');
+ throw new MigrationException($table->getName(), $e->getMessage());
+ }
+ $this->connection->exec('SET unique_checks=1');
+ $this->connection->exec('SET autocommit=1');
+ }
}
diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php
index 8afd2c4aed2..48b01461531 100644
--- a/lib/private/Group/Database.php
+++ b/lib/private/Group/Database.php
@@ -62,14 +62,14 @@ use OCP\IDBConnection;
*/
class Database extends ABackend
implements IAddToGroupBackend,
- ICountDisabledInGroup,
- ICountUsersBackend,
- ICreateGroupBackend,
- IDeleteGroupBackend,
- IGetDisplayNameBackend,
- IGroupDetailsBackend,
- IRemoveFromGroupBackend,
- ISetDisplayNameBackend {
+ ICountDisabledInGroup,
+ ICountUsersBackend,
+ ICreateGroupBackend,
+ IDeleteGroupBackend,
+ IGetDisplayNameBackend,
+ IGroupDetailsBackend,
+ IRemoveFromGroupBackend,
+ ISetDisplayNameBackend {
/** @var string[] */
private $groupCache = [];
diff --git a/lib/private/Group/MetaData.php b/lib/private/Group/MetaData.php
index 97d71b51f98..3a2c08b0878 100644
--- a/lib/private/Group/MetaData.php
+++ b/lib/private/Group/MetaData.php
@@ -165,13 +165,13 @@ class MetaData {
*/
private function generateGroupMetaData(\OCP\IGroup $group, $userSearch) {
return [
- 'id' => $group->getGID(),
- 'name' => $group->getDisplayName(),
- 'usercount' => $this->sorting === self::SORT_USERCOUNT ? $group->count($userSearch) : 0,
- 'disabled' => $group->countDisabled(),
- 'canAdd' => $group->canAddUser(),
- 'canRemove' => $group->canRemoveUser(),
- ];
+ 'id' => $group->getGID(),
+ 'name' => $group->getDisplayName(),
+ 'usercount' => $this->sorting === self::SORT_USERCOUNT ? $group->count($userSearch) : 0,
+ 'disabled' => $group->countDisabled(),
+ 'canAdd' => $group->canAddUser(),
+ 'canRemove' => $group->canRemoveUser(),
+ ];
}
/**
diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php
index 57a80e6f4bd..725d72d9c79 100644
--- a/lib/private/IntegrityCheck/Checker.php
+++ b/lib/private/IntegrityCheck/Checker.php
@@ -239,10 +239,10 @@ class Checker {
$signature = $privateKey->sign(json_encode($hashes));
return [
- 'hashes' => $hashes,
- 'signature' => base64_encode($signature),
- 'certificate' => $certificate->saveX509($certificate->currentCert),
- ];
+ 'hashes' => $hashes,
+ 'signature' => base64_encode($signature),
+ 'certificate' => $certificate->saveX509($certificate->currentCert),
+ ];
}
/**
@@ -509,10 +509,10 @@ class Checker {
);
} catch (\Exception $e) {
$result = [
- 'EXCEPTION' => [
- 'class' => \get_class($e),
- 'message' => $e->getMessage(),
- ],
+ 'EXCEPTION' => [
+ 'class' => \get_class($e),
+ 'message' => $e->getMessage(),
+ ],
];
}
$this->storeResults($appId, $result);
@@ -559,10 +559,10 @@ class Checker {
);
} catch (\Exception $e) {
$result = [
- 'EXCEPTION' => [
- 'class' => \get_class($e),
- 'message' => $e->getMessage(),
- ],
+ 'EXCEPTION' => [
+ 'class' => \get_class($e),
+ 'message' => $e->getMessage(),
+ ],
];
}
$this->storeResults('core', $result);
diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php
index bb597460f9d..4ee8518981c 100644
--- a/lib/private/Preview/Generator.php
+++ b/lib/private/Preview/Generator.php
@@ -330,9 +330,9 @@ class Generator {
}
/*
- * Make sure the requested height and width fall within the max
- * of the preview.
- */
+ * Make sure the requested height and width fall within the max
+ * of the preview.
+ */
if ($height > $maxHeight) {
$ratio = $height / $maxHeight;
$height = $maxHeight;
diff --git a/lib/private/Security/TrustedDomainHelper.php b/lib/private/Security/TrustedDomainHelper.php
index 473e56cdd51..451d5074b69 100644
--- a/lib/private/Security/TrustedDomainHelper.php
+++ b/lib/private/Security/TrustedDomainHelper.php
@@ -99,9 +99,9 @@ class TrustedDomainHelper {
}
$regex = '/^' . implode('[-\.a-zA-Z0-9]*', array_map(function($v) { return preg_quote($v, '/'); }, explode('*', $trusted))) . '$/i';
if (preg_match($regex, $domain) || preg_match($regex, $domainWithPort)) {
- return true;
- }
- }
- return false;
+ return true;
+ }
+ }
+ return false;
}
}
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php
index 2bc2afbea2e..bd53c0307a6 100644
--- a/lib/private/Share/Share.php
+++ b/lib/private/Share/Share.php
@@ -1359,7 +1359,7 @@ class Share extends Constants {
$select = '`*PREFIX*share`.`id`, `item_type`, `item_source`, `item_target`,'
. '`*PREFIX*share`.`parent`, `share_type`, `share_with`, `uid_owner`,'
. '`file_source`, `path`, `file_target`, `*PREFIX*share`.`permissions`,'
- . '`stime`, `expiration`, `token`, `storage`, `mail_send`,'
+ . '`stime`, `expiration`, `token`, `storage`, `mail_send`,'
. '`*PREFIX*storages`.`id` AS `storage_id`, `*PREFIX*filecache`.`parent` as `file_parent`';
}
}
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index 065d06de37e..2eda7295c1e 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -838,7 +838,7 @@ class DefaultShareProvider implements IShareProvider {
$pathSections = explode('/', $data['path'], 2);
// FIXME: would not detect rare md5'd home storage case properly
if ($pathSections[0] !== 'files'
- && in_array(explode(':', $data['storage_string_id'], 2)[0], ['home', 'object'])) {
+ && in_array(explode(':', $data['storage_string_id'], 2)[0], ['home', 'object'])) {
return false;
}
return true;
@@ -961,8 +961,8 @@ class DefaultShareProvider implements IShareProvider {
}
/*
- * Resolve all group shares to user specific shares
- */
+ * Resolve all group shares to user specific shares
+ */
$shares = $this->resolveGroupShares($shares2, $userId);
} else {
throw new BackendError('Invalid backend');
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 4e1f6567e6b..2a25ed92d12 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -932,7 +932,7 @@ class Manager implements IManager {
// We can only change the recipient on user shares
if ($share->getSharedWith() !== $originalShare->getSharedWith() &&
- $share->getShareType() !== \OCP\Share::SHARE_TYPE_USER) {
+ $share->getShareType() !== \OCP\Share::SHARE_TYPE_USER) {
throw new \InvalidArgumentException('Can only update recipient on user shares');
}
diff --git a/lib/private/SubAdmin.php b/lib/private/SubAdmin.php
index ce2a38ccbf6..05d23bee587 100644
--- a/lib/private/SubAdmin.php
+++ b/lib/private/SubAdmin.php
@@ -54,7 +54,7 @@ class SubAdmin extends PublicEmitter implements ISubAdmin {
* @param IDBConnection $dbConn
*/
public function __construct(IUserManager $userManager,
- IGroupManager $groupManager,
+ IGroupManager $groupManager,
IDBConnection $dbConn) {
$this->userManager = $userManager;
$this->groupManager = $groupManager;
diff --git a/lib/private/Tagging/Tag.php b/lib/private/Tagging/Tag.php
index 971b2da053b..e82860c1d3d 100644
--- a/lib/private/Tagging/Tag.php
+++ b/lib/private/Tagging/Tag.php
@@ -65,11 +65,11 @@ class Tag extends Entity {
*/
public function columnToProperty($columnName){
if ($columnName === 'category') {
- return 'name';
+ return 'name';
} elseif ($columnName === 'uid') {
- return 'owner';
+ return 'owner';
} else {
- return parent::columnToProperty($columnName);
+ return parent::columnToProperty($columnName);
}
}
@@ -81,11 +81,11 @@ class Tag extends Entity {
*/
public function propertyToColumn($property){
if ($property === 'name') {
- return 'category';
+ return 'category';
} elseif ($property === 'owner') {
- return 'uid';
+ return 'uid';
} else {
- return parent::propertyToColumn($property);
+ return parent::propertyToColumn($property);
}
}
}
diff --git a/lib/private/Tags.php b/lib/private/Tags.php
index 6a174748a31..15b225b2ff8 100644
--- a/lib/private/Tags.php
+++ b/lib/private/Tags.php
@@ -504,7 +504,7 @@ class Tags implements ITags {
'objid' => $relation['objid'],
'categoryid' => $tagId,
'type' => $this->type,
- ]);
+ ]);
} catch(\Exception $e) {
\OC::$server->getLogger()->logException($e, [
'message' => __METHOD__,
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php
index 856959a4596..c89d3ce3690 100644
--- a/lib/private/User/Database.php
+++ b/lib/private/User/Database.php
@@ -78,13 +78,13 @@ use OCP\User\Backend\ISetPasswordBackend;
*/
class Database extends ABackend
implements ICreateUserBackend,
- ISetPasswordBackend,
- ISetDisplayNameBackend,
- IGetDisplayNameBackend,
- ICheckPasswordBackend,
- IGetHomeBackend,
- ICountUsersBackend,
- IGetRealUIDBackend {
+ ISetPasswordBackend,
+ ISetDisplayNameBackend,
+ IGetDisplayNameBackend,
+ ICheckPasswordBackend,
+ IGetHomeBackend,
+ ICountUsersBackend,
+ IGetRealUIDBackend {
/** @var CappedMemoryCache */
private $cache;
diff --git a/lib/private/legacy/OC_Defaults.php b/lib/private/legacy/OC_Defaults.php
index 73443adb031..d5a4b5eecee 100644
--- a/lib/private/legacy/OC_Defaults.php
+++ b/lib/private/legacy/OC_Defaults.php
@@ -322,7 +322,7 @@ class OC_Defaults {
} else {
$logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo/logo.png');
}
- return $logo . '?v=' . hash('sha1', implode('.', \OCP\Util::getVersion()));
+ return $logo . '?v=' . hash('sha1', implode('.', \OCP\Util::getVersion()));
}
public function getTextColorPrimary() {
diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php
index 249d3e5154f..72983f50d9c 100644
--- a/lib/private/legacy/OC_Files.php
+++ b/lib/private/legacy/OC_Files.php
@@ -84,19 +84,19 @@ class OC_Files {
$type = \OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename));
if ($fileSize > -1) {
if (!empty($rangeArray)) {
- http_response_code(206);
- header('Accept-Ranges: bytes', true);
- if (count($rangeArray) > 1) {
+ http_response_code(206);
+ header('Accept-Ranges: bytes', true);
+ if (count($rangeArray) > 1) {
$type = 'multipart/byteranges; boundary='.self::getBoundary();
// no Content-Length header here
- }
- else {
+ }
+ else {
header(sprintf('Content-Range: bytes %d-%d/%d', $rangeArray[0]['from'], $rangeArray[0]['to'], $fileSize), true);
OC_Response::setContentLengthHeader($rangeArray[0]['to'] - $rangeArray[0]['from'] + 1);
- }
+ }
}
else {
- OC_Response::setContentLengthHeader($fileSize);
+ OC_Response::setContentLengthHeader($fileSize);
}
}
header('Content-Type: '.$type, true);
@@ -329,10 +329,10 @@ class OC_Files {
if (!empty($rangeArray)) {
try {
- if (count($rangeArray) == 1) {
+ if (count($rangeArray) == 1) {
$view->readfilePart($filename, $rangeArray[0]['from'], $rangeArray[0]['to']);
- }
- else {
+ }
+ else {
// check if file is seekable (if not throw UnseekableException)
// we have to check it before body contents
$view->readfilePart($filename, $rangeArray[0]['size'], $rangeArray[0]['size']);
@@ -340,24 +340,24 @@ class OC_Files {
$type = \OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename));
foreach ($rangeArray as $range) {
- echo "\r\n--".self::getBoundary()."\r\n".
- "Content-type: ".$type."\r\n".
- "Content-range: bytes ".$range['from']."-".$range['to']."/".$range['size']."\r\n\r\n";
- $view->readfilePart($filename, $range['from'], $range['to']);
+ echo "\r\n--".self::getBoundary()."\r\n".
+ "Content-type: ".$type."\r\n".
+ "Content-range: bytes ".$range['from']."-".$range['to']."/".$range['size']."\r\n\r\n";
+ $view->readfilePart($filename, $range['from'], $range['to']);
}
echo "\r\n--".self::getBoundary()."--\r\n";
- }
+ }
} catch (\OCP\Files\UnseekableException $ex) {
- // file is unseekable
- header_remove('Accept-Ranges');
- header_remove('Content-Range');
- http_response_code(200);
- self::sendHeaders($filename, $name, []);
- $view->readfile($filename);
+ // file is unseekable
+ header_remove('Accept-Ranges');
+ header_remove('Content-Range');
+ http_response_code(200);
+ self::sendHeaders($filename, $name, []);
+ $view->readfile($filename);
}
}
else {
- $view->readfile($filename);
+ $view->readfile($filename);
}
}
diff --git a/lib/private/legacy/OC_Hook.php b/lib/private/legacy/OC_Hook.php
index 2918dd4282f..3cc29a58c77 100644
--- a/lib/private/legacy/OC_Hook.php
+++ b/lib/private/legacy/OC_Hook.php
@@ -71,8 +71,8 @@ class OC_Hook {
}
// Connect the hook handler to the requested emitter
self::$registered[$signalClass][$signalName][] = [
- "class" => $slotClass,
- "name" => $slotName
+ "class" => $slotClass,
+ "name" => $slotName
];
// No chance for failure ;-)
diff --git a/lib/public/AppFramework/ApiController.php b/lib/public/AppFramework/ApiController.php
index 2ebe219444a..e8ecf61c921 100644
--- a/lib/public/AppFramework/ApiController.php
+++ b/lib/public/AppFramework/ApiController.php
@@ -39,60 +39,60 @@ use OCP\IRequest;
*/
abstract class ApiController extends Controller {
- private $corsMethods;
- private $corsAllowedHeaders;
- private $corsMaxAge;
+ private $corsMethods;
+ private $corsAllowedHeaders;
+ private $corsMaxAge;
- /**
- * constructor of the controller
- * @param string $appName the name of the app
- * @param IRequest $request an instance of the request
- * @param string $corsMethods comma separated string of HTTP verbs which
- * should be allowed for websites or webapps when calling your API, defaults to
- * 'PUT, POST, GET, DELETE, PATCH'
- * @param string $corsAllowedHeaders comma separated string of HTTP headers
- * which should be allowed for websites or webapps when calling your API,
- * defaults to 'Authorization, Content-Type, Accept'
- * @param int $corsMaxAge number in seconds how long a preflighted OPTIONS
- * request should be cached, defaults to 1728000 seconds
- * @since 7.0.0
- */
- public function __construct($appName,
- IRequest $request,
- $corsMethods='PUT, POST, GET, DELETE, PATCH',
- $corsAllowedHeaders='Authorization, Content-Type, Accept',
- $corsMaxAge=1728000){
- parent::__construct($appName, $request);
- $this->corsMethods = $corsMethods;
- $this->corsAllowedHeaders = $corsAllowedHeaders;
- $this->corsMaxAge = $corsMaxAge;
- }
+ /**
+ * constructor of the controller
+ * @param string $appName the name of the app
+ * @param IRequest $request an instance of the request
+ * @param string $corsMethods comma separated string of HTTP verbs which
+ * should be allowed for websites or webapps when calling your API, defaults to
+ * 'PUT, POST, GET, DELETE, PATCH'
+ * @param string $corsAllowedHeaders comma separated string of HTTP headers
+ * which should be allowed for websites or webapps when calling your API,
+ * defaults to 'Authorization, Content-Type, Accept'
+ * @param int $corsMaxAge number in seconds how long a preflighted OPTIONS
+ * request should be cached, defaults to 1728000 seconds
+ * @since 7.0.0
+ */
+ public function __construct($appName,
+ IRequest $request,
+ $corsMethods='PUT, POST, GET, DELETE, PATCH',
+ $corsAllowedHeaders='Authorization, Content-Type, Accept',
+ $corsMaxAge=1728000){
+ parent::__construct($appName, $request);
+ $this->corsMethods = $corsMethods;
+ $this->corsAllowedHeaders = $corsAllowedHeaders;
+ $this->corsMaxAge = $corsMaxAge;
+ }
- /**
- * This method implements a preflighted cors response for you that you can
- * link to for the options request
- *
- * @NoAdminRequired
- * @NoCSRFRequired
- * @PublicPage
- * @since 7.0.0
- */
- public function preflightedCors() {
- if(isset($this->request->server['HTTP_ORIGIN'])) {
- $origin = $this->request->server['HTTP_ORIGIN'];
- } else {
- $origin = '*';
- }
+ /**
+ * This method implements a preflighted cors response for you that you can
+ * link to for the options request
+ *
+ * @NoAdminRequired
+ * @NoCSRFRequired
+ * @PublicPage
+ * @since 7.0.0
+ */
+ public function preflightedCors() {
+ if(isset($this->request->server['HTTP_ORIGIN'])) {
+ $origin = $this->request->server['HTTP_ORIGIN'];
+ } else {
+ $origin = '*';
+ }
- $response = new Response();
- $response->addHeader('Access-Control-Allow-Origin', $origin);
- $response->addHeader('Access-Control-Allow-Methods', $this->corsMethods);
- $response->addHeader('Access-Control-Max-Age', (string)$this->corsMaxAge);
- $response->addHeader('Access-Control-Allow-Headers', $this->corsAllowedHeaders);
- $response->addHeader('Access-Control-Allow-Credentials', 'false');
- return $response;
- }
+ $response = new Response();
+ $response->addHeader('Access-Control-Allow-Origin', $origin);
+ $response->addHeader('Access-Control-Allow-Methods', $this->corsMethods);
+ $response->addHeader('Access-Control-Max-Age', (string)$this->corsMaxAge);
+ $response->addHeader('Access-Control-Allow-Headers', $this->corsAllowedHeaders);
+ $response->addHeader('Access-Control-Allow-Credentials', 'false');
+ return $response;
+ }
}
diff --git a/lib/public/AppFramework/Controller.php b/lib/public/AppFramework/Controller.php
index 2e442c49768..487b6a854fe 100644
--- a/lib/public/AppFramework/Controller.php
+++ b/lib/public/AppFramework/Controller.php
@@ -73,7 +73,7 @@ abstract class Controller {
* @since 6.0.0 - parameter $appName was added in 7.0.0 - parameter $app was removed in 7.0.0
*/
public function __construct($appName,
- IRequest $request) {
+ IRequest $request) {
$this->appName = $appName;
$this->request = $request;
diff --git a/lib/public/AppFramework/Http/DataDisplayResponse.php b/lib/public/AppFramework/Http/DataDisplayResponse.php
index 512e52ee9fc..4b31bc7dc0d 100644
--- a/lib/public/AppFramework/Http/DataDisplayResponse.php
+++ b/lib/public/AppFramework/Http/DataDisplayResponse.php
@@ -48,7 +48,7 @@ class DataDisplayResponse extends Response {
* @since 8.1.0
*/
public function __construct($data='', $statusCode=Http::STATUS_OK,
- $headers=[]) {
+ $headers=[]) {
parent::__construct();
$this->data = $data;
diff --git a/lib/public/AppFramework/Http/DataResponse.php b/lib/public/AppFramework/Http/DataResponse.php
index 700fe1f418b..7efbb58d8c7 100644
--- a/lib/public/AppFramework/Http/DataResponse.php
+++ b/lib/public/AppFramework/Http/DataResponse.php
@@ -53,7 +53,7 @@ class DataResponse extends Response {
* @since 8.0.0
*/
public function __construct($data=[], $statusCode=Http::STATUS_OK,
- array $headers=[]) {
+ array $headers=[]) {
parent::__construct();
$this->data = $data;
diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php
index 2fc985aabfb..0aacc2f3a58 100644
--- a/lib/public/AppFramework/Http/Response.php
+++ b/lib/public/AppFramework/Http/Response.php
@@ -198,8 +198,8 @@ class Response {
*/
public function addHeader($name, $value) {
$name = trim($name); // always remove leading and trailing whitespace
- // to be able to reliably check for security
- // headers
+ // to be able to reliably check for security
+ // headers
if(is_null($value)) {
unset($this->headers[$name]);
diff --git a/lib/public/AppFramework/Http/TemplateResponse.php b/lib/public/AppFramework/Http/TemplateResponse.php
index 4a77d4844ed..99219d6eb0e 100644
--- a/lib/public/AppFramework/Http/TemplateResponse.php
+++ b/lib/public/AppFramework/Http/TemplateResponse.php
@@ -77,7 +77,7 @@ class TemplateResponse extends Response {
* @since 6.0.0 - parameters $params and $renderAs were added in 7.0.0
*/
public function __construct($appName, $templateName, array $params=[],
- $renderAs='user') {
+ $renderAs='user') {
parent::__construct();
$this->templateName = $templateName;
diff --git a/lib/public/Share.php b/lib/public/Share.php
index 25e255f35ba..622a6718924 100644
--- a/lib/public/Share.php
+++ b/lib/public/Share.php
@@ -121,7 +121,7 @@ class Share extends \OC\Share\Constants {
* @deprecated 17.0.0
*/
public static function getItemShared($itemType, $itemSource, $format = self::FORMAT_NONE,
- $parameters = null, $includeCollections = false) {
+ $parameters = null, $includeCollections = false) {
return \OC\Share\Share::getItemShared($itemType, $itemSource, $format, $parameters, $includeCollections);
}