From 322b619a7122fa812321ceb67016e0b1ce4affb6 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 3 Jan 2024 10:53:37 +0000 Subject: update sabre/dav --- vendor/sabre/dav/.github/workflows/ci.yml | 127 --------------------- vendor/sabre/dav/.php_cs.dist | 12 -- vendor/sabre/dav/.travis.yml | 73 ------------ vendor/sabre/dav/composer.json | 23 ++-- .../dav/lib/CalDAV/Backend/AbstractBackend.php | 4 +- vendor/sabre/dav/lib/CalDAV/Backend/PDO.php | 2 +- .../sabre/dav/lib/CalDAV/Backend/SyncSupport.php | 2 +- vendor/sabre/dav/lib/CalDAV/Calendar.php | 12 +- vendor/sabre/dav/lib/CalDAV/CalendarHome.php | 4 +- .../sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php | 7 -- vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php | 9 +- .../sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php | 2 +- vendor/sabre/dav/lib/CardDAV/AddressBook.php | 14 +-- vendor/sabre/dav/lib/CardDAV/AddressBookHome.php | 4 +- vendor/sabre/dav/lib/CardDAV/Backend/PDO.php | 2 +- .../sabre/dav/lib/CardDAV/Backend/SyncSupport.php | 2 +- .../Xml/Request/AddressBookMultiGetReport.php | 9 +- vendor/sabre/dav/lib/DAV/Client.php | 108 +++++++++++++----- vendor/sabre/dav/lib/DAV/INodeByPath.php | 36 ++++++ vendor/sabre/dav/lib/DAV/Sync/ISyncCollection.php | 2 +- vendor/sabre/dav/lib/DAV/Tree.php | 30 +++-- vendor/sabre/dav/lib/DAV/Version.php | 2 +- vendor/sabre/dav/lib/DAV/Xml/Element/Response.php | 46 +++++--- vendor/sabre/dav/lib/DAV/Xml/Property/Href.php | 13 +++ .../DAVACL/PrincipalBackend/BackendInterface.php | 2 +- 25 files changed, 225 insertions(+), 322 deletions(-) delete mode 100644 vendor/sabre/dav/.github/workflows/ci.yml delete mode 100644 vendor/sabre/dav/.php_cs.dist delete mode 100644 vendor/sabre/dav/.travis.yml create mode 100644 vendor/sabre/dav/lib/DAV/INodeByPath.php (limited to 'vendor/sabre') diff --git a/vendor/sabre/dav/.github/workflows/ci.yml b/vendor/sabre/dav/.github/workflows/ci.yml deleted file mode 100644 index f41b38535..000000000 --- a/vendor/sabre/dav/.github/workflows/ci.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: continuous-integration -on: - push: - branches: - - master - - release/* - pull_request: - -jobs: - code-analysis: - runs-on: ubuntu-latest - name: Code Analysis (PHP ${{ matrix.php-versions }}) - strategy: - fail-fast: false - matrix: - php-versions: [ '7.4' ] - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php - with: - php-version: ${{ matrix.php-versions }} - extensions: mbstring, dom, fileinfo, mysql, redis, opcache - tools: composer - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - # Use composer.json for key, if composer.lock is not committed. - # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - - name: PHP CS-Fixer - run: php vendor/bin/php-cs-fixer fix --dry-run --diff - - - name: PHPStan - run: composer phpstan - - unit-testing: - name: PHPUnit (PHP ${{ matrix.php-versions }}) - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0' ] - coverage: [ 'none' ] - streaming: [ false ] - include: - - php-versions: '8.1' - coverage: 'pcov' - streaming: true - - services: - mariadb: - image: mariadb - env: - MARIADB_DATABASE: 'sabredav_test' - MARIADB_ROOT_PASSWORD: root - ports: - - 3306:3306 - postgres: - image: postgres - env: - POSTGRES_DB: 'sabredav_test' - POSTGRES_PASSWORD: postgres - ports: - - 5432:5432 - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php - with: - php-version: ${{ matrix.php-versions }} - extensions: mbstring, dom, fileinfo, pdo_sqlite, pgsql, mysql, redis, opcache - coverage: ${{ matrix.coverage }} - tools: composer - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - # Use composer.json for key, if composer.lock is not committed. - # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - - name: PHPUnit - if: matrix.streaming == false - run: vendor/bin/phpunit --verbose --configuration tests/phpunit.xml --coverage-clover=coverage.xml - env: - SABRE_MYSQLUSER: root - SABRE_MYSQLPASS: root - SABRE_MYSQLDSN: "mysql:host=127.0.0.1;port=3306;dbname=sabredav_test" - SABRE_PGSQLDSN: "pgsql:host=127.0.0.1;port=5432;dbname=sabredav_test;user=postgres;password=postgres" - - - name: PHPUnit (with streaming) - if: matrix.streaming == true - run: vendor/bin/phpunit --verbose --configuration tests/phpunit.xml --coverage-clover=coverage.xml - env: - SABRE_MYSQLUSER: root - SABRE_MYSQLPASS: root - SABRE_MYSQLDSN: "mysql:host=127.0.0.1;port=3306;dbname=sabredav_test" - SABRE_PGSQLDSN: "pgsql:host=127.0.0.1;port=5432;dbname=sabredav_test;user=postgres;password=postgres" - RUN_TEST_WITH_STREAMING_PROPFIND: "true" - - - uses: codecov/codecov-action@v2 - if: matrix.coverage != 'none' diff --git a/vendor/sabre/dav/.php_cs.dist b/vendor/sabre/dav/.php_cs.dist deleted file mode 100644 index c5c78a971..000000000 --- a/vendor/sabre/dav/.php_cs.dist +++ /dev/null @@ -1,12 +0,0 @@ -getFinder() - ->exclude('vendor') - ->in(__DIR__); -$config->setRules([ - '@PSR1' => true, - '@Symfony' => true -]); - -return $config; \ No newline at end of file diff --git a/vendor/sabre/dav/.travis.yml b/vendor/sabre/dav/.travis.yml deleted file mode 100644 index 6214d80b3..000000000 --- a/vendor/sabre/dav/.travis.yml +++ /dev/null @@ -1,73 +0,0 @@ -language: php -sudo: required - -branches: - only: - - master - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -env: - global: - - SABRE_MYSQLUSER="root" - - SABRE_MYSQLPASS="" - - SABRE_MYSQLDSN="mysql:host=127.0.0.1;dbname=sabredav_test" - - RUN_PHPCSFIXER="TRUE" - - RUN_PHPUNIT="TRUE" - - RUN_PHPSTAN="FALSE" - matrix: - - PREFER_LOWEST="" TEST_DEPS="" REPORT_COVERAGE="TRUE" WITH_COVERAGE="--coverage-clover=coverage.xml" - - PREFER_LOWEST="--prefer-lowest" TEST_DEPS="tests/Sabre/" REPORT_COVERAGE="FALSE" WITH_COVERAGE="" - -matrix: - include: - - name: 'PHP8' - dist: bionic - php: 8.0 - env: - - RUN_PHPCSFIXER="FALSE" - - REPORT_COVERAGE="FALSE" - - name: 'PHPStan' - php: 7.4 - env: - - RUN_PHPCSFIXER="FALSE" - - RUN_PHPUNIT="FALSE" - - RUN_PHPSTAN="TRUE" - - REPORT_COVERAGE="FALSE" - - name: 'Test with streaming propfind' - php: 7.2 - env: - - RUN_TEST_WITH_STREAMING_PROPFIND="TRUE" - - REPORT_COVERAGE="FALSE" - fast_finish: true - -services: - - mysql - - postgresql - -before_script: - - mysql -u root -h 127.0.0.1 -e 'create database sabredav_test' - - psql -c "create database sabredav_test" -U postgres - - psql -c "create user sabredav with PASSWORD 'sabredav';GRANT ALL PRIVILEGES ON DATABASE sabredav_test TO sabredav" -U postgres - - if [ $RUN_PHPCSFIXER == "FALSE" ]; then composer remove --no-update --dev friendsofphp/php-cs-fixer; fi - - composer update $PREFER_LOWEST - -addons: - postgresql: "9.5" - -script: - - if [ $RUN_PHPCSFIXER == "TRUE" ]; then php vendor/bin/php-cs-fixer fix --dry-run --diff; fi - - if [ $RUN_PHPUNIT == "TRUE" ]; then php vendor/bin/phpunit --configuration tests/phpunit.xml $WITH_COVERAGE $TEST_DEPS; fi - - if [ $RUN_PHPUNIT == "TRUE" ]; then rm -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini; fi - - if [ $RUN_PHPSTAN == "TRUE" ]; then composer phpstan; fi - -after_success: - - if [ $REPORT_COVERAGE == "TRUE" ]; then bash <(curl -s https://codecov.io/bash); fi - -cache: - directories: - - $HOME/.composer/cache diff --git a/vendor/sabre/dav/composer.json b/vendor/sabre/dav/composer.json index 5f0a44d66..315417339 100644 --- a/vendor/sabre/dav/composer.json +++ b/vendor/sabre/dav/composer.json @@ -33,11 +33,11 @@ "ext-json": "*" }, "require-dev" : { - "friendsofphp/php-cs-fixer": "^2.17.1", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0", - "evert/phpdoc-md" : "~0.1.0", - "monolog/monolog": "^1.18" + "friendsofphp/php-cs-fixer": "^2.19", + "monolog/monolog": "^1.27 || ^2.0", + "phpstan/phpstan": "^0.12 || ^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "suggest" : { "ext-curl" : "*", @@ -46,21 +46,12 @@ }, "autoload": { "psr-4" : { - "Sabre\\DAV\\" : "lib/DAV/", - "Sabre\\DAVACL\\" : "lib/DAVACL/", - "Sabre\\CalDAV\\" : "lib/CalDAV/", - "Sabre\\CardDAV\\" : "lib/CardDAV/" + "Sabre\\" : "lib/" } }, "autoload-dev" : { "psr-4" : { - "Sabre\\" : "tests/Sabre/", - "Sabre\\CalDAV\\" : "tests/Sabre/CalDAV", - "Sabre\\CardDAV\\" : "tests/Sabre/CardDAV", - "Sabre\\DAV\\" : "tests/Sabre/DAV", - "Sabre\\DAV\\Property\\" : "tests/Sabre/DAV/Xml/Property", - "Sabre\\DAVACL\\" : "tests/Sabre/DAVACL", - "Sabre\\HTTP\\" : "tests/Sabre/HTTP" + "Sabre\\" : "tests/Sabre/" } }, "support" : { diff --git a/vendor/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php b/vendor/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php index c32c86489..c761bff51 100644 --- a/vendor/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php +++ b/vendor/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php @@ -78,7 +78,7 @@ abstract class AbstractBackend implements BackendInterface * * This default may well be good enough for personal use, and calendars * that aren't very large. But if you anticipate high usage, big calendars - * or high loads, you are strongly adviced to optimize certain paths. + * or high loads, you are strongly advised to optimize certain paths. * * The best way to do so is override this method and to optimize * specifically for 'common filters'. @@ -95,7 +95,7 @@ abstract class AbstractBackend implements BackendInterface * Note that especially time-range-filters may be difficult to parse. A * time-range filter specified on a VEVENT must for instance also handle * recurrence rules correctly. - * A good example of how to interprete all these filters can also simply + * A good example of how to interpret all these filters can also simply * be found in \Sabre\CalDAV\CalendarQueryFilter. This class is as correct * as possible, so it gives you a good idea on what type of stuff you need * to think of. diff --git a/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php b/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php index 2f48ab982..b9f112cf8 100644 --- a/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php +++ b/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php @@ -939,7 +939,7 @@ SQL; * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null) { diff --git a/vendor/sabre/dav/lib/CalDAV/Backend/SyncSupport.php b/vendor/sabre/dav/lib/CalDAV/Backend/SyncSupport.php index c7f67d176..bfc1dafc2 100644 --- a/vendor/sabre/dav/lib/CalDAV/Backend/SyncSupport.php +++ b/vendor/sabre/dav/lib/CalDAV/Backend/SyncSupport.php @@ -77,7 +77,7 @@ interface SyncSupport extends BackendInterface * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null); } diff --git a/vendor/sabre/dav/lib/CalDAV/Calendar.php b/vendor/sabre/dav/lib/CalDAV/Calendar.php index 6e989314d..6c0bf5411 100644 --- a/vendor/sabre/dav/lib/CalDAV/Calendar.php +++ b/vendor/sabre/dav/lib/CalDAV/Calendar.php @@ -186,17 +186,17 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection, * The contents of the new file must be a valid ICalendar string. * * @param string $name - * @param resource $calendarData + * @param resource $data * * @return string|null */ - public function createFile($name, $calendarData = null) + public function createFile($name, $data = null) { - if (is_resource($calendarData)) { - $calendarData = stream_get_contents($calendarData); + if (is_resource($data)) { + $data = stream_get_contents($data); } - return $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $calendarData); + return $this->caldavBackend->createCalendarObject($this->calendarInfo['id'], $name, $data); } /** @@ -442,7 +442,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection, * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChanges($syncToken, $syncLevel, $limit = null) { diff --git a/vendor/sabre/dav/lib/CalDAV/CalendarHome.php b/vendor/sabre/dav/lib/CalDAV/CalendarHome.php index 159ddcc67..49c54a37a 100644 --- a/vendor/sabre/dav/lib/CalDAV/CalendarHome.php +++ b/vendor/sabre/dav/lib/CalDAV/CalendarHome.php @@ -96,10 +96,10 @@ class CalendarHome implements DAV\IExtendedCollection, DAVACL\IACL * * This is currently not allowed * - * @param string $filename + * @param string $name * @param resource $data */ - public function createFile($filename, $data = null) + public function createFile($name, $data = null) { throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported'); } diff --git a/vendor/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php b/vendor/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php index e050ac273..dcaf951ef 100644 --- a/vendor/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/vendor/sabre/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -30,13 +30,6 @@ class IMipPlugin extends DAV\ServerPlugin */ protected $senderEmail; - /** - * ITipMessage. - * - * @var ITip\Message - */ - protected $itipMessage; - /** * Creates the email handler. * diff --git a/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php b/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php index 3cc360f1d..5e5659610 100644 --- a/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php +++ b/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php @@ -605,10 +605,9 @@ class Plugin extends ServerPlugin * * This method may update $newObject to add any status changes. * - * @param VCalendar|string $oldObject - * @param array $ignore any addresses to not send messages to - * @param bool $modified a marker to indicate that the original object - * modified by this process + * @param VCalendar|string|null $oldObject + * @param array $ignore any addresses to not send messages to + * @param bool $modified a marker to indicate that the original object modified by this process */ protected function processICalendarChange($oldObject, VCalendar $newObject, array $addresses, array $ignore = [], &$modified = false) { @@ -969,7 +968,7 @@ class Plugin extends ServerPlugin * * @return bool */ - private function scheduleReply(RequestInterface $request) + protected function scheduleReply(RequestInterface $request) { $scheduleReply = $request->getHeader('Schedule-Reply'); diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php index c9a3cb5ac..f1d66cc0d 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php @@ -53,7 +53,7 @@ class PropFilter implements XmlDeserializable 'is-not-defined' => false, 'param-filters' => [], 'text-match' => null, - 'time-range' => false, + 'time-range' => [], ]; $att = $reader->parseAttributes(); diff --git a/vendor/sabre/dav/lib/CardDAV/AddressBook.php b/vendor/sabre/dav/lib/CardDAV/AddressBook.php index 86994f2d5..f5744f644 100644 --- a/vendor/sabre/dav/lib/CardDAV/AddressBook.php +++ b/vendor/sabre/dav/lib/CardDAV/AddressBook.php @@ -129,19 +129,19 @@ class AddressBook extends DAV\Collection implements IAddressBook, DAV\IPropertie * This method may return an ETag. * * @param string $name - * @param resource $vcardData + * @param resource $data * * @return string|null */ - public function createFile($name, $vcardData = null) + public function createFile($name, $data = null) { - if (is_resource($vcardData)) { - $vcardData = stream_get_contents($vcardData); + if (is_resource($data)) { + $data = stream_get_contents($data); } // Converting to UTF-8, if needed - $vcardData = DAV\StringUtil::ensureUTF8($vcardData); + $data = DAV\StringUtil::ensureUTF8($data); - return $this->carddavBackend->createCard($this->addressBookInfo['id'], $name, $vcardData); + return $this->carddavBackend->createCard($this->addressBookInfo['id'], $name, $data); } /** @@ -317,7 +317,7 @@ class AddressBook extends DAV\Collection implements IAddressBook, DAV\IPropertie * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChanges($syncToken, $syncLevel, $limit = null) { diff --git a/vendor/sabre/dav/lib/CardDAV/AddressBookHome.php b/vendor/sabre/dav/lib/CardDAV/AddressBookHome.php index 884e9b24e..d7365fbe8 100644 --- a/vendor/sabre/dav/lib/CardDAV/AddressBookHome.php +++ b/vendor/sabre/dav/lib/CardDAV/AddressBookHome.php @@ -92,10 +92,10 @@ class AddressBookHome extends DAV\Collection implements DAV\IExtendedCollection, * * This is currently not allowed * - * @param string $filename + * @param string $name * @param resource $data */ - public function createFile($filename, $data = null) + public function createFile($name, $data = null) { throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported'); } diff --git a/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php b/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php index 966d7ba09..4ca9284a9 100644 --- a/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php +++ b/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php @@ -452,7 +452,7 @@ class PDO extends AbstractBackend implements SyncSupport * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) { diff --git a/vendor/sabre/dav/lib/CardDAV/Backend/SyncSupport.php b/vendor/sabre/dav/lib/CardDAV/Backend/SyncSupport.php index 071361ed0..6aaad1415 100644 --- a/vendor/sabre/dav/lib/CardDAV/Backend/SyncSupport.php +++ b/vendor/sabre/dav/lib/CardDAV/Backend/SyncSupport.php @@ -77,7 +77,7 @@ interface SyncSupport extends BackendInterface * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null); } diff --git a/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php b/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php index c11d2dd73..491f96908 100644 --- a/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php +++ b/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookMultiGetReport.php @@ -38,7 +38,7 @@ class AddressBookMultiGetReport implements XmlDeserializable public $hrefs; /** - * The mimetype of the content that should be returend. Usually + * The mimetype of the content that should be returned. Usually * text/vcard. * * @var string @@ -53,6 +53,13 @@ class AddressBookMultiGetReport implements XmlDeserializable */ public $version = null; + /** + * An array with requested vcard properties. + * + * @var array + */ + public $addressDataProperties; + /** * The deserialize method is called during xml parsing. * diff --git a/vendor/sabre/dav/lib/DAV/Client.php b/vendor/sabre/dav/lib/DAV/Client.php index a9de71cdb..1028a6b9d 100644 --- a/vendor/sabre/dav/lib/DAV/Client.php +++ b/vendor/sabre/dav/lib/DAV/Client.php @@ -174,27 +174,98 @@ class Client extends HTTP\Client } /** - * Does a PROPFIND request. + * Does a PROPFIND request with filtered response returning only available properties. * * The list of requested properties must be specified as an array, in clark * notation. * - * The returned array will contain a list of filenames as keys, and - * properties as values. + * Depth should be either 0 or 1. A depth of 1 will cause a request to be + * made to the server to also return all child resources. + * + * For depth 0, just the array of properties for the resource is returned. + * + * For depth 1, the returned array will contain a list of resource names as keys, + * and an array of properties as values. * - * The properties array will contain the list of properties. Only properties - * that are actually returned from the server (without error) will be + * The array of properties will contain the properties as keys with their values as the value. + * Only properties that are actually returned from the server without error will be * returned, anything else is discarded. * + * @param 1|0 $depth + */ + public function propFind($url, array $properties, $depth = 0): array + { + $result = $this->doPropFind($url, $properties, $depth); + + // If depth was 0, we only return the top item + if (0 === $depth) { + reset($result); + $result = current($result); + + return isset($result[200]) ? $result[200] : []; + } + + $newResult = []; + foreach ($result as $href => $statusList) { + $newResult[$href] = isset($statusList[200]) ? $statusList[200] : []; + } + + return $newResult; + } + + /** + * Does a PROPFIND request with unfiltered response. + * + * The list of requested properties must be specified as an array, in clark + * notation. + * * Depth should be either 0 or 1. A depth of 1 will cause a request to be * made to the server to also return all child resources. * - * @param string $url - * @param int $depth + * For depth 0, just the multi-level array of status and properties for the resource is returned. * - * @return array + * For depth 1, the returned array will contain a list of resources as keys and + * a multi-level array containing status and properties as value. + * + * The multi-level array of status and properties is formatted the same as what is + * documented for parseMultiStatus. + * + * All properties that are actually returned from the server are returned by this method. + * + * @param 1|0 $depth + */ + public function propFindUnfiltered(string $url, array $properties, int $depth = 0): array + { + $result = $this->doPropFind($url, $properties, $depth); + + // If depth was 0, we only return the top item + if (0 === $depth) { + reset($result); + + return current($result); + } else { + return $result; + } + } + + /** + * Does a PROPFIND request. + * + * The list of requested properties must be specified as an array, in clark + * notation. + * + * Depth should be either 0 or 1. A depth of 1 will cause a request to be + * made to the server to also return all child resources. + * + * The returned array will contain a list of resources as keys and + * a multi-level array containing status and properties as value. + * + * The multi-level array of status and properties is formatted the same as what is + * documented for parseMultiStatus. + * + * @param 1|0 $depth */ - public function propFind($url, array $properties, $depth = 0) + private function doPropFind($url, array $properties, $depth = 0): array { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->formatOutput = true; @@ -232,22 +303,7 @@ class Client extends HTTP\Client throw new HTTP\ClientHttpException($response); } - $result = $this->parseMultiStatus($response->getBodyAsString()); - - // If depth was 0, we only return the top item - if (0 === $depth) { - reset($result); - $result = current($result); - - return isset($result[200]) ? $result[200] : []; - } - - $newResult = []; - foreach ($result as $href => $statusList) { - $newResult[$href] = isset($statusList[200]) ? $statusList[200] : []; - } - - return $newResult; + return $this->parseMultiStatus($response->getBodyAsString()); } /** @@ -385,7 +441,7 @@ class Client extends HTTP\Client { return Uri\resolve( $this->baseUri, - $url + (string) $url ); } diff --git a/vendor/sabre/dav/lib/DAV/INodeByPath.php b/vendor/sabre/dav/lib/DAV/INodeByPath.php new file mode 100644 index 000000000..4d63a33bd --- /dev/null +++ b/vendor/sabre/dav/lib/DAV/INodeByPath.php @@ -0,0 +1,36 @@ +rootNode; } - // Attempting to fetch its parent - list($parentName, $baseName) = Uri\split($path); + $parts = explode('/', $path); + $node = $this->rootNode; - // If there was no parent, we must simply ask it from the root node. - if ('' === $parentName) { - $node = $this->rootNode->getChild($baseName); - } else { - // Otherwise, we recursively grab the parent and ask him/her. - $parent = $this->getNodeForPath($parentName); - - if (!($parent instanceof ICollection)) { + while (count($parts)) { + if (!($node instanceof ICollection)) { throw new Exception\NotFound('Could not find node at path: '.$path); } - $node = $parent->getChild($baseName); + + if ($node instanceof INodeByPath) { + $targetNode = $node->getNodeForPath(implode('/', $parts)); + if ($targetNode instanceof Node) { + $node = $targetNode; + break; + } + } + + $part = array_shift($parts); + if ('' !== $part) { + $node = $node->getChild($part); + } } $this->cache[$path] = $node; diff --git a/vendor/sabre/dav/lib/DAV/Version.php b/vendor/sabre/dav/lib/DAV/Version.php index c6273ef72..345c62d7e 100644 --- a/vendor/sabre/dav/lib/DAV/Version.php +++ b/vendor/sabre/dav/lib/DAV/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - public const VERSION = '4.4.0'; + public const VERSION = '4.6.0'; } diff --git a/vendor/sabre/dav/lib/DAV/Xml/Element/Response.php b/vendor/sabre/dav/lib/DAV/Xml/Element/Response.php index 79f06a09b..df9291465 100644 --- a/vendor/sabre/dav/lib/DAV/Xml/Element/Response.php +++ b/vendor/sabre/dav/lib/DAV/Xml/Element/Response.php @@ -40,7 +40,7 @@ class Response implements Element * * This is currently only used in WebDAV-Sync * - * @var string + * @var string|null */ protected $httpStatus; @@ -112,13 +112,21 @@ class Response implements Element */ public function xmlSerialize(Writer $writer) { - if ($status = $this->getHTTPStatus()) { - $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]); - } + /* + * Accordingly to the RFC the element looks like: + * + * + * So the response + * - MUST contain a href and + * - EITHER a status and additional href(s) + * OR one or more propstat(s) + */ $writer->writeElement('{DAV:}href', $writer->contextUri.\Sabre\HTTP\encodePath($this->getHref())); $empty = true; + $httpStatus = $this->getHTTPStatus(); + // Add propstat elements foreach ($this->getResponseProperties() as $status => $properties) { // Skipping empty lists if (!$properties || (!is_int($status) && !ctype_digit($status))) { @@ -130,19 +138,25 @@ class Response implements Element $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]); $writer->endElement(); // {DAV:}propstat } + + // The WebDAV spec only allows the status element on responses _without_ a propstat if ($empty) { - /* - * The WebDAV spec _requires_ at least one DAV:propstat to appear for - * every DAV:response. In some circumstances however, there are no - * properties to encode. - * - * In those cases we MUST specify at least one DAV:propstat anyway, with - * no properties. - */ - $writer->writeElement('{DAV:}propstat', [ - '{DAV:}prop' => [], - '{DAV:}status' => 'HTTP/1.1 418 '.\Sabre\HTTP\Response::$statusCodes[418], - ]); + if (null !== $httpStatus) { + $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$httpStatus.' '.\Sabre\HTTP\Response::$statusCodes[$httpStatus]); + } else { + /* + * The WebDAV spec _requires_ at least one DAV:propstat to appear for + * every DAV:response if there is no status. + * In some circumstances however, there are no properties to encode. + * + * In those cases we MUST specify at least one DAV:propstat anyway, with + * no properties. + */ + $writer->writeElement('{DAV:}propstat', [ + '{DAV:}prop' => [], + '{DAV:}status' => 'HTTP/1.1 418 '.\Sabre\HTTP\Response::$statusCodes[418], + ]); + } } } diff --git a/vendor/sabre/dav/lib/DAV/Xml/Property/Href.php b/vendor/sabre/dav/lib/DAV/Xml/Property/Href.php index f88ce814a..d4e43da7c 100644 --- a/vendor/sabre/dav/lib/DAV/Xml/Property/Href.php +++ b/vendor/sabre/dav/lib/DAV/Xml/Property/Href.php @@ -34,6 +34,19 @@ class Href implements Element, HtmlOutput */ protected $hrefs; + /** + * Automatically prefix the url with the server base directory. + * Note: use of this property in code was removed in PR: + * https://github.com/sabre-io/dav/pull/801 + * But the property is left here because old data may still exist + * that has this property saved. + * See discussion in issue: + * https://github.com/sabre-io/Baikal/issues/1154. + * + * @var bool + */ + protected $autoPrefix = true; + /** * Constructor. * diff --git a/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php b/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php index 7140a9295..2fd31913d 100644 --- a/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php +++ b/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php @@ -48,7 +48,7 @@ interface BackendInterface public function getPrincipalByPath($path); /** - * Updates one ore more webdav properties on a principal. + * Updates one or more webdav properties on a principal. * * The list of mutations is stored in a Sabre\DAV\PropPatch object. * To do the actual updates, you must tell this object which properties -- cgit v1.2.3 From 85001c034b1353e7602911f9fbdf017188ed8b07 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 3 Jan 2024 10:58:31 +0000 Subject: update sabre/vobject --- vendor/sabre/vobject/lib/DateTimeParser.php | 2 +- vendor/sabre/vobject/lib/ITip/Broker.php | 6 +++--- vendor/sabre/vobject/lib/Version.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'vendor/sabre') diff --git a/vendor/sabre/vobject/lib/DateTimeParser.php b/vendor/sabre/vobject/lib/DateTimeParser.php index 1c253437a..c5dbac97d 100644 --- a/vendor/sabre/vobject/lib/DateTimeParser.php +++ b/vendor/sabre/vobject/lib/DateTimeParser.php @@ -104,7 +104,7 @@ class DateTimeParser if (!$asString) { $invert = false; - if ('-' === $matches['plusminus']) { + if (isset($matches['plusminus']) && '-' === $matches['plusminus']) { $invert = true; } diff --git a/vendor/sabre/vobject/lib/ITip/Broker.php b/vendor/sabre/vobject/lib/ITip/Broker.php index b66a59f54..80d9a5b31 100644 --- a/vendor/sabre/vobject/lib/ITip/Broker.php +++ b/vendor/sabre/vobject/lib/ITip/Broker.php @@ -156,9 +156,9 @@ class Broker * people. If the user was an attendee, we need to make sure that the * organizer gets the 'declined' message. * - * @param VCalendar|string $calendar - * @param string|array $userHref - * @param VCalendar|string $oldCalendar + * @param VCalendar|string $calendar + * @param string|array $userHref + * @param VCalendar|string|null $oldCalendar * * @return array */ diff --git a/vendor/sabre/vobject/lib/Version.php b/vendor/sabre/vobject/lib/Version.php index 63349e47e..c7ca69e14 100644 --- a/vendor/sabre/vobject/lib/Version.php +++ b/vendor/sabre/vobject/lib/Version.php @@ -14,5 +14,5 @@ class Version /** * Full version number. */ - public const VERSION = '4.5.3'; + public const VERSION = '4.5.4'; } -- cgit v1.2.3 From 6bf61dfa6b585db01b607a79bd64ec9c583a9c10 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 14 Mar 2024 09:35:09 +0000 Subject: composer update and use the fixed streams php-jcs library until the floats issue will be fixed upstream. see here for reference https://codeberg.org/streams/streams/issues/151 --- vendor/sabre/http/CHANGELOG.md | 21 +++++++ vendor/sabre/http/lib/Client.php | 5 +- vendor/sabre/http/lib/Sapi.php | 6 ++ vendor/sabre/http/lib/Version.php | 2 +- vendor/sabre/uri/composer.json | 14 ++++- vendor/sabre/uri/lib/Version.php | 2 +- vendor/sabre/uri/lib/functions.php | 79 +++++++++++++++---------- vendor/sabre/xml/lib/Deserializer/functions.php | 2 +- vendor/sabre/xml/lib/Version.php | 2 +- 9 files changed, 94 insertions(+), 39 deletions(-) (limited to 'vendor/sabre') diff --git a/vendor/sabre/http/CHANGELOG.md b/vendor/sabre/http/CHANGELOG.md index 2dddce4fb..7c6f4b6ec 100644 --- a/vendor/sabre/http/CHANGELOG.md +++ b/vendor/sabre/http/CHANGELOG.md @@ -1,6 +1,27 @@ ChangeLog ========= +5.1.10 (2023-08-18) +------------------ + +* #225 Enhance tests/bootstrap.php to find autoloader in more environments (@phil-davis) + +5.1.9 (2023-08-17) +------------------ + +* #223 skip testParseMimeTypeOnInvalidMimeType (@phil-davis) + +5.1.8 (2023-08-17) +------------------ + +* #215 Improve CURLOPT_HTTPHEADER Setting Assignment (@amrita-shrestha) + +5.1.7 (2023-06-26) +------------------ + +* #98 and #176 Add more tests (@peter279k) +* #207 fix: handle client disconnect properly with ignore_user_abort true (@kesselb) + 5.1.6 (2022-07-15) ------------------ diff --git a/vendor/sabre/http/lib/Client.php b/vendor/sabre/http/lib/Client.php index 2bc7483a7..0837e8d2a 100644 --- a/vendor/sabre/http/lib/Client.php +++ b/vendor/sabre/http/lib/Client.php @@ -402,7 +402,10 @@ class Client extends EventEmitter $nHeaders[] = $key.': '.$value; } } - $settings[CURLOPT_HTTPHEADER] = $nHeaders; + + if ([] !== $nHeaders) { + $settings[CURLOPT_HTTPHEADER] = $nHeaders; + } $settings[CURLOPT_URL] = $request->getUrl(); // FIXME: CURLOPT_PROTOCOLS is currently unsupported by HHVM if (defined('CURLOPT_PROTOCOLS')) { diff --git a/vendor/sabre/http/lib/Sapi.php b/vendor/sabre/http/lib/Sapi.php index f8e8397fc..55a4c46e7 100644 --- a/vendor/sabre/http/lib/Sapi.php +++ b/vendor/sabre/http/lib/Sapi.php @@ -115,6 +115,12 @@ class Sapi if ($copied <= 0) { break; } + // Abort on client disconnect. + // With ignore_user_abort(true), the script is not aborted on client disconnect. + // To avoid reading the entire stream and dismissing the data afterward, check between the chunks if the client is still there. + if (1 === ignore_user_abort() && 1 === connection_aborted()) { + break; + } $left -= $copied; } } else { diff --git a/vendor/sabre/http/lib/Version.php b/vendor/sabre/http/lib/Version.php index 47582f22e..93c64797b 100644 --- a/vendor/sabre/http/lib/Version.php +++ b/vendor/sabre/http/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '5.1.6'; + const VERSION = '5.1.10'; } diff --git a/vendor/sabre/uri/composer.json b/vendor/sabre/uri/composer.json index 0e0cf2d36..03c33877c 100644 --- a/vendor/sabre/uri/composer.json +++ b/vendor/sabre/uri/composer.json @@ -37,9 +37,12 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.9", - "phpstan/phpstan": "^1.8", - "phpunit/phpunit" : "^9.0" + "friendsofphp/php-cs-fixer": "^3.17", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-strict-rules": "^1.5", + "phpstan/extension-installer": "^1.3", + "phpunit/phpunit" : "^9.6" }, "scripts": { "phpstan": [ @@ -56,5 +59,10 @@ "composer cs-fixer", "composer phpunit" ] + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true + } } } diff --git a/vendor/sabre/uri/lib/Version.php b/vendor/sabre/uri/lib/Version.php index e4f289e90..a30694f2c 100644 --- a/vendor/sabre/uri/lib/Version.php +++ b/vendor/sabre/uri/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - public const VERSION = '2.3.2'; + public const VERSION = '2.3.3'; } diff --git a/vendor/sabre/uri/lib/functions.php b/vendor/sabre/uri/lib/functions.php index 64e64027f..01ef92d7e 100644 --- a/vendor/sabre/uri/lib/functions.php +++ b/vendor/sabre/uri/lib/functions.php @@ -26,15 +26,15 @@ function resolve(string $basePath, string $newPath): string // If the new path defines a scheme, it's absolute and we can just return // that. - if ($delta['scheme']) { + if (null !== $delta['scheme']) { return build($delta); } $base = parse($basePath); $pick = function ($part) use ($base, $delta) { - if ($delta[$part]) { + if (null !== $delta[$part]) { return $delta[$part]; - } elseif ($base[$part]) { + } elseif (null !== $base[$part]) { return $base[$part]; } @@ -47,7 +47,6 @@ function resolve(string $basePath, string $newPath): string $newParts['host'] = $pick('host'); $newParts['port'] = $pick('port'); - $path = ''; if (is_string($delta['path']) and strlen($delta['path']) > 0) { // If the path starts with a slash if ('/' === $delta['path'][0]) { @@ -62,7 +61,10 @@ function resolve(string $basePath, string $newPath): string $path .= '/'.$delta['path']; } } else { - $path = $base['path'] ?: '/'; + $path = $base['path'] ?? '/'; + if ('' === $path) { + $path = '/'; + } } // Removing .. and . $pathParts = explode('/', $path); @@ -85,13 +87,17 @@ function resolve(string $basePath, string $newPath): string // If the source url ended with a /, we want to preserve that. $newParts['path'] = 0 === strpos($path, '/') ? $path : '/'.$path; - if ($delta['query']) { + // From PHP 8, no "?" query at all causes 'query' to be null. + // An empty query "http://example.com/foo?" causes 'query' to be the empty string + if (null !== $delta['query'] && '' !== $delta['query']) { $newParts['query'] = $delta['query']; - } elseif (!empty($base['query']) && empty($delta['host']) && empty($delta['path'])) { + } elseif (isset($base['query']) && null === $delta['host'] && null === $delta['path']) { // Keep the old query if host and path didn't change $newParts['query'] = $base['query']; } - if ($delta['fragment']) { + // From PHP 8, no "#" fragment at all causes 'fragment' to be null. + // An empty fragment "http://example.com/foo#" causes 'fragment' to be the empty string + if (null !== $delta['fragment'] && '' !== $delta['fragment']) { $newParts['fragment'] = $delta['fragment']; } @@ -113,7 +119,7 @@ function normalize(string $uri): string { $parts = parse($uri); - if (!empty($parts['path'])) { + if (null !== $parts['path']) { $pathParts = explode('/', ltrim($parts['path'], '/')); $newPathParts = []; foreach ($pathParts as $pathPart) { @@ -134,14 +140,14 @@ function normalize(string $uri): string $parts['path'] = '/'.implode('/', $newPathParts); } - if ($parts['scheme']) { + if (null !== $parts['scheme']) { $parts['scheme'] = strtolower($parts['scheme']); $defaultPorts = [ 'http' => '80', 'https' => '443', ]; - if (!empty($parts['port']) && isset($defaultPorts[$parts['scheme']]) && $defaultPorts[$parts['scheme']] == $parts['port']) { + if (null !== $parts['port'] && isset($defaultPorts[$parts['scheme']]) && $defaultPorts[$parts['scheme']] == $parts['port']) { // Removing default ports. unset($parts['port']); } @@ -149,7 +155,7 @@ function normalize(string $uri): string switch ($parts['scheme']) { case 'http': case 'https': - if (empty($parts['path'])) { + if (null === $parts['path']) { // An empty path is equivalent to / in http. $parts['path'] = '/'; } @@ -157,7 +163,7 @@ function normalize(string $uri): string } } - if ($parts['host']) { + if (null !== $parts['host']) { $parts['host'] = strtolower($parts['host']); } @@ -201,7 +207,7 @@ function parse(string $uri): array } $result = parse_url($uri); - if (!$result) { + if (false === $result) { $result = _parse_fallback($uri); } @@ -238,32 +244,32 @@ function build(array $parts): string $uri = ''; $authority = ''; - if (!empty($parts['host'])) { + if (isset($parts['host'])) { $authority = $parts['host']; - if (!empty($parts['user'])) { + if (isset($parts['user'])) { $authority = $parts['user'].'@'.$authority; } - if (!empty($parts['port'])) { + if (isset($parts['port'])) { $authority = $authority.':'.$parts['port']; } } - if (!empty($parts['scheme'])) { + if (isset($parts['scheme'])) { // If there's a scheme, there's also a host. $uri = $parts['scheme'].':'; } - if ($authority || (!empty($parts['scheme']) && 'file' === $parts['scheme'])) { + if ('' !== $authority || (isset($parts['scheme']) && 'file' === $parts['scheme'])) { // No scheme, but there is a host. $uri .= '//'.$authority; } - if (!empty($parts['path'])) { + if (isset($parts['path'])) { $uri .= $parts['path']; } - if (!empty($parts['query'])) { + if (isset($parts['query'])) { $uri .= '?'.$parts['query']; } - if (!empty($parts['fragment'])) { + if (isset($parts['fragment'])) { $uri .= '#'.$parts['fragment']; } @@ -290,7 +296,7 @@ function build(array $parts): string function split(string $path): array { $matches = []; - if (preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u', $path, $matches)) { + if (1 === preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u', $path, $matches)) { return [$matches[1], $matches[2]]; } @@ -307,7 +313,7 @@ function split(string $path): array * This function is only called if the main parse method fails. It's pretty * crude and probably slow, so the original parse_url is usually preferred. * - * @return array + * @return array{scheme: string|null, host: string|null, path: string|null, port: positive-int|null, user: string|null, query: string|null, fragment: string|null} * * @throws InvalidUriException */ @@ -340,10 +346,14 @@ function _parse_fallback(string $uri): array 'query' => null, ]; - if (preg_match('% ^([A-Za-z][A-Za-z0-9+-\.]+): %x', $uri, $matches)) { + if (1 === preg_match('% ^([A-Za-z][A-Za-z0-9+-\.]+): %x', $uri, $matches)) { $result['scheme'] = $matches[1]; // Take what's left. $uri = substr($uri, strlen($result['scheme']) + 1); + if (false === $uri) { + // There was nothing left. + $uri = ''; + } } // Taking off a fragment part @@ -358,7 +368,11 @@ function _parse_fallback(string $uri): array if ('///' === substr($uri, 0, 3)) { // The triple slash uris are a bit unusual, but we have special handling // for them. - $result['path'] = substr($uri, 2); + $path = substr($uri, 2); + if (false === $path) { + throw new \RuntimeException('The string cannot be false'); + } + $result['path'] = $path; $result['host'] = ''; } elseif ('//' === substr($uri, 0, 2)) { // Uris that have an authority part. @@ -369,22 +383,25 @@ function _parse_fallback(string $uri): array (?: : (? [0-9]+))? (? / .*)? $%x'; - if (!preg_match($regex, $uri, $matches)) { + if (1 !== preg_match($regex, $uri, $matches)) { throw new InvalidUriException('Invalid, or could not parse URI'); } - if ($matches['host']) { + if (isset($matches['host']) && '' !== $matches['host']) { $result['host'] = $matches['host']; } if (isset($matches['port'])) { - $result['port'] = (int) $matches['port']; + $port = (int) $matches['port']; + if ($port > 0) { + $result['port'] = $port; + } } if (isset($matches['path'])) { $result['path'] = $matches['path']; } - if ($matches['user']) { + if (isset($matches['user']) && '' !== $matches['user']) { $result['user'] = $matches['user']; } - if ($matches['pass']) { + if (isset($matches['pass']) && '' !== $matches['pass']) { $result['pass'] = $matches['pass']; } } else { diff --git a/vendor/sabre/xml/lib/Deserializer/functions.php b/vendor/sabre/xml/lib/Deserializer/functions.php index c4f240970..62d4d0e07 100644 --- a/vendor/sabre/xml/lib/Deserializer/functions.php +++ b/vendor/sabre/xml/lib/Deserializer/functions.php @@ -216,7 +216,7 @@ function valueObject(Reader $reader, string $className, string $namespace) $reader->next(); } } else { - if (!$reader->read()) { + if (Reader::END_ELEMENT !== $reader->nodeType && !$reader->read()) { break; } } diff --git a/vendor/sabre/xml/lib/Version.php b/vendor/sabre/xml/lib/Version.php index 1144bf085..6b6c53b18 100644 --- a/vendor/sabre/xml/lib/Version.php +++ b/vendor/sabre/xml/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '2.2.5'; + const VERSION = '2.2.6'; } -- cgit v1.2.3 From 55097c47c5534d4453f7494f8a1542f7beb4d588 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 14 Mar 2024 10:13:22 +0000 Subject: Revert "composer update and use the fixed streams php-jcs library until the floats issue will be fixed upstream. see here for reference https://codeberg.org/streams/streams/issues/151" This reverts commit 6bf61dfa6b585db01b607a79bd64ec9c583a9c10. --- vendor/sabre/http/CHANGELOG.md | 21 ------- vendor/sabre/http/lib/Client.php | 5 +- vendor/sabre/http/lib/Sapi.php | 6 -- vendor/sabre/http/lib/Version.php | 2 +- vendor/sabre/uri/composer.json | 14 +---- vendor/sabre/uri/lib/Version.php | 2 +- vendor/sabre/uri/lib/functions.php | 79 ++++++++++--------------- vendor/sabre/xml/lib/Deserializer/functions.php | 2 +- vendor/sabre/xml/lib/Version.php | 2 +- 9 files changed, 39 insertions(+), 94 deletions(-) (limited to 'vendor/sabre') diff --git a/vendor/sabre/http/CHANGELOG.md b/vendor/sabre/http/CHANGELOG.md index 7c6f4b6ec..2dddce4fb 100644 --- a/vendor/sabre/http/CHANGELOG.md +++ b/vendor/sabre/http/CHANGELOG.md @@ -1,27 +1,6 @@ ChangeLog ========= -5.1.10 (2023-08-18) ------------------- - -* #225 Enhance tests/bootstrap.php to find autoloader in more environments (@phil-davis) - -5.1.9 (2023-08-17) ------------------- - -* #223 skip testParseMimeTypeOnInvalidMimeType (@phil-davis) - -5.1.8 (2023-08-17) ------------------- - -* #215 Improve CURLOPT_HTTPHEADER Setting Assignment (@amrita-shrestha) - -5.1.7 (2023-06-26) ------------------- - -* #98 and #176 Add more tests (@peter279k) -* #207 fix: handle client disconnect properly with ignore_user_abort true (@kesselb) - 5.1.6 (2022-07-15) ------------------ diff --git a/vendor/sabre/http/lib/Client.php b/vendor/sabre/http/lib/Client.php index 0837e8d2a..2bc7483a7 100644 --- a/vendor/sabre/http/lib/Client.php +++ b/vendor/sabre/http/lib/Client.php @@ -402,10 +402,7 @@ class Client extends EventEmitter $nHeaders[] = $key.': '.$value; } } - - if ([] !== $nHeaders) { - $settings[CURLOPT_HTTPHEADER] = $nHeaders; - } + $settings[CURLOPT_HTTPHEADER] = $nHeaders; $settings[CURLOPT_URL] = $request->getUrl(); // FIXME: CURLOPT_PROTOCOLS is currently unsupported by HHVM if (defined('CURLOPT_PROTOCOLS')) { diff --git a/vendor/sabre/http/lib/Sapi.php b/vendor/sabre/http/lib/Sapi.php index 55a4c46e7..f8e8397fc 100644 --- a/vendor/sabre/http/lib/Sapi.php +++ b/vendor/sabre/http/lib/Sapi.php @@ -115,12 +115,6 @@ class Sapi if ($copied <= 0) { break; } - // Abort on client disconnect. - // With ignore_user_abort(true), the script is not aborted on client disconnect. - // To avoid reading the entire stream and dismissing the data afterward, check between the chunks if the client is still there. - if (1 === ignore_user_abort() && 1 === connection_aborted()) { - break; - } $left -= $copied; } } else { diff --git a/vendor/sabre/http/lib/Version.php b/vendor/sabre/http/lib/Version.php index 93c64797b..47582f22e 100644 --- a/vendor/sabre/http/lib/Version.php +++ b/vendor/sabre/http/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '5.1.10'; + const VERSION = '5.1.6'; } diff --git a/vendor/sabre/uri/composer.json b/vendor/sabre/uri/composer.json index 03c33877c..0e0cf2d36 100644 --- a/vendor/sabre/uri/composer.json +++ b/vendor/sabre/uri/composer.json @@ -37,12 +37,9 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.17", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-phpunit": "^1.3", - "phpstan/phpstan-strict-rules": "^1.5", - "phpstan/extension-installer": "^1.3", - "phpunit/phpunit" : "^9.6" + "friendsofphp/php-cs-fixer": "^3.9", + "phpstan/phpstan": "^1.8", + "phpunit/phpunit" : "^9.0" }, "scripts": { "phpstan": [ @@ -59,10 +56,5 @@ "composer cs-fixer", "composer phpunit" ] - }, - "config": { - "allow-plugins": { - "phpstan/extension-installer": true - } } } diff --git a/vendor/sabre/uri/lib/Version.php b/vendor/sabre/uri/lib/Version.php index a30694f2c..e4f289e90 100644 --- a/vendor/sabre/uri/lib/Version.php +++ b/vendor/sabre/uri/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - public const VERSION = '2.3.3'; + public const VERSION = '2.3.2'; } diff --git a/vendor/sabre/uri/lib/functions.php b/vendor/sabre/uri/lib/functions.php index 01ef92d7e..64e64027f 100644 --- a/vendor/sabre/uri/lib/functions.php +++ b/vendor/sabre/uri/lib/functions.php @@ -26,15 +26,15 @@ function resolve(string $basePath, string $newPath): string // If the new path defines a scheme, it's absolute and we can just return // that. - if (null !== $delta['scheme']) { + if ($delta['scheme']) { return build($delta); } $base = parse($basePath); $pick = function ($part) use ($base, $delta) { - if (null !== $delta[$part]) { + if ($delta[$part]) { return $delta[$part]; - } elseif (null !== $base[$part]) { + } elseif ($base[$part]) { return $base[$part]; } @@ -47,6 +47,7 @@ function resolve(string $basePath, string $newPath): string $newParts['host'] = $pick('host'); $newParts['port'] = $pick('port'); + $path = ''; if (is_string($delta['path']) and strlen($delta['path']) > 0) { // If the path starts with a slash if ('/' === $delta['path'][0]) { @@ -61,10 +62,7 @@ function resolve(string $basePath, string $newPath): string $path .= '/'.$delta['path']; } } else { - $path = $base['path'] ?? '/'; - if ('' === $path) { - $path = '/'; - } + $path = $base['path'] ?: '/'; } // Removing .. and . $pathParts = explode('/', $path); @@ -87,17 +85,13 @@ function resolve(string $basePath, string $newPath): string // If the source url ended with a /, we want to preserve that. $newParts['path'] = 0 === strpos($path, '/') ? $path : '/'.$path; - // From PHP 8, no "?" query at all causes 'query' to be null. - // An empty query "http://example.com/foo?" causes 'query' to be the empty string - if (null !== $delta['query'] && '' !== $delta['query']) { + if ($delta['query']) { $newParts['query'] = $delta['query']; - } elseif (isset($base['query']) && null === $delta['host'] && null === $delta['path']) { + } elseif (!empty($base['query']) && empty($delta['host']) && empty($delta['path'])) { // Keep the old query if host and path didn't change $newParts['query'] = $base['query']; } - // From PHP 8, no "#" fragment at all causes 'fragment' to be null. - // An empty fragment "http://example.com/foo#" causes 'fragment' to be the empty string - if (null !== $delta['fragment'] && '' !== $delta['fragment']) { + if ($delta['fragment']) { $newParts['fragment'] = $delta['fragment']; } @@ -119,7 +113,7 @@ function normalize(string $uri): string { $parts = parse($uri); - if (null !== $parts['path']) { + if (!empty($parts['path'])) { $pathParts = explode('/', ltrim($parts['path'], '/')); $newPathParts = []; foreach ($pathParts as $pathPart) { @@ -140,14 +134,14 @@ function normalize(string $uri): string $parts['path'] = '/'.implode('/', $newPathParts); } - if (null !== $parts['scheme']) { + if ($parts['scheme']) { $parts['scheme'] = strtolower($parts['scheme']); $defaultPorts = [ 'http' => '80', 'https' => '443', ]; - if (null !== $parts['port'] && isset($defaultPorts[$parts['scheme']]) && $defaultPorts[$parts['scheme']] == $parts['port']) { + if (!empty($parts['port']) && isset($defaultPorts[$parts['scheme']]) && $defaultPorts[$parts['scheme']] == $parts['port']) { // Removing default ports. unset($parts['port']); } @@ -155,7 +149,7 @@ function normalize(string $uri): string switch ($parts['scheme']) { case 'http': case 'https': - if (null === $parts['path']) { + if (empty($parts['path'])) { // An empty path is equivalent to / in http. $parts['path'] = '/'; } @@ -163,7 +157,7 @@ function normalize(string $uri): string } } - if (null !== $parts['host']) { + if ($parts['host']) { $parts['host'] = strtolower($parts['host']); } @@ -207,7 +201,7 @@ function parse(string $uri): array } $result = parse_url($uri); - if (false === $result) { + if (!$result) { $result = _parse_fallback($uri); } @@ -244,32 +238,32 @@ function build(array $parts): string $uri = ''; $authority = ''; - if (isset($parts['host'])) { + if (!empty($parts['host'])) { $authority = $parts['host']; - if (isset($parts['user'])) { + if (!empty($parts['user'])) { $authority = $parts['user'].'@'.$authority; } - if (isset($parts['port'])) { + if (!empty($parts['port'])) { $authority = $authority.':'.$parts['port']; } } - if (isset($parts['scheme'])) { + if (!empty($parts['scheme'])) { // If there's a scheme, there's also a host. $uri = $parts['scheme'].':'; } - if ('' !== $authority || (isset($parts['scheme']) && 'file' === $parts['scheme'])) { + if ($authority || (!empty($parts['scheme']) && 'file' === $parts['scheme'])) { // No scheme, but there is a host. $uri .= '//'.$authority; } - if (isset($parts['path'])) { + if (!empty($parts['path'])) { $uri .= $parts['path']; } - if (isset($parts['query'])) { + if (!empty($parts['query'])) { $uri .= '?'.$parts['query']; } - if (isset($parts['fragment'])) { + if (!empty($parts['fragment'])) { $uri .= '#'.$parts['fragment']; } @@ -296,7 +290,7 @@ function build(array $parts): string function split(string $path): array { $matches = []; - if (1 === preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u', $path, $matches)) { + if (preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u', $path, $matches)) { return [$matches[1], $matches[2]]; } @@ -313,7 +307,7 @@ function split(string $path): array * This function is only called if the main parse method fails. It's pretty * crude and probably slow, so the original parse_url is usually preferred. * - * @return array{scheme: string|null, host: string|null, path: string|null, port: positive-int|null, user: string|null, query: string|null, fragment: string|null} + * @return array * * @throws InvalidUriException */ @@ -346,14 +340,10 @@ function _parse_fallback(string $uri): array 'query' => null, ]; - if (1 === preg_match('% ^([A-Za-z][A-Za-z0-9+-\.]+): %x', $uri, $matches)) { + if (preg_match('% ^([A-Za-z][A-Za-z0-9+-\.]+): %x', $uri, $matches)) { $result['scheme'] = $matches[1]; // Take what's left. $uri = substr($uri, strlen($result['scheme']) + 1); - if (false === $uri) { - // There was nothing left. - $uri = ''; - } } // Taking off a fragment part @@ -368,11 +358,7 @@ function _parse_fallback(string $uri): array if ('///' === substr($uri, 0, 3)) { // The triple slash uris are a bit unusual, but we have special handling // for them. - $path = substr($uri, 2); - if (false === $path) { - throw new \RuntimeException('The string cannot be false'); - } - $result['path'] = $path; + $result['path'] = substr($uri, 2); $result['host'] = ''; } elseif ('//' === substr($uri, 0, 2)) { // Uris that have an authority part. @@ -383,25 +369,22 @@ function _parse_fallback(string $uri): array (?: : (? [0-9]+))? (? / .*)? $%x'; - if (1 !== preg_match($regex, $uri, $matches)) { + if (!preg_match($regex, $uri, $matches)) { throw new InvalidUriException('Invalid, or could not parse URI'); } - if (isset($matches['host']) && '' !== $matches['host']) { + if ($matches['host']) { $result['host'] = $matches['host']; } if (isset($matches['port'])) { - $port = (int) $matches['port']; - if ($port > 0) { - $result['port'] = $port; - } + $result['port'] = (int) $matches['port']; } if (isset($matches['path'])) { $result['path'] = $matches['path']; } - if (isset($matches['user']) && '' !== $matches['user']) { + if ($matches['user']) { $result['user'] = $matches['user']; } - if (isset($matches['pass']) && '' !== $matches['pass']) { + if ($matches['pass']) { $result['pass'] = $matches['pass']; } } else { diff --git a/vendor/sabre/xml/lib/Deserializer/functions.php b/vendor/sabre/xml/lib/Deserializer/functions.php index 62d4d0e07..c4f240970 100644 --- a/vendor/sabre/xml/lib/Deserializer/functions.php +++ b/vendor/sabre/xml/lib/Deserializer/functions.php @@ -216,7 +216,7 @@ function valueObject(Reader $reader, string $className, string $namespace) $reader->next(); } } else { - if (Reader::END_ELEMENT !== $reader->nodeType && !$reader->read()) { + if (!$reader->read()) { break; } } diff --git a/vendor/sabre/xml/lib/Version.php b/vendor/sabre/xml/lib/Version.php index 6b6c53b18..1144bf085 100644 --- a/vendor/sabre/xml/lib/Version.php +++ b/vendor/sabre/xml/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '2.2.6'; + const VERSION = '2.2.5'; } -- cgit v1.2.3