Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


class UpdateException extends \Exception {

/** @param list<string> $data */
Expand Down Expand Up @@ -518,6 +519,8 @@ private function getUpdateServerResponse(): array {
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $updateURL,
CURLOPT_USERAGENT => 'Nextcloud Updater',
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_MAXREDIRS => 2,
]);

if ($this->getConfigOption('proxy') !== null) {
Expand Down
2 changes: 2 additions & 0 deletions lib/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ private function getUpdateServerResponse(): array {
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $updateURL,
CURLOPT_USERAGENT => 'Nextcloud Updater',
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_MAXREDIRS => 2,
]);

if ($this->getConfigOption('proxy') !== null) {
Expand Down
Binary file modified updater.phar
Binary file not shown.
5 changes: 1 addition & 4 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
throw new RuntimeException($err);
}

require_once __DIR__ . '/composer/autoload_real.php';
Expand Down
45 changes: 41 additions & 4 deletions vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,23 @@
*/
class InstalledVersions
{
/**
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
* @internal
*/
private static $selfDir = null;

/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;

/**
* @var bool
*/
private static $installedIsLocalDir;

/**
* @var bool|null
*/
Expand Down Expand Up @@ -309,6 +320,24 @@ public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();

// when using reload, we disable the duplicate protection to ensure that self::$installed data is
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
// so we have to assume it does not, and that may result in duplicate data being returned when listing
// all installed packages for example
self::$installedIsLocalDir = false;
}

/**
* @return string
*/
private static function getSelfDir()
{
if (self::$selfDir === null) {
self::$selfDir = strtr(__DIR__, '\\', '/');
}

return self::$selfDir;
}

/**
Expand All @@ -322,19 +351,27 @@ private static function getInstalled()
}

$installed = array();
$copiedLocalDir = false;

if (self::$canGetVendors) {
$selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
self::$installedByVendor[$vendorDir] = $required;
$installed[] = $required;
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
self::$installed = $required;
self::$installedIsLocalDir = true;
}
}
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
$copiedLocalDir = true;
}
}
}

Expand All @@ -350,7 +387,7 @@ private static function getInstalled()
}
}

if (self::$installed !== array()) {
if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}

Expand Down
28 changes: 14 additions & 14 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,24 @@
},
{
"name": "nextcloud/coding-standard",
"version": "v1.1.1",
"version_normalized": "1.1.1.0",
"version": "v1.2.1",
"version_normalized": "1.2.1.0",
"source": {
"type": "git",
"url": "https://github.com/nextcloud/coding-standard.git",
"reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb"
"reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/55def702fb9a37a219511e1d8c6fe8e37164c1fb",
"reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb",
"url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e",
"reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e",
"shasum": ""
},
"require": {
"php": "^7.3|^8.0",
"php-cs-fixer/shim": "^3.17"
},
"time": "2023-06-01T12:05:01+00:00",
"time": "2024-02-01T14:54:37+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand All @@ -100,23 +100,23 @@
"description": "Nextcloud coding standards for the php cs fixer",
"support": {
"issues": "https://github.com/nextcloud/coding-standard/issues",
"source": "https://github.com/nextcloud/coding-standard/tree/v1.1.1"
"source": "https://github.com/nextcloud/coding-standard/tree/v1.2.1"
},
"install-path": "../nextcloud/coding-standard"
},
{
"name": "php-cs-fixer/shim",
"version": "v3.17.0",
"version_normalized": "3.17.0.0",
"version": "v3.51.0",
"version_normalized": "3.51.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/shim.git",
"reference": "f51b4aed90565c447136f1d015798f6f7c82490f"
"reference": "a792394f7f3934f75a4df9dca544796c6f503027"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/f51b4aed90565c447136f1d015798f6f7c82490f",
"reference": "f51b4aed90565c447136f1d015798f6f7c82490f",
"url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/a792394f7f3934f75a4df9dca544796c6f503027",
"reference": "a792394f7f3934f75a4df9dca544796c6f503027",
"shasum": ""
},
"require": {
Expand All @@ -131,7 +131,7 @@
"ext-dom": "For handling output formats in XML",
"ext-mbstring": "For handling non-UTF8 characters."
},
"time": "2023-05-22T20:00:38+00:00",
"time": "2024-02-28T19:51:07+00:00",
"bin": [
"php-cs-fixer",
"php-cs-fixer.phar"
Expand All @@ -155,7 +155,7 @@
"description": "A tool to automatically fix PHP code style",
"support": {
"issues": "https://github.com/PHP-CS-Fixer/shim/issues",
"source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.17.0"
"source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.51.0"
},
"install-path": "../php-cs-fixer/shim"
},
Expand Down
18 changes: 9 additions & 9 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'de0582d00a183fca1d5645d354e88b94b9b75a90',
'reference' => 'b5f1ef738c155e5410703c6c75fd1e8ff3faacfd',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'de0582d00a183fca1d5645d354e88b94b9b75a90',
'reference' => 'b5f1ef738c155e5410703c6c75fd1e8ff3faacfd',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -31,22 +31,22 @@
'friendsofphp/php-cs-fixer' => array(
'dev_requirement' => true,
'replaced' => array(
0 => 'v3.17.0',
0 => 'v3.51.0',
),
),
'nextcloud/coding-standard' => array(
'pretty_version' => 'v1.1.1',
'version' => '1.1.1.0',
'reference' => '55def702fb9a37a219511e1d8c6fe8e37164c1fb',
'pretty_version' => 'v1.2.1',
'version' => '1.2.1.0',
'reference' => 'cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e',
'type' => 'library',
'install_path' => __DIR__ . '/../nextcloud/coding-standard',
'aliases' => array(),
'dev_requirement' => true,
),
'php-cs-fixer/shim' => array(
'pretty_version' => 'v3.17.0',
'version' => '3.17.0.0',
'reference' => 'f51b4aed90565c447136f1d015798f6f7c82490f',
'pretty_version' => 'v3.51.0',
'version' => '3.51.0.0',
'reference' => 'a792394f7f3934f75a4df9dca544796c6f503027',
'type' => 'application',
'install_path' => __DIR__ . '/../php-cs-fixer/shim',
'aliases' => array(),
Expand Down
27 changes: 27 additions & 0 deletions vendor/nextcloud/coding-standard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Changelog
All notable changes to this project will be documented in this file.

## 1.2.1 - 2024-02-01
### Fix
* fix: Remove `fully_qualified_strict_types` again by @nickvergessen in https://github.com/nextcloud/coding-standard/pull/16

## 1.2.0 - 2024-02-01
### Added
- `array_syntax`: Force short syntax for array
- `list_syntax`: Same for list
- ~~`fully_qualified_strict_types`: Remove namespace from classname when there is a `use` statement, and add missing backslash for global namespace~~ - Removed in 1.2.1 due to issues
- `no_leading_import_slash`: Remove leading slash from `use` statement
- `nullable_type_declaration_for_default_null_value`: Add missing `?` on type declaration for parameters defaulting to `null`. This will most likely be needed to avoid warnings in PHP 8.4.
- `yoda_style`: forbid yoda style comparision. This replaces `null === $a` by `$a === null`.

## 1.1.1 - 2023-06-23
### Changed
* feat: use php-cs-fixer/shim by @kesselb in https://github.com/nextcloud/coding-standard/pull/13

## 1.1.0 - 2023-04-13
### Changed
* Order imports alphabetically by @come-nc in https://github.com/nextcloud/coding-standard/pull/10
* fix(rules): Replace deprecated braces rules by @nickvergessen in https://github.com/nextcloud/coding-standard/pull/12

## 1.0.0 – 2021-11-10
### Breaking change
* Update php-cs-fixer to 3.x
* See https://github.com/nextcloud/coding-standard#upgrade-from-v0x-to-v10 for instructions.

## 0.5.0 – 2021-01-11
### Added
- New rule: short list syntax
Expand Down
2 changes: 1 addition & 1 deletion vendor/nextcloud/coding-standard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ For convenience you may add it to the `scripts` section of your `composer.json`:
}
```

*Note: Don't forget to exclude .php_cs.dist in your build scripts.*
*Note: Don't forget to exclude `.php-cs-fixer.dist.php` and `.php-cs-fixer.cache` in your build scripts.*

## Upgrade from v0.x to v1.0

Expand Down
5 changes: 5 additions & 0 deletions vendor/nextcloud/coding-standard/src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function getRules() : array {
'@PSR2' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => true,
'binary_operator_spaces' => [
'default' => 'single_space',
],
Expand All @@ -35,16 +36,19 @@ public function getRules() : array {
],
'indentation_type' => true,
'line_ending' => true,
'list_syntax' => true,
'lowercase_keywords' => true,
'method_argument_space' => [
'on_multiline' => 'ignore',
],
'no_closing_tag' => true,
'no_leading_import_slash' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unused_imports' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_imports' => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha'
Expand All @@ -57,6 +61,7 @@ public function getRules() : array {
'visibility_required' => [
'elements' => ['property', 'method', 'const']
],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
];
}
}
2 changes: 1 addition & 1 deletion vendor/php-cs-fixer/shim/logo.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The logo is © 2010-2022 Sensio Labs.
The logo is © 2010+ Sensio Labs.

Original resolution can be found at https://github.com/PHP-CS-Fixer/logo .
Binary file modified vendor/php-cs-fixer/shim/php-cs-fixer.phar
Binary file not shown.
Binary file modified vendor/php-cs-fixer/shim/php-cs-fixer.phar.asc
Binary file not shown.