From 88d7302571e071524da88e5b5a524e6e7b69ea1c Mon Sep 17 00:00:00 2001 From: Artur Kyryliuk Date: Tue, 6 Oct 2026 23:48:28 +0200 Subject: [PATCH] fix(vendor): autoloader for Feed class --- core/composer.lock | 556 +-- core/vendor/composer/autoload_classmap.php | 94 +- core/vendor/composer/autoload_namespaces.php | 1 - core/vendor/composer/autoload_psr4.php | 1 - core/vendor/composer/autoload_static.php | 110 +- .../composer/class-map-generator/README.md | 5 + .../class-map-generator/src/ClassMap.php | 167 +- .../src/ClassMapGenerator.php | 2 +- core/vendor/composer/installed.json | 616 ++- core/vendor/composer/installed.php | 268 +- core/vendor/composer/semver/CHANGELOG.md | 18 + core/vendor/composer/semver/README.md | 32 +- core/vendor/composer/semver/composer.json | 2 +- .../composer/semver/src/CompilingMatcher.php | 26 +- core/vendor/composer/semver/src/Intervals.php | 34 +- .../composer/semver/src/VersionParser.php | 18 +- core/vendor/dg/rss-php/composer.json | 35 + core/vendor/dg/rss-php/example-atom.php | 26 + core/vendor/dg/rss-php/example-rss.php | 27 + core/vendor/dg/rss-php/license.md | 27 + core/vendor/dg/rss-php/readme.md | 73 + core/vendor/dg/rss-php/src/Feed.php | 232 ++ core/vendor/doctrine/dbal/composer.json | 6 +- .../doctrine/dbal/src/Cache/ArrayResult.php | 2 +- core/vendor/doctrine/dbal/src/Connection.php | 1 - .../EasyConnectString.php | 19 + .../dbal/src/Driver/Mysqli/Connection.php | 23 +- .../dbal/src/Driver/Mysqli/Driver.php | 32 +- .../Mysqli/Exception/ConnectionFailed.php | 11 - .../Mysqli/Exception/InvalidCharset.php | 10 - .../Mysqli/Exception/StatementError.php | 6 - .../src/Driver/Mysqli/Initializer/Charset.php | 6 +- .../src/Driver/Mysqli/Initializer/Options.php | 2 + .../dbal/src/Driver/Mysqli/Result.php | 131 +- .../dbal/src/Driver/Mysqli/Statement.php | 16 +- .../dbal/src/Driver/OCI8/Connection.php | 15 +- .../dbal/src/Driver/PgSQL/Connection.php | 1 - .../dbal/src/Driver/PgSQL/Statement.php | 12 +- .../dbal/src/Driver/SQLite3/Connection.php | 18 +- .../doctrine/dbal/src/DriverManager.php | 37 +- .../Exception/InvalidColumnDeclaration.php | 8 + .../src/Platforms/AbstractMySQLPlatform.php | 10 +- .../dbal/src/Platforms/AbstractPlatform.php | 89 +- .../dbal/src/Platforms/DB2Platform.php | 24 +- .../src/Platforms/Db2/Db2MetadataProvider.php | 69 +- .../dbal/src/Platforms/MariaDBPlatform.php | 5 +- .../dbal/src/Platforms/MySQL/Comparator.php | 8 +- .../Platforms/MySQL/MySQLMetadataProvider.php | 79 + .../dbal/src/Platforms/MySQLPlatform.php | 6 +- .../Oracle/OracleMetadataProvider.php | 66 + .../dbal/src/Platforms/OraclePlatform.php | 44 +- .../src/Platforms/PostgreSQL/Comparator.php | 44 + .../PostgreSQL/PostgreSQLMetadataProvider.php | 83 + .../dbal/src/Platforms/PostgreSQLPlatform.php | 51 +- .../SQLServer/SQLServerMetadataProvider.php | 75 + .../dbal/src/Platforms/SQLServerPlatform.php | 46 +- .../SQLite/SQLiteMetadataProvider.php | 113 +- .../dbal/src/Platforms/SQLitePlatform.php | 87 +- core/vendor/doctrine/dbal/src/Query/Join.php | 5 + .../doctrine/dbal/src/Query/QueryBuilder.php | 26 + core/vendor/doctrine/dbal/src/SQL/Parser.php | 3 - .../dbal/src/SQL/Parser/Exception.php | 5 + .../dbal/src/Schema/AbstractAsset.php | 18 +- .../dbal/src/Schema/AbstractNamedObject.php | 2 + .../Schema/AbstractOptionallyNamedObject.php | 2 + .../dbal/src/Schema/AbstractSchemaManager.php | 113 +- .../doctrine/dbal/src/Schema/Column.php | 295 +- .../doctrine/dbal/src/Schema/ColumnDiff.php | 2 +- .../doctrine/dbal/src/Schema/ColumnEditor.php | 25 +- .../dbal/src/Schema/DB2SchemaManager.php | 3 +- .../Exception/ImproperlyQualifiedName.php | 25 + .../Exception/InvalidSchemaModification.php | 54 + .../Exception/InvalidTableModification.php | 58 - .../dbal/src/Schema/ForeignKeyConstraint.php | 8 +- .../src/Schema/ForeignKeyConstraintEditor.php | 24 + .../vendor/doctrine/dbal/src/Schema/Index.php | 32 +- .../doctrine/dbal/src/Schema/IndexEditor.php | 70 +- .../doctrine/dbal/src/Schema/IndexRename.php | 28 + .../IntrospectingSchemaProvider.php | 166 +- ...gnKeyConstraintColumnMetadataProcessor.php | 8 +- .../IndexColumnMetadataProcessor.php | 8 +- ...ryKeyConstraintColumnMetadataProcessor.php | 5 +- ...niqueConstraintColumnMetadataProcessor.php | 34 + .../src/Schema/Metadata/MetadataProvider.php | 3 + .../UniqueConstraintColumnMetadataRow.php | 74 + .../dbal/src/Schema/MySQLSchemaManager.php | 4 +- core/vendor/doctrine/dbal/src/Schema/Name.php | 4 +- .../doctrine/dbal/src/Schema/Name/Parsers.php | 13 + .../dbal/src/Schema/OracleSchemaManager.php | 2 +- .../src/Schema/PostgreSQLSchemaManager.php | 15 +- .../src/Schema/PrimaryKeyConstraintEditor.php | 12 + .../src/Schema/SQLServerSchemaManager.php | 3 +- .../dbal/src/Schema/SQLiteSchemaManager.php | 23 +- .../doctrine/dbal/src/Schema/Schema.php | 71 +- .../doctrine/dbal/src/Schema/SchemaEditor.php | 311 ++ .../dbal/src/Schema/SchemaProvider.php | 17 + .../vendor/doctrine/dbal/src/Schema/Table.php | 220 +- .../doctrine/dbal/src/Schema/TableDiff.php | 44 +- .../doctrine/dbal/src/Schema/TableEditor.php | 78 +- .../dbal/src/Schema/UniqueConstraint.php | 4 +- .../src/Schema/UniqueConstraintEditor.php | 19 + .../src/Types/DateTimeUtcImmutableType.php | 97 + .../dbal/src/Types/DateTimeUtcType.php | 97 + .../doctrine/dbal/src/Types/FloatType.php | 2 +- .../dbal/src/Types/PhpFloatMappingType.php | 14 + .../dbal/src/Types/SimpleArrayType.php | 2 + .../dbal/src/Types/SmallFloatType.php | 2 +- core/vendor/doctrine/dbal/src/Types/Type.php | 60 +- core/vendor/doctrine/dbal/src/Types/Types.php | 63 +- .../doctrine/lexer/src/AbstractLexer.php | 23 +- .../database/Connectors/PostgresConnector.php | 26 +- .../filesystem/FilesystemManager.php | 23 +- .../filesystem/LocalFilesystemAdapter.php | 4 +- core/vendor/illuminate/queue/Worker.php | 31 +- core/vendor/illuminate/routing/Route.php | 14 +- .../illuminate/routing/RouteUrlGenerator.php | 20 +- core/vendor/illuminate/support/Str.php | 10 +- .../illuminate/translation/FileLoader.php | 22 + .../illuminate/translation/Translator.php | 2 +- .../justinrainbow/json-schema/CHANGELOG.md | 21 + .../justinrainbow/json-schema/README.md | 3 +- .../json-schema/bin/run-test-case | 2 +- .../src/JsonSchema/ConstraintError.php | 4 + .../Drafts/Draft06/FormatConstraint.php | 18 +- .../Drafts/Draft07/FormatConstraint.php | 106 +- .../Drafts/Draft2019/FormatConstraint.php | 152 +- .../JsonSchema/Constraints/TypeConstraint.php | 4 +- .../json-schema/src/JsonSchema/Rfc3339.php | 2 +- .../src/JsonSchema/SchemaStorage.php | 97 +- .../Validator/RelativeReferenceValidator.php | 4 + .../src/JsonSchema/Uri/UriResolver.php | 5 + core/vendor/laravel/prompts/src/Prompt.php | 12 + core/vendor/laravel/prompts/src/Spinner.php | 1 + core/vendor/laravel/prompts/src/Task.php | 1 + .../src/Serializers/Native.php | 36 +- .../src/Support/SelfReference.php | 4 +- core/vendor/monolog/monolog/CHANGELOG.md | 7 + core/vendor/monolog/monolog/README.md | 2 +- .../Monolog/Formatter/RedactingFormatter.php | 11 +- .../Monolog/Handler/RotatingFileHandler.php | 2 +- .../src/Monolog/Handler/SocketHandler.php | 1 + .../monolog/monolog/src/Monolog/Logger.php | 14 +- core/vendor/nesbot/carbon/composer.json | 6 +- core/vendor/nesbot/carbon/phpmd.yml | 46 + core/vendor/nesbot/carbon/readme.md | 44 +- .../carbon/src/Carbon/CarbonInterval.php | 9 +- .../nesbot/carbon/src/Carbon/CarbonPeriod.php | 26 +- .../nesbot/carbon/src/Carbon/Lang/es_PH.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/fo_DK.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/fur_IT.php | 7 +- .../nesbot/carbon/src/Carbon/Lang/hr_BA.php | 3 +- .../nesbot/carbon/src/Carbon/Lang/ms_BN.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/ms_SG.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/ne_IN.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/nnh.php | 6 +- .../nesbot/carbon/src/Carbon/Lang/pa_Guru.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/ps.php | 3 +- .../nesbot/carbon/src/Carbon/Lang/seh.php | 6 +- .../carbon/src/Carbon/Lang/sr_Cyrl_BA.php | 2 +- .../carbon/src/Carbon/Lang/sr_Latn_BA.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/ta_MY.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/ta_SG.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/th.php | 2 + .../nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php | 2 +- .../nesbot/carbon/src/Carbon/Traits/Date.php | 17 +- .../carbon/src/Carbon/Traits/Localization.php | 10 +- .../carbon/src/Carbon/Traits/Rounding.php | 32 + .../carbon/src/Carbon/Traits/Timestamp.php | 3 +- .../nesbot/carbon/src/Carbon/Traits/Units.php | 21 +- .../resources/svg/airpods-l.svg | 16 + .../resources/svg/airpods-r.svg | 16 + .../resources/svg/alphabet-chinese.svg | 16 + .../resources/svg/alphabet-devanagari.svg | 18 + .../resources/svg/alphabet-ethiopic.svg | 15 + .../resources/svg/alphabet-georgian.svg | 17 + .../resources/svg/alphabet-japanese.svg | 17 + .../resources/svg/blob-dashed.svg | 25 + .../resources/svg/brand-instagram.svg | 6 +- .../resources/svg/cash-coin.svg | 19 + .../resources/svg/circle-heart.svg | 16 + .../resources/svg/circle-pause.svg | 17 + .../resources/svg/circle-play.svg | 16 + .../resources/svg/circle-stop.svg | 16 + .../resources/svg/duplicate.svg | 18 + .../resources/svg/edit-bulk.svg | 19 + .../resources/svg/file-lock.svg | 18 + .../resources/svg/folder-ai.svg | 18 + .../resources/svg/folder-lock.svg | 17 + .../resources/svg/folder-sparkle.svg | 16 + .../resources/svg/folder-stats.svg | 17 + .../resources/svg/folder-user.svg | 17 + .../resources/svg/git-branch-check.svg | 20 + .../resources/svg/git-branch-x.svg | 21 + .../resources/svg/git-merge-queue.svg | 19 + .../resources/svg/git-pull-request-locked.svg | 21 + .../svg/git-pull-request-unlisted.svg | 20 + .../resources/svg/gpu-2.svg | 24 + .../blade-tabler-icons/resources/svg/gpu.svg | 20 + .../resources/svg/lens-concave.svg | 15 + .../resources/svg/lens-convex.svg | 15 + .../resources/svg/map-pinned.svg | 17 + .../resources/svg/memory.svg | 24 + .../resources/svg/message-2-ai.svg | 20 + .../resources/svg/message-2-sparkle.svg | 18 + .../resources/svg/message-ai.svg | 20 + .../resources/svg/message-sparkle.svg | 18 + .../resources/svg/model-ai.svg | 21 + .../resources/svg/orbit-vertical.svg | 16 + .../resources/svg/orbit.svg | 16 + .../resources/svg/orbits.svg | 17 + .../resources/svg/pencil-ai.svg | 19 + .../resources/svg/reduce-motion.svg | 27 + .../resources/svg/reference-image.svg | 24 + .../resources/svg/secret-phrases.svg | 21 + .../resources/svg/square-dashed-top-solid.svg | 23 + .../resources/svg/square-dashed-x.svg | 25 + .../resources/svg/square-dashed.svg | 13 +- .../resources/svg/stack-check.svg | 18 + .../resources/svg/stack-minus.svg | 18 + .../resources/svg/stack-plus.svg | 19 + .../resources/svg/stack-x.svg | 19 + .../resources/svg/sticker-smile.svg | 19 + .../resources/svg/table-dashed.svg | 21 +- .../resources/svg/triangle-dashed.svg | 23 + .../resources/svg/voice-2.svg | 17 + .../resources/svg/voice.svg | 17 + core/vendor/seld/phar-utils/src/Linter.php | 2 + .../vendor/seld/phar-utils/src/Timestamps.php | 9 + core/vendor/simplepie/simplepie/CHANGELOG.md | 356 -- .../simplepie/LICENSES/BSD-3-Clause.txt | 11 - .../simplepie/simplepie/LICENSES/MIT.txt | 17 - .../simplepie/simplepie/README.markdown | 153 - .../vendor/simplepie/simplepie/autoloader.php | 86 - core/vendor/simplepie/simplepie/composer.json | 75 - core/vendor/simplepie/simplepie/db.sql | 40 - .../simplepie/simplepie/library/SimplePie.php | 450 --- .../simplepie/library/SimplePie/Author.php | 20 - .../simplepie/library/SimplePie/Cache.php | 20 - .../library/SimplePie/Cache/Base.php | 20 - .../simplepie/library/SimplePie/Cache/DB.php | 20 - .../library/SimplePie/Cache/File.php | 20 - .../library/SimplePie/Cache/Memcache.php | 20 - .../library/SimplePie/Cache/Memcached.php | 20 - .../library/SimplePie/Cache/MySQL.php | 20 - .../library/SimplePie/Cache/Redis.php | 20 - .../simplepie/library/SimplePie/Caption.php | 20 - .../simplepie/library/SimplePie/Category.php | 20 - .../SimplePie/Content/Type/Sniffer.php | 20 - .../simplepie/library/SimplePie/Copyright.php | 20 - .../simplepie/library/SimplePie/Core.php | 17 - .../simplepie/library/SimplePie/Credit.php | 20 - .../SimplePie/Decode/HTML/Entities.php | 566 --- .../simplepie/library/SimplePie/Enclosure.php | 20 - .../simplepie/library/SimplePie/Exception.php | 20 - .../simplepie/library/SimplePie/File.php | 20 - .../library/SimplePie/HTTP/Parser.php | 24 - .../simplepie/library/SimplePie/IRI.php | 20 - .../simplepie/library/SimplePie/Item.php | 20 - .../simplepie/library/SimplePie/Locator.php | 20 - .../simplepie/library/SimplePie/Misc.php | 20 - .../simplepie/library/SimplePie/Net/IPv6.php | 20 - .../library/SimplePie/Parse/Date.php | 20 - .../simplepie/library/SimplePie/Parser.php | 20 - .../simplepie/library/SimplePie/Rating.php | 20 - .../simplepie/library/SimplePie/Registry.php | 20 - .../library/SimplePie/Restriction.php | 20 - .../simplepie/library/SimplePie/Sanitize.php | 20 - .../simplepie/library/SimplePie/Source.php | 20 - .../SimplePie/XML/Declaration/Parser.php | 20 - .../simplepie/library/SimplePie/gzdecode.php | 20 - .../simplepie/simplepie/phpstan.dist.neon | 65 - .../vendor/simplepie/simplepie/src/Author.php | 110 - core/vendor/simplepie/simplepie/src/Cache.php | 114 - .../simplepie/simplepie/src/Cache/Base.php | 80 - .../simplepie/src/Cache/BaseDataCache.php | 119 - .../src/Cache/CallableNameFilter.php | 53 - .../simplepie/simplepie/src/Cache/DB.php | 84 - .../simplepie/src/Cache/DataCache.php | 80 - .../simplepie/simplepie/src/Cache/File.php | 127 - .../simplepie/src/Cache/Memcache.php | 145 - .../simplepie/src/Cache/Memcached.php | 142 - .../simplepie/simplepie/src/Cache/MySQL.php | 344 -- .../simplepie/src/Cache/NameFilter.php | 37 - .../simplepie/simplepie/src/Cache/Psr16.php | 108 - .../simplepie/simplepie/src/Cache/Redis.php | 171 - .../simplepie/simplepie/src/Caption.php | 162 - .../simplepie/simplepie/src/Category.php | 126 - .../simplepie/src/Content/Type/Sniffer.php | 243 -- .../simplepie/simplepie/src/Copyright.php | 89 - .../vendor/simplepie/simplepie/src/Credit.php | 113 - .../simplepie/simplepie/src/Enclosure.php | 1217 ------ .../simplepie/simplepie/src/Exception.php | 19 - core/vendor/simplepie/simplepie/src/File.php | 444 --- .../simplepie/simplepie/src/Gzdecode.php | 310 -- .../simplepie/simplepie/src/HTTP/Client.php | 28 - .../simplepie/src/HTTP/ClientException.php | 19 - .../simplepie/src/HTTP/FileClient.php | 77 - .../simplepie/simplepie/src/HTTP/Parser.php | 523 --- .../simplepie/src/HTTP/Psr18Client.php | 162 - .../simplepie/src/HTTP/Psr7Response.php | 91 - .../simplepie/src/HTTP/RawTextResponse.php | 98 - .../simplepie/simplepie/src/HTTP/Response.php | 171 - core/vendor/simplepie/simplepie/src/IRI.php | 1087 ------ core/vendor/simplepie/simplepie/src/Item.php | 2366 ----------- .../simplepie/simplepie/src/Locator.php | 478 --- core/vendor/simplepie/simplepie/src/Misc.php | 2233 ----------- .../simplepie/simplepie/src/Net/IPv6.php | 224 -- .../simplepie/simplepie/src/Parse/Date.php | 965 ----- .../vendor/simplepie/simplepie/src/Parser.php | 675 ---- .../vendor/simplepie/simplepie/src/Rating.php | 89 - .../simplepie/simplepie/src/Registry.php | 258 -- .../simplepie/simplepie/src/RegistryAware.php | 23 - .../simplepie/simplepie/src/Restriction.php | 115 - .../simplepie/simplepie/src/Sanitize.php | 831 ---- .../simplepie/simplepie/src/SimplePie.php | 3465 ----------------- .../vendor/simplepie/simplepie/src/Source.php | 512 --- .../simplepie/src/XML/Declaration/Parser.php | 308 -- .../simplepie/utils/PHPStan/README.md | 7 - .../RegistryCallMethodReturnTypeExtension.php | 101 - .../simplepie/utils/PHPStan/extension.neon | 6 - .../console/Formatter/OutputFormatter.php | 21 +- .../error-handler/Error/FatalError.php | 3 + .../symfony/error-handler/ErrorHandler.php | 8 +- core/vendor/symfony/finder/Glob.php | 5 +- .../Iterator/VcsIgnoredFilterIterator.php | 2 +- .../symfony/http-foundation/Request.php | 14 +- .../Handler/AbstractSessionHandler.php | 10 + .../Handler/MarshallingSessionHandler.php | 10 + .../Handler/MigratingSessionHandler.php | 10 + .../DataCollector/EventDataCollector.php | 5 +- .../EventListener/ErrorListener.php | 8 +- .../vendor/symfony/http-kernel/HttpKernel.php | 4 +- core/vendor/symfony/http-kernel/Kernel.php | 6 +- .../polyfill-intl-grapheme/Grapheme.php | 156 +- .../polyfill-intl-grapheme/bootstrap.php | 2 +- .../polyfill-intl-grapheme/bootstrap80.php | 2 +- core/vendor/symfony/polyfill-intl-idn/Idn.php | 18 +- .../Resources/unidata/DisallowedRanges.php | 76 +- .../Resources/unidata/Regex.php | 20 +- .../Resources/unidata/disallowed.php | 415 +- .../unidata/disallowed_STD3_valid.php | 3 - .../Resources/unidata/ignored.php | 1 + .../Resources/unidata/mapped.php | 163 +- .../Resources/unidata/virama.php | 4 + .../polyfill-intl-normalizer/Normalizer.php | 48 +- .../symfony/polyfill-mbstring/Mbstring.php | 756 +++- core/vendor/symfony/polyfill-php84/Php84.php | 123 +- .../symfony/polyfill-php84/bootstrap.php | 2 +- core/vendor/symfony/polyfill-php85/Php85.php | 91 +- .../symfony/polyfill-php85/bootstrap.php | 2 +- .../symfony/polyfill-php85/bootstrap80.php | 2 +- .../Dumper/CompiledUrlGeneratorDumper.php | 4 +- 352 files changed, 7680 insertions(+), 24054 deletions(-) create mode 100644 core/vendor/dg/rss-php/composer.json create mode 100644 core/vendor/dg/rss-php/example-atom.php create mode 100644 core/vendor/dg/rss-php/example-rss.php create mode 100644 core/vendor/dg/rss-php/license.md create mode 100644 core/vendor/dg/rss-php/readme.md create mode 100644 core/vendor/dg/rss-php/src/Feed.php create mode 100644 core/vendor/doctrine/dbal/src/Platforms/PostgreSQL/Comparator.php create mode 100644 core/vendor/doctrine/dbal/src/Schema/Exception/ImproperlyQualifiedName.php create mode 100644 core/vendor/doctrine/dbal/src/Schema/Exception/InvalidSchemaModification.php create mode 100644 core/vendor/doctrine/dbal/src/Schema/IndexRename.php create mode 100644 core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/UniqueConstraintColumnMetadataProcessor.php create mode 100644 core/vendor/doctrine/dbal/src/Schema/Metadata/UniqueConstraintColumnMetadataRow.php create mode 100644 core/vendor/doctrine/dbal/src/Schema/SchemaEditor.php create mode 100644 core/vendor/doctrine/dbal/src/Types/DateTimeUtcImmutableType.php create mode 100644 core/vendor/doctrine/dbal/src/Types/DateTimeUtcType.php create mode 100644 core/vendor/doctrine/dbal/src/Types/PhpFloatMappingType.php create mode 100644 core/vendor/nesbot/carbon/phpmd.yml create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/airpods-l.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/airpods-r.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-chinese.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-devanagari.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-ethiopic.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-georgian.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-japanese.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/blob-dashed.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/cash-coin.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-heart.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-pause.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-play.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-stop.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/duplicate.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/edit-bulk.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/file-lock.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-ai.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-lock.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-sparkle.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-stats.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-user.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-branch-check.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-branch-x.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-merge-queue.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-pull-request-locked.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-pull-request-unlisted.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/gpu-2.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/gpu.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/lens-concave.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/lens-convex.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/map-pinned.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/memory.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-2-ai.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-2-sparkle.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-ai.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-sparkle.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/model-ai.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbit-vertical.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbit.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbits.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/pencil-ai.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/reduce-motion.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/reference-image.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/secret-phrases.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed-top-solid.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed-x.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-check.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-minus.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-plus.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-x.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/sticker-smile.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/triangle-dashed.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/voice-2.svg create mode 100644 core/vendor/secondnetwork/blade-tabler-icons/resources/svg/voice.svg delete mode 100644 core/vendor/simplepie/simplepie/CHANGELOG.md delete mode 100644 core/vendor/simplepie/simplepie/LICENSES/BSD-3-Clause.txt delete mode 100644 core/vendor/simplepie/simplepie/LICENSES/MIT.txt delete mode 100644 core/vendor/simplepie/simplepie/README.markdown delete mode 100644 core/vendor/simplepie/simplepie/autoloader.php delete mode 100644 core/vendor/simplepie/simplepie/composer.json delete mode 100644 core/vendor/simplepie/simplepie/db.sql delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Author.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Cache.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Cache/Base.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Cache/DB.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Cache/File.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcache.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcached.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Cache/MySQL.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Cache/Redis.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Caption.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Category.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Content/Type/Sniffer.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Copyright.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Core.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Credit.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Decode/HTML/Entities.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Enclosure.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Exception.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/File.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/HTTP/Parser.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/IRI.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Item.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Locator.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Misc.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Net/IPv6.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Parse/Date.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Parser.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Rating.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Registry.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Restriction.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Sanitize.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/Source.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/XML/Declaration/Parser.php delete mode 100644 core/vendor/simplepie/simplepie/library/SimplePie/gzdecode.php delete mode 100644 core/vendor/simplepie/simplepie/phpstan.dist.neon delete mode 100644 core/vendor/simplepie/simplepie/src/Author.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/Base.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/BaseDataCache.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/CallableNameFilter.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/DB.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/DataCache.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/File.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/Memcache.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/Memcached.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/MySQL.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/NameFilter.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/Psr16.php delete mode 100644 core/vendor/simplepie/simplepie/src/Cache/Redis.php delete mode 100644 core/vendor/simplepie/simplepie/src/Caption.php delete mode 100644 core/vendor/simplepie/simplepie/src/Category.php delete mode 100644 core/vendor/simplepie/simplepie/src/Content/Type/Sniffer.php delete mode 100644 core/vendor/simplepie/simplepie/src/Copyright.php delete mode 100644 core/vendor/simplepie/simplepie/src/Credit.php delete mode 100644 core/vendor/simplepie/simplepie/src/Enclosure.php delete mode 100644 core/vendor/simplepie/simplepie/src/Exception.php delete mode 100644 core/vendor/simplepie/simplepie/src/File.php delete mode 100644 core/vendor/simplepie/simplepie/src/Gzdecode.php delete mode 100644 core/vendor/simplepie/simplepie/src/HTTP/Client.php delete mode 100644 core/vendor/simplepie/simplepie/src/HTTP/ClientException.php delete mode 100644 core/vendor/simplepie/simplepie/src/HTTP/FileClient.php delete mode 100644 core/vendor/simplepie/simplepie/src/HTTP/Parser.php delete mode 100644 core/vendor/simplepie/simplepie/src/HTTP/Psr18Client.php delete mode 100644 core/vendor/simplepie/simplepie/src/HTTP/Psr7Response.php delete mode 100644 core/vendor/simplepie/simplepie/src/HTTP/RawTextResponse.php delete mode 100644 core/vendor/simplepie/simplepie/src/HTTP/Response.php delete mode 100644 core/vendor/simplepie/simplepie/src/IRI.php delete mode 100644 core/vendor/simplepie/simplepie/src/Item.php delete mode 100644 core/vendor/simplepie/simplepie/src/Locator.php delete mode 100644 core/vendor/simplepie/simplepie/src/Misc.php delete mode 100644 core/vendor/simplepie/simplepie/src/Net/IPv6.php delete mode 100644 core/vendor/simplepie/simplepie/src/Parse/Date.php delete mode 100644 core/vendor/simplepie/simplepie/src/Parser.php delete mode 100644 core/vendor/simplepie/simplepie/src/Rating.php delete mode 100644 core/vendor/simplepie/simplepie/src/Registry.php delete mode 100644 core/vendor/simplepie/simplepie/src/RegistryAware.php delete mode 100644 core/vendor/simplepie/simplepie/src/Restriction.php delete mode 100644 core/vendor/simplepie/simplepie/src/Sanitize.php delete mode 100644 core/vendor/simplepie/simplepie/src/SimplePie.php delete mode 100644 core/vendor/simplepie/simplepie/src/Source.php delete mode 100644 core/vendor/simplepie/simplepie/src/XML/Declaration/Parser.php delete mode 100644 core/vendor/simplepie/simplepie/utils/PHPStan/README.md delete mode 100644 core/vendor/simplepie/simplepie/utils/PHPStan/RegistryCallMethodReturnTypeExtension.php delete mode 100644 core/vendor/simplepie/simplepie/utils/PHPStan/extension.neon diff --git a/core/composer.lock b/core/composer.lock index 3b53792369..96e7e5f7f6 100644 --- a/core/composer.lock +++ b/core/composer.lock @@ -295,16 +295,16 @@ }, { "name": "composer/class-map-generator", - "version": "1.7.3", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "86d8208fc3c649a3a999daf1a63c25201be2990f" + "reference": "c0efbeb2f3fd7e23c7f180a59765c0b48a31fbc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/86d8208fc3c649a3a999daf1a63c25201be2990f", - "reference": "86d8208fc3c649a3a999daf1a63c25201be2990f", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/c0efbeb2f3fd7e23c7f180a59765c0b48a31fbc4", + "reference": "c0efbeb2f3fd7e23c7f180a59765c0b48a31fbc4", "shasum": "" }, "require": { @@ -348,7 +348,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.7.3" + "source": "https://github.com/composer/class-map-generator/tree/1.8.0" }, "funding": [ { @@ -360,7 +360,7 @@ "type": "github" } ], - "time": "2026-05-05T09:17:07+00:00" + "time": "2026-09-25T15:24:19+00:00" }, { "name": "composer/composer", @@ -620,16 +620,16 @@ }, { "name": "composer/semver", - "version": "3.4.4", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" + "reference": "528948210cc46f967a4b98e83b19e76f2b504993" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", - "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "url": "https://api.github.com/repos/composer/semver/zipball/528948210cc46f967a4b98e83b19e76f2b504993", + "reference": "528948210cc46f967a4b98e83b19e76f2b504993", "shasum": "" }, "require": { @@ -671,7 +671,7 @@ "homepage": "http://robbast.nl" } ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", + "description": "Version comparison library that offers utilities, version constraint parsing and validation.", "keywords": [ "semantic", "semver", @@ -681,7 +681,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.4" + "source": "https://github.com/composer/semver/tree/3.5.1" }, "funding": [ { @@ -693,7 +693,7 @@ "type": "github" } ], - "time": "2025-08-20T19:15:30+00:00" + "time": "2026-10-05T13:12:12+00:00" }, { "name": "composer/spdx-licenses", @@ -927,16 +927,16 @@ }, { "name": "doctrine/dbal", - "version": "4.4.4", + "version": "4.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "fb9e0ffe15e1590e24dc61c0c0a23f9a33ee42ce" + "reference": "c435cd7ea33e17d2a89288caf994cf3d4549b879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/fb9e0ffe15e1590e24dc61c0c0a23f9a33ee42ce", - "reference": "fb9e0ffe15e1590e24dc61c0c0a23f9a33ee42ce", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/c435cd7ea33e17d2a89288caf994cf3d4549b879", + "reference": "c435cd7ea33e17d2a89288caf994cf3d4549b879", "shasum": "" }, "require": { @@ -952,9 +952,9 @@ "phpstan/phpstan": "2.1.30", "phpstan/phpstan-phpunit": "2.0.7", "phpstan/phpstan-strict-rules": "^2", - "phpunit/phpunit": "11.5.50", - "slevomat/coding-standard": "8.27.1", - "squizlabs/php_codesniffer": "4.0.1", + "phpunit/phpunit": "11.5.56", + "slevomat/coding-standard": "8.31.1", + "squizlabs/php_codesniffer": "4.0.4", "symfony/cache": "^6.3.8|^7.0|^8.0", "symfony/console": "^5.4|^6.3|^7.0|^8.0" }, @@ -1013,7 +1013,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/4.4.4" + "source": "https://github.com/doctrine/dbal/tree/4.5.0" }, "funding": [ { @@ -1029,7 +1029,7 @@ "type": "tidelift" } ], - "time": "2026-07-21T14:34:40+00:00" + "time": "2026-09-24T16:11:26+00:00" }, { "name": "doctrine/deprecations", @@ -1171,16 +1171,16 @@ }, { "name": "doctrine/lexer", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e96fe45e92a54233726014a7cc7340abf29bb14c" + "reference": "71d305eaa6480d3d3460c7d053d1da7749fa9cca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e96fe45e92a54233726014a7cc7340abf29bb14c", - "reference": "e96fe45e92a54233726014a7cc7340abf29bb14c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/71d305eaa6480d3d3460c7d053d1da7749fa9cca", + "reference": "71d305eaa6480d3d3460c7d053d1da7749fa9cca", "shasum": "" }, "require": { @@ -1226,7 +1226,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.2" + "source": "https://github.com/doctrine/lexer/tree/3.0.3" }, "funding": [ { @@ -1242,7 +1242,7 @@ "type": "tidelift" } ], - "time": "2026-06-14T20:44:06+00:00" + "time": "2026-10-01T06:59:29+00:00" }, { "name": "dragonmantank/cron-expression", @@ -1999,7 +1999,7 @@ }, { "name": "illuminate/bus", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", @@ -2052,7 +2052,7 @@ }, { "name": "illuminate/cache", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", @@ -2114,7 +2114,7 @@ }, { "name": "illuminate/collections", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -2174,7 +2174,7 @@ }, { "name": "illuminate/conditionable", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -2220,7 +2220,7 @@ }, { "name": "illuminate/config", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", @@ -2268,7 +2268,7 @@ }, { "name": "illuminate/console", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", @@ -2334,7 +2334,7 @@ }, { "name": "illuminate/container", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -2396,7 +2396,7 @@ }, { "name": "illuminate/contracts", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -2444,16 +2444,16 @@ }, { "name": "illuminate/database", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc" + "reference": "81bc26c9d40e8e5de3b5268d1465166db1ae7209" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/499f5112164d5bc4b744e0ac259b44e0a4c8aacc", - "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc", + "url": "https://api.github.com/repos/illuminate/database/zipball/81bc26c9d40e8e5de3b5268d1465166db1ae7209", + "reference": "81bc26c9d40e8e5de3b5268d1465166db1ae7209", "shasum": "" }, "require": { @@ -2513,11 +2513,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-09-06T21:11:25+00:00" + "time": "2026-09-17T21:16:04+00:00" }, { "name": "illuminate/events", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", @@ -2572,16 +2572,16 @@ }, { "name": "illuminate/filesystem", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "dc0b7440f12753060b574fa8c20c2db259fa37c9" + "reference": "4e2bff4d2ac439db7a2903b8a99bc8dc5c8d5de4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/dc0b7440f12753060b574fa8c20c2db259fa37c9", - "reference": "dc0b7440f12753060b574fa8c20c2db259fa37c9", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/4e2bff4d2ac439db7a2903b8a99bc8dc5c8d5de4", + "reference": "4e2bff4d2ac439db7a2903b8a99bc8dc5c8d5de4", "shasum": "" }, "require": { @@ -2635,11 +2635,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-08-12T13:55:25+00:00" + "time": "2026-09-28T13:55:57+00:00" }, { "name": "illuminate/http", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", @@ -2701,7 +2701,7 @@ }, { "name": "illuminate/log", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/log.git", @@ -2754,7 +2754,7 @@ }, { "name": "illuminate/macroable", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -2800,7 +2800,7 @@ }, { "name": "illuminate/pagination", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", @@ -2850,7 +2850,7 @@ }, { "name": "illuminate/pipeline", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -2902,16 +2902,16 @@ }, { "name": "illuminate/queue", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/queue.git", - "reference": "64171cef7be5f3ac660484de502e48c566b6feca" + "reference": "6d6d4da3c6a1bb02f6ac16e64eb3a22bb58c1c32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/queue/zipball/64171cef7be5f3ac660484de502e48c566b6feca", - "reference": "64171cef7be5f3ac660484de502e48c566b6feca", + "url": "https://api.github.com/repos/illuminate/queue/zipball/6d6d4da3c6a1bb02f6ac16e64eb3a22bb58c1c32", + "reference": "6d6d4da3c6a1bb02f6ac16e64eb3a22bb58c1c32", "shasum": "" }, "require": { @@ -2965,11 +2965,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-07-11T15:13:30+00:00" + "time": "2026-09-17T18:39:21+00:00" }, { "name": "illuminate/redis", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/redis.git", @@ -3023,7 +3023,7 @@ }, { "name": "illuminate/reflection", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/reflection.git", @@ -3074,16 +3074,16 @@ }, { "name": "illuminate/routing", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/routing.git", - "reference": "5d3cc9beca82c359f16e6c1d072903087e428ca1" + "reference": "50642c4215a5b3fd11e8e18dc4469aa989847a16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/routing/zipball/5d3cc9beca82c359f16e6c1d072903087e428ca1", - "reference": "5d3cc9beca82c359f16e6c1d072903087e428ca1", + "url": "https://api.github.com/repos/illuminate/routing/zipball/50642c4215a5b3fd11e8e18dc4469aa989847a16", + "reference": "50642c4215a5b3fd11e8e18dc4469aa989847a16", "shasum": "" }, "require": { @@ -3136,11 +3136,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-08-05T14:58:10+00:00" + "time": "2026-09-28T20:31:58+00:00" }, { "name": "illuminate/session", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", @@ -3197,16 +3197,16 @@ }, { "name": "illuminate/support", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "7d7a7d2dc5084aa4b1fd8b0a42094e1d3fb51e00" + "reference": "0ae65f419c69a3bb5f8100b9c5286354742e7ef8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/7d7a7d2dc5084aa4b1fd8b0a42094e1d3fb51e00", - "reference": "7d7a7d2dc5084aa4b1fd8b0a42094e1d3fb51e00", + "url": "https://api.github.com/repos/illuminate/support/zipball/0ae65f419c69a3bb5f8100b9c5286354742e7ef8", + "reference": "0ae65f419c69a3bb5f8100b9c5286354742e7ef8", "shasum": "" }, "require": { @@ -3273,20 +3273,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-08-06T14:28:07+00:00" + "time": "2026-09-28T00:20:42+00:00" }, { "name": "illuminate/translation", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/translation.git", - "reference": "4b555f3ca37523d1064d08e99774ab32fd0cc228" + "reference": "431ac000adf17a024d6ef3a8131c3c1fa950459f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/translation/zipball/4b555f3ca37523d1064d08e99774ab32fd0cc228", - "reference": "4b555f3ca37523d1064d08e99774ab32fd0cc228", + "url": "https://api.github.com/repos/illuminate/translation/zipball/431ac000adf17a024d6ef3a8131c3c1fa950459f", + "reference": "431ac000adf17a024d6ef3a8131c3c1fa950459f", "shasum": "" }, "require": { @@ -3324,11 +3324,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-03-18T14:19:27+00:00" + "time": "2026-09-23T13:45:03+00:00" }, { "name": "illuminate/validation", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/validation.git", @@ -3391,7 +3391,7 @@ }, { "name": "illuminate/view", - "version": "v12.69.2", + "version": "v12.69.3", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", @@ -3502,16 +3502,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "6.13.0", + "version": "6.13.1", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "30de5e9b3fa04253af272a7d932a38cd026c311b" + "reference": "e54aacc4c0657b3a4af4f628428d2702146828c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/30de5e9b3fa04253af272a7d932a38cd026c311b", - "reference": "30de5e9b3fa04253af272a7d932a38cd026c311b", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/e54aacc4c0657b3a4af4f628428d2702146828c6", + "reference": "e54aacc4c0657b3a4af4f628428d2702146828c6", "shasum": "" }, "require": { @@ -3561,22 +3561,22 @@ ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/6.13.0" + "source": "https://github.com/jsonrainbow/json-schema/tree/6.13.1" }, - "time": "2026-09-23T19:46:42+00:00" + "time": "2026-09-30T07:42:28+00:00" }, { "name": "laravel/prompts", - "version": "v0.3.24", + "version": "v0.3.25", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b" + "reference": "21b7b49d60fcb700016dd27b582ae739c75de816" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/5d3cdef29e93ca3b62b1871359db3078cd99908b", - "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b", + "url": "https://api.github.com/repos/laravel/prompts/zipball/21b7b49d60fcb700016dd27b582ae739c75de816", + "reference": "21b7b49d60fcb700016dd27b582ae739c75de816", "shasum": "" }, "require": { @@ -3619,10 +3619,9 @@ ], "description": "Add beautiful and user-friendly forms to your command-line applications.", "support": { - "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.3.24" + "source": "https://github.com/laravel/prompts/tree/v0.3.25" }, - "time": "2026-08-20T12:55:36+00:00" + "time": "2026-10-06T02:25:49+00:00" }, { "name": "laravel/serializable-closure", @@ -3948,16 +3947,16 @@ }, { "name": "monolog/monolog", - "version": "3.12.0", + "version": "3.12.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "72c534fc0ab181ef52d92a68382318631e301608" + "reference": "d7059e4c691d05ea1222b5124bed0f961be46e15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/72c534fc0ab181ef52d92a68382318631e301608", - "reference": "72c534fc0ab181ef52d92a68382318631e301608", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/d7059e4c691d05ea1222b5124bed0f961be46e15", + "reference": "d7059e4c691d05ea1222b5124bed0f961be46e15", "shasum": "" }, "require": { @@ -4037,7 +4036,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.12.0" + "source": "https://github.com/Seldaek/monolog/tree/3.12.1" }, "funding": [ { @@ -4049,20 +4048,20 @@ "type": "tidelift" } ], - "time": "2026-09-09T08:34:20+00:00" + "time": "2026-09-29T19:21:12+00:00" }, { "name": "nesbot/carbon", - "version": "3.14.0", + "version": "3.14.2", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "0023eaa2c9110e47446dd512a263c69c40cd41f2" + "reference": "94cfc34887f07ab5c0efa07914c8f527544e3224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/0023eaa2c9110e47446dd512a263c69c40cd41f2", - "reference": "0023eaa2c9110e47446dd512a263c69c40cd41f2", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/94cfc34887f07ab5c0efa07914c8f527544e3224", + "reference": "94cfc34887f07ab5c0efa07914c8f527544e3224", "shasum": "" }, "require": { @@ -4082,7 +4081,7 @@ "doctrine/orm": "^2.15.2 || ^3.0", "friendsofphp/php-cs-fixer": "^v3.87.1", "kylekatarnls/multi-tester": "^2.5.3", - "phpmd/phpmd": "^2.15.0", + "phpmd/phpmd": "^3.0@dev", "phpstan/extension-installer": "^1.4.3", "phpstan/phpstan": "^2.1.22", "phpunit/phpunit": "^10.5.53", @@ -4154,7 +4153,7 @@ "type": "tidelift" } ], - "time": "2026-09-12T20:45:19+00:00" + "time": "2026-10-02T07:26:52+00:00" }, { "name": "nunomaduro/termwind", @@ -5664,16 +5663,16 @@ }, { "name": "secondnetwork/blade-tabler-icons", - "version": "v3.47.0", + "version": "v3.49.0", "source": { "type": "git", "url": "https://github.com/secondnetwork/blade-tabler-icons.git", - "reference": "b4de5fbf173822d873719d60e56bb8c5d078a88c" + "reference": "d219634a7948627ebf861012ca798573c2ad2aa3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/secondnetwork/blade-tabler-icons/zipball/b4de5fbf173822d873719d60e56bb8c5d078a88c", - "reference": "b4de5fbf173822d873719d60e56bb8c5d078a88c", + "url": "https://api.github.com/repos/secondnetwork/blade-tabler-icons/zipball/d219634a7948627ebf861012ca798573c2ad2aa3", + "reference": "d219634a7948627ebf861012ca798573c2ad2aa3", "shasum": "" }, "require": { @@ -5716,9 +5715,9 @@ ], "support": { "issues": "https://github.com/secondnetwork/blade-tabler-icons/issues", - "source": "https://github.com/secondnetwork/blade-tabler-icons/tree/v3.47.0" + "source": "https://github.com/secondnetwork/blade-tabler-icons/tree/v3.49.0" }, - "time": "2026-09-22T13:48:01+00:00" + "time": "2026-10-06T09:09:30+00:00" }, { "name": "seld/jsonlint", @@ -5786,16 +5785,16 @@ }, { "name": "seld/phar-utils", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "990bbd0e92caa216d52eca0935f6e35e589bfaa5" + "reference": "65fb381613fd31745d39a740a112a233f978d2d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/990bbd0e92caa216d52eca0935f6e35e589bfaa5", - "reference": "990bbd0e92caa216d52eca0935f6e35e589bfaa5", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/65fb381613fd31745d39a740a112a233f978d2d9", + "reference": "65fb381613fd31745d39a740a112a233f978d2d9", "shasum": "" }, "require": { @@ -5828,9 +5827,9 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.2.2" + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.3" }, - "time": "2026-08-01T12:48:55+00:00" + "time": "2026-10-01T08:16:23+00:00" }, { "name": "seld/signal-handler", @@ -5973,16 +5972,16 @@ }, { "name": "symfony/console", - "version": "v7.4.19", + "version": "v7.4.20", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3a1973458b153f566a8d7499bc06ece323d60063" + "reference": "d7bca2fe05241dc7732d0c8b6d551b879f5d0a7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3a1973458b153f566a8d7499bc06ece323d60063", - "reference": "3a1973458b153f566a8d7499bc06ece323d60063", + "url": "https://api.github.com/repos/symfony/console/zipball/d7bca2fe05241dc7732d0c8b6d551b879f5d0a7d", + "reference": "d7bca2fe05241dc7732d0c8b6d551b879f5d0a7d", "shasum": "" }, "require": { @@ -6047,7 +6046,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.19" + "source": "https://github.com/symfony/console/tree/v7.4.20" }, "funding": [ { @@ -6067,7 +6066,7 @@ "type": "tidelift" } ], - "time": "2026-09-13T10:38:41+00:00" + "time": "2026-09-18T15:55:00+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6142,16 +6141,16 @@ }, { "name": "symfony/error-handler", - "version": "v7.4.17", + "version": "v7.4.20", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "8373921e231e190a88e2ad526951bbaa791576fa" + "reference": "82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/8373921e231e190a88e2ad526951bbaa791576fa", - "reference": "8373921e231e190a88e2ad526951bbaa791576fa", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0", + "reference": "82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0", "shasum": "" }, "require": { @@ -6200,7 +6199,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v7.4.17" + "source": "https://github.com/symfony/error-handler/tree/v7.4.20" }, "funding": [ { @@ -6220,7 +6219,7 @@ "type": "tidelift" } ], - "time": "2026-08-21T17:40:08+00:00" + "time": "2026-09-22T18:56:40+00:00" }, { "name": "symfony/event-dispatcher", @@ -6459,16 +6458,16 @@ }, { "name": "symfony/finder", - "version": "v7.4.19", + "version": "v7.4.20", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "1b900bc6ae5ba60c5eee69c11ba44566190576fe" + "reference": "2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/1b900bc6ae5ba60c5eee69c11ba44566190576fe", - "reference": "1b900bc6ae5ba60c5eee69c11ba44566190576fe", + "url": "https://api.github.com/repos/symfony/finder/zipball/2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e", + "reference": "2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e", "shasum": "" }, "require": { @@ -6503,7 +6502,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.4.19" + "source": "https://github.com/symfony/finder/tree/v7.4.20" }, "funding": [ { @@ -6523,20 +6522,20 @@ "type": "tidelift" } ], - "time": "2026-09-10T19:14:10+00:00" + "time": "2026-09-26T06:31:10+00:00" }, { "name": "symfony/http-foundation", - "version": "v7.4.19", + "version": "v7.4.20", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "f7b953be7801974a5a0685e1228bbc3b12b35936" + "reference": "9d0761c0da6bd5b801b401666834901a9a1ffc33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f7b953be7801974a5a0685e1228bbc3b12b35936", - "reference": "f7b953be7801974a5a0685e1228bbc3b12b35936", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9d0761c0da6bd5b801b401666834901a9a1ffc33", + "reference": "9d0761c0da6bd5b801b401666834901a9a1ffc33", "shasum": "" }, "require": { @@ -6585,7 +6584,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.4.19" + "source": "https://github.com/symfony/http-foundation/tree/v7.4.20" }, "funding": [ { @@ -6605,20 +6604,20 @@ "type": "tidelift" } ], - "time": "2026-09-14T17:41:17+00:00" + "time": "2026-09-24T07:12:44+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.4.19", + "version": "v7.4.20", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "683507424cc84ca85ac1551adb609b6b98216667" + "reference": "392784b5d7b959b8d872542a2530c50c540a788f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/683507424cc84ca85ac1551adb609b6b98216667", - "reference": "683507424cc84ca85ac1551adb609b6b98216667", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/392784b5d7b959b8d872542a2530c50c540a788f", + "reference": "392784b5d7b959b8d872542a2530c50c540a788f", "shasum": "" }, "require": { @@ -6704,7 +6703,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.4.19" + "source": "https://github.com/symfony/http-kernel/tree/v7.4.20" }, "funding": [ { @@ -6724,7 +6723,7 @@ "type": "tidelift" } ], - "time": "2026-09-15T07:09:35+00:00" + "time": "2026-09-29T14:05:16+00:00" }, { "name": "symfony/mime", @@ -6900,16 +6899,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.41.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d" + "reference": "5cac8f4db97208823aa353f59a01faad2da52c75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", - "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5cac8f4db97208823aa353f59a01faad2da52c75", + "reference": "5cac8f4db97208823aa353f59a01faad2da52c75", "shasum": "" }, "require": { @@ -6958,7 +6957,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.41.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.43.0" }, "funding": [ { @@ -6978,20 +6977,20 @@ "type": "tidelift" } ], - "time": "2026-07-28T08:25:59+00:00" + "time": "2026-09-25T15:46:47+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.42.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9" + "reference": "533d68cf99c8f8ee2e8893c59ed59192e92cfd74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/51b5ff5ba85452b31ec6f55490b08148612339d9", - "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/533d68cf99c8f8ee2e8893c59ed59192e92cfd74", + "reference": "533d68cf99c8f8ee2e8893c59ed59192e92cfd74", "shasum": "" }, "require": { @@ -7045,7 +7044,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.42.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.43.0" }, "funding": [ { @@ -7065,20 +7064,20 @@ "type": "tidelift" } ], - "time": "2026-08-24T10:51:20+00:00" + "time": "2026-09-23T14:40:04+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.42.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502" + "reference": "ebd57ccc7edb93d632e184efbe7693d2517bab3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/aa20edea75bd9c48cfecc8360922e5a6e5c44502", - "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/ebd57ccc7edb93d632e184efbe7693d2517bab3b", + "reference": "ebd57ccc7edb93d632e184efbe7693d2517bab3b", "shasum": "" }, "require": { @@ -7130,7 +7129,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.42.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.43.0" }, "funding": [ { @@ -7150,20 +7149,20 @@ "type": "tidelift" } ], - "time": "2026-08-07T06:33:24+00:00" + "time": "2026-09-23T22:02:09+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.38.2", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6" + "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", - "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", + "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", "shasum": "" }, "require": { @@ -7215,7 +7214,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.43.0" }, "funding": [ { @@ -7235,20 +7234,20 @@ "type": "tidelift" } ], - "time": "2026-05-27T06:59:30+00:00" + "time": "2026-09-24T15:19:04+00:00" }, { "name": "symfony/polyfill-php84", - "version": "v1.38.1", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php84.git", - "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa" + "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", - "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/22c6548499cbe5c5bb072fc0c42312dff062a015", + "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015", "shasum": "" }, "require": { @@ -7295,7 +7294,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php84/tree/v1.38.1" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.43.0" }, "funding": [ { @@ -7315,20 +7314,20 @@ "type": "tidelift" } ], - "time": "2026-05-26T12:51:13+00:00" + "time": "2026-09-23T22:01:09+00:00" }, { "name": "symfony/polyfill-php85", - "version": "v1.41.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php85.git", - "reference": "255fab485aaa1006ed411040c42aecd7b5302d7a" + "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/255fab485aaa1006ed411040c42aecd7b5302d7a", - "reference": "255fab485aaa1006ed411040c42aecd7b5302d7a", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/86a42cbcc07adc331481a5ab310a4024bfc227f6", + "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6", "shasum": "" }, "require": { @@ -7375,7 +7374,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php85/tree/v1.41.0" + "source": "https://github.com/symfony/polyfill-php85/tree/v1.43.0" }, "funding": [ { @@ -7395,7 +7394,7 @@ "type": "tidelift" } ], - "time": "2026-07-01T12:47:55+00:00" + "time": "2026-09-25T15:46:47+00:00" }, { "name": "symfony/process", @@ -7464,16 +7463,16 @@ }, { "name": "symfony/routing", - "version": "v7.4.18", + "version": "v7.4.20", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3" + "reference": "2bacb72be5eadeaf9874d5accb75bfb33d21c74b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/ddd558991e98f693ae6bf5063cc1b0362c6bbec3", - "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3", + "url": "https://api.github.com/repos/symfony/routing/zipball/2bacb72be5eadeaf9874d5accb75bfb33d21c74b", + "reference": "2bacb72be5eadeaf9874d5accb75bfb33d21c74b", "shasum": "" }, "require": { @@ -7525,7 +7524,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.4.18" + "source": "https://github.com/symfony/routing/tree/v7.4.20" }, "funding": [ { @@ -7545,7 +7544,7 @@ "type": "tidelift" } ], - "time": "2026-08-17T13:12:36+00:00" + "time": "2026-09-28T19:09:50+00:00" }, { "name": "symfony/service-contracts", @@ -8385,23 +8384,23 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "db9508f7b1474469d9d3c53b86f817e344732678" + "reference": "d384a7d0d6e67aa497327260ca95023e92dc2032" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", - "reference": "db9508f7b1474469d9d3c53b86f817e344732678", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/d384a7d0d6e67aa497327260ca95023e92dc2032", + "reference": "d384a7d0d6e67aa497327260ca95023e92dc2032", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "fidry/makefile": "^0.2.0", + "fidry/makefile": "^0.2.0 || ^1.1.2", "fidry/php-cs-fixer-config": "^1.1.2", "phpstan/extension-installer": "^1.2.0", "phpstan/phpstan": "^2.0", @@ -8409,6 +8408,7 @@ "phpstan/phpstan-phpunit": "^2.0", "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "symfony/polyfill-mbstring": "^1.33", "webmozarts/strict-phpunit": "^7.5" }, "type": "library", @@ -8434,7 +8434,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.4.1" }, "funding": [ { @@ -8442,20 +8442,20 @@ "type": "github" } ], - "time": "2025-08-14T07:29:31+00:00" + "time": "2026-09-29T22:11:39+00:00" }, { "name": "filp/whoops", - "version": "2.18.5", + "version": "2.18.6", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "baec851ad6ae00db8bd0fdd30d208afc1b71c56e" + "reference": "7d0a2cde892089bb09372f4366e9b960eb3001a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/baec851ad6ae00db8bd0fdd30d208afc1b71c56e", - "reference": "baec851ad6ae00db8bd0fdd30d208afc1b71c56e", + "url": "https://api.github.com/repos/filp/whoops/zipball/7d0a2cde892089bb09372f4366e9b960eb3001a9", + "reference": "7d0a2cde892089bb09372f4366e9b960eb3001a9", "shasum": "" }, "require": { @@ -8505,7 +8505,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.18.5" + "source": "https://github.com/filp/whoops/tree/2.18.6" }, "funding": [ { @@ -8513,7 +8513,7 @@ "type": "github" } ], - "time": "2026-09-18T12:00:00+00:00" + "time": "2026-10-03T17:03:57+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -9435,20 +9435,25 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "reference": "ee15a5a2022c8383906b225055e9496a6a5e6e3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/ee15a5a2022c8383906b225055e9496a6a5e6e3b", + "reference": "ee15a5a2022c8383906b225055e9496a6a5e6e3b", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.8", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { @@ -9472,7 +9477,7 @@ } ], "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "homepage": "https://www.phpdoc.org", "keywords": [ "FQSEN", "phpDocumentor", @@ -9482,9 +9487,9 @@ ], "support": { "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.2.1" }, - "time": "2020-06-27T09:03:43+00:00" + "time": "2025-11-10T21:21:55+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -9553,16 +9558,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "327a05bbee54120d4786a0dc67aad30226ad4cf9" + "reference": "dbe2133bb23e2e33a6834f4ed417f24a1b167769" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/327a05bbee54120d4786a0dc67aad30226ad4cf9", - "reference": "327a05bbee54120d4786a0dc67aad30226ad4cf9", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dbe2133bb23e2e33a6834f4ed417f24a1b167769", + "reference": "dbe2133bb23e2e33a6834f4ed417f24a1b167769", "shasum": "" }, "require": { @@ -9605,22 +9610,22 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/2.0.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/2.1.0" }, - "time": "2026-01-06T21:53:42+00:00" + "time": "2026-09-27T19:32:54+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "2.3.5", + "version": "2.3.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9" + "reference": "1427af4647235b4a73b13940b1f1258d3584f36e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/148cefffaf0233e4c08cc13db8a195a56dd6dfe9", - "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1427af4647235b4a73b13940b1f1258d3584f36e", + "reference": "1427af4647235b4a73b13940b1f1258d3584f36e", "shasum": "" }, "require": { @@ -9652,31 +9657,31 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.5" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.6" }, - "time": "2026-08-31T16:05:28+00:00" + "time": "2026-09-27T20:07:45+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "12.5.7", + "version": "12.5.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "186dab580576598076de6818596d12b61801880e" + "reference": "7440368d94738d54f2c1de24dbd3871793bbb0dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/186dab580576598076de6818596d12b61801880e", - "reference": "186dab580576598076de6818596d12b61801880e", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7440368d94738d54f2c1de24dbd3871793bbb0dd", + "reference": "7440368d94738d54f2c1de24dbd3871793bbb0dd", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^5.7.0", + "nikic/php-parser": "^5.9.0", "php": ">=8.3", - "phpunit/php-text-template": "^5.0", + "phpunit/php-text-template": "^5.0.1", "sebastian/complexity": "^5.0", "sebastian/environment": "^8.1.2", "sebastian/lines-of-code": "^4.0.1", @@ -9684,7 +9689,7 @@ "theseer/tokenizer": "^2.0.1" }, "require-dev": { - "phpunit/phpunit": "^12.5.28" + "phpunit/phpunit": "^12.5.37" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -9722,7 +9727,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.5.7" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.5.8" }, "funding": [ { @@ -9742,7 +9747,7 @@ "type": "tidelift" } ], - "time": "2026-06-01T13:24:19+00:00" + "time": "2026-10-03T14:03:50+00:00" }, { "name": "phpunit/php-file-iterator", @@ -9883,23 +9888,23 @@ }, { "name": "phpunit/php-text-template", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53" + "reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53", - "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/babab73b7ef9fae406f2eb3ee11323a61caa63d5", + "reference": "babab73b7ef9fae406f2eb3ee11323a61caa63d5", "shasum": "" }, "require": { "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^12.5.37" }, "type": "library", "extra": { @@ -9931,15 +9936,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-text-template", + "type": "tidelift" } ], - "time": "2025-02-07T04:59:16+00:00" + "time": "2026-10-03T04:51:29+00:00" }, { "name": "phpunit/php-timer", @@ -10097,12 +10114,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "2fd3139c169689cc42710d8b1228ccf7c84b274d" + "reference": "08ce189d89be521a44e20b191a2418b299a44b2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/2fd3139c169689cc42710d8b1228ccf7c84b274d", - "reference": "2fd3139c169689cc42710d8b1228ccf7c84b274d", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/08ce189d89be521a44e20b191a2418b299a44b2b", + "reference": "08ce189d89be521a44e20b191a2418b299a44b2b", "shasum": "" }, "conflict": { @@ -10141,7 +10158,7 @@ "andreapollastri/cipi": "<=3.1.15", "andrewhaine/silverstripe-form-capture": ">=0.2,<=0.2.3|>=1,<1.0.2|>=2,<2.2.5", "aoe/restler": "<1.7.1", - "apache-solr-for-typo3/solr": "<11.6.6|>=12,<12.1.4|>=13,<13.1.4", + "apache-solr-for-typo3/solr": "<11.2.8|>=11.5,<11.6.6|>=12,<12.1.4|>=13,<13.1.4", "apache/thrift": "<0.24", "apereo/phpcas": "<1.6", "api-platform/core": "<4.1.30|>=4.2,<4.2.26|>=4.3,<4.3.12", @@ -10210,7 +10227,7 @@ "cadmium-org/cadmium-cms": "<=0.4.9", "cakephp/authentication": "<2.11.1|>=3,<3.3.6|>=4,<4.1.1", "cakephp/cakephp": "<4.5.12|>=4.6,<4.6.5|>=5,<5.1.10|>=5.2,<5.2.15|>=5.3,<5.3.7", - "cakephp/database": "<4.5.12|>=4.6,<4.6.5|>=5,<5.1.10|>=5.2,<5.2.15|>=5.3,<5.3.7", + "cakephp/database": ">=3,<4.5.12|>=4.6,<4.6.5|>=5,<5.1.10|>=5.2,<5.2.15|>=5.3,<5.3.7", "cakephp/debug_kit": "<4.10.3|>=5,<5.2.4", "cakephp/queue": ">=0.1.10,<2.3.1", "cardgate/magento2": "<2.0.33", @@ -10233,7 +10250,7 @@ "clickstorm/cs-seo": ">=6,<6.8|>=7,<7.5|>=8,<8.4|>=9,<9.3", "co-stack/fal_sftp": "<0.2.6", "cockpit-hq/cockpit": "<=2.14", - "code16/sharp": "<9.22.3", + "code16/sharp": "<9.22.5", "codeception/codeception": "<3.1.3|>=4,<4.1.22", "codeigniter/framework": "<3.1.10", "codeigniter4/framework": "<4.7.4", @@ -10391,7 +10408,7 @@ "feehi/feehicms": "<=2.1.1", "fenom/fenom": "<=2.12.1", "filament/actions": ">=3.2,<3.2.123|>=4,<=4.11.3|>=5,<=5.6.3", - "filament/filament": ">=3,<=3.3.51|>=4,<4.12.6|>=5,<5.7.6", + "filament/filament": ">=3,<=3.3.51|>=4,<4.13.2|>=5,<5.8.2", "filament/forms": ">=3,<=3.3.52", "filament/infolists": ">=3,<3.2.115|>=4,<=4.11.4|>=5,<=5.6.4", "filament/tables": ">=3,<=3.3.50|>=4,<=4.11.4|>=5,<=5.6.4", @@ -10413,6 +10430,7 @@ "floriangaerber/magnesium": "<0.3.1", "fluidtypo3/vhs": "<5.1.1", "fof/byobu": ">=0.3.0.0-beta2,<1.1.7", + "fof/oauth": "<1.7.4|>=2.0.0.0-beta1,<2.0.0.0-beta4", "fof/pretty-mail": "<=1.1.2", "fof/upload": "<1.2.3", "foodcoopshop/foodcoopshop": ">=3.2,<3.6.1", @@ -10516,6 +10534,7 @@ "james-heinrich/getid3": "<1.9.21", "james-heinrich/phpthumb": "<=1.7.23", "jasig/phpcas": "<1.3.3", + "jayanta/laravel-threat-detection": "<1.9", "jbartels/wec-map": "<3.0.3", "jcbrand/converse.js": "<3.3.3", "jleehr/canto-saas-api": "<=2", @@ -10566,7 +10585,7 @@ "lara-zeus/artemis": ">=1,<=1.0.6", "lara-zeus/dynamic-dashboard": ">=3,<=3.0.1", "laravel/fortify": "<1.11.1", - "laravel/framework": "<12.61.1|>=13,<13.12", + "laravel/framework": "<12.69|>=13,<13.30", "laravel/laravel": ">=5.4,<5.4.22", "laravel/passport": ">=13,<13.7.1", "laravel/pulse": "<1.3.1", @@ -10576,8 +10595,8 @@ "lavalite/cms": "<=10.1", "lavitto/typo3-form-to-database": "<2.2.5|>=3,<3.2.2|>=4,<4.2.3|>=5,<5.0.2", "lcobucci/jwt": ">=3.4,<3.4.6|>=4,<4.0.4|>=4.1,<4.1.5", - "league/commonmark": "<2.10", - "league/flysystem": "<1.1.4|>=2,<2.1.1", + "league/commonmark": "<=2.10.1", + "league/flysystem": "<=3.35.2", "league/oauth2-server": ">=8.3.2,<8.4.2|>=8.5,<8.5.3", "leantime/leantime": "<3.3", "lexik/jwt-authentication-bundle": "<2.10.7|>=2.11,<2.11.3", @@ -10653,7 +10672,7 @@ "mobiledetect/mobiledetectlib": "<2.8.32", "modx/revolution": "<=3.1", "mojo42/jirafeau": "<4.4", - "mongodb/mongodb": "<1.21.4|>=2,<2.4.1", + "mongodb/mongodb": "<1.21.5|>=2,<2.4.2", "mongodb/mongodb-extension": "<1.21.2", "monolog/monolog": ">=1.8,<1.12", "moodle/moodle": "<4.5.9|>=5.0.0.0-beta,<5.0.5|>=5.1.0.0-beta,<5.1.2", @@ -10762,13 +10781,13 @@ "phpmailer/phpmailer": "<6.5", "phpmussel/phpmussel": ">=1,<1.6", "phpmyadmin/phpmyadmin": "<5.2.2", - "phpmyfaq/phpmyfaq": "<=4.1.4", + "phpmyfaq/phpmyfaq": "<4.2.0.0-alpha", "phpoffice/common": "<0.2.9", "phpoffice/math": "<=0.2", "phpoffice/phpexcel": "<=1.8.2", "phpoffice/phpspreadsheet": "<=1.30.5|>=2,<=2.1.17|>=2.2,<=2.4.6|>=3,<=3.10.6|>=4,<=5.8", "phppgadmin/phppgadmin": "<=7.13", - "phpseclib/phpseclib": "<=2.0.54|>=3,<=3.0.53", + "phpseclib/phpseclib": "<3.0.57|>=4,<4.0.1", "phpservermon/phpservermon": "<3.6", "phpsysinfo/phpsysinfo": "<=3.4.5", "phpunit/phpunit": "<8.5.52|>=9,<9.6.33|>=10,<10.5.62|>=11,<11.5.50|>=12,<12.5.8|>=12.5.21,<12.5.22|>=13.1.5,<13.1.6", @@ -10911,7 +10930,7 @@ "slim/slim": "<2.6|>=4.4,<=4.15.1", "slub/slub-events": "<3.0.3", "smarty/smarty": "<4.5.7|>=5,<5.8.4", - "snipe/snipe-it": "<8.6.3", + "snipe/snipe-it": "<8.7", "socalnick/scn-social-auth": "<1.15.2", "socialiteproviders/steam": "<1.1", "solidinvoice/solidinvoice": "<=2.3.15", @@ -11161,6 +11180,7 @@ "yuan1994/tpadmin": "<=1.3.12", "yungifez/skuul": "<=2.6.5", "z-push/z-push-dev": "<2.7.6", + "zbateson/mail-mime-parser": "<3.0.6|>=4,<4.0.2", "zencart/zencart": "<=1.5.7.0-beta", "zendesk/zendesk_api_client_php": "<2.2.11", "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", @@ -11235,7 +11255,7 @@ "type": "tidelift" } ], - "time": "2026-09-23T19:28:27+00:00" + "time": "2026-10-05T23:50:51+00:00" }, { "name": "sebastian/cli-parser", @@ -12106,16 +12126,16 @@ }, { "name": "sebastian/version", - "version": "6.0.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c" + "reference": "9e935a16187e14f39b0e79910dabd614972cdb26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c", - "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/9e935a16187e14f39b0e79910dabd614972cdb26", + "reference": "9e935a16187e14f39b0e79910dabd614972cdb26", "shasum": "" }, "require": { @@ -12148,15 +12168,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/version/issues", "security": "https://github.com/sebastianbergmann/version/security/policy", - "source": "https://github.com/sebastianbergmann/version/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/version/tree/6.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/version", + "type": "tidelift" } ], - "time": "2025-02-07T05:00:38+00:00" + "time": "2026-10-04T05:50:08+00:00" }, { "name": "staabm/side-effects-detector", @@ -12321,16 +12353,16 @@ }, { "name": "webmozart/assert", - "version": "2.4.1", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "2ccb7c2e821038c03a3e6e1700c570c158c55f70" + "reference": "8a163706bbcac613733dba03f51e13b5eb1bb819" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/2ccb7c2e821038c03a3e6e1700c570c158c55f70", - "reference": "2ccb7c2e821038c03a3e6e1700c570c158c55f70", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/8a163706bbcac613733dba03f51e13b5eb1bb819", + "reference": "8a163706bbcac613733dba03f51e13b5eb1bb819", "shasum": "" }, "require": { @@ -12381,9 +12413,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/2.4.1" + "source": "https://github.com/webmozarts/assert/tree/2.5.0" }, - "time": "2026-06-15T15:31:57+00:00" + "time": "2026-10-05T23:14:19+00:00" } ], "aliases": [], diff --git a/core/vendor/composer/autoload_classmap.php b/core/vendor/composer/autoload_classmap.php index 63c8a901f7..2d46a890c9 100644 --- a/core/vendor/composer/autoload_classmap.php +++ b/core/vendor/composer/autoload_classmap.php @@ -7,6 +7,7 @@ return array( 'AddCachepwdExpiryToUsers' => $baseDir . '/database/migrations/2026_08_20_000000_add_cachepwd_expiry_to_users.php', + 'AddParentMenuindexIndexToSiteContent' => $baseDir . '/database/migrations/2026_10_01_000000_add_parent_menuindex_index_to_site_content.php', 'AddTemplatefileextensionToSiteTemplates' => $baseDir . '/database/migrations/2026_08_27_000000_add_templatefileextension_to_site_templates.php', 'AddTemplatesourceToSiteTemplates' => $baseDir . '/database/migrations/2026_08_27_000100_add_templatesource_to_site_templates.php', 'BladeUI\\Icons\\BladeIconsServiceProvider' => $vendorDir . '/blade-ui-kit/blade-icons/src/BladeIconsServiceProvider.php', @@ -716,6 +717,7 @@ 'Doctrine\\DBAL\\Platforms\\Oracle\\OracleMetadataProvider' => $vendorDir . '/doctrine/dbal/src/Platforms/Oracle/OracleMetadataProvider.php', 'Doctrine\\DBAL\\Platforms\\PostgreSQL120Platform' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQL120Platform.php', 'Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php', + 'Doctrine\\DBAL\\Platforms\\PostgreSQL\\Comparator' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQL/Comparator.php', 'Doctrine\\DBAL\\Platforms\\PostgreSQL\\PostgreSQLMetadataProvider' => $vendorDir . '/doctrine/dbal/src/Platforms/PostgreSQL/PostgreSQLMetadataProvider.php', 'Doctrine\\DBAL\\Platforms\\SQLServerPlatform' => $vendorDir . '/doctrine/dbal/src/Platforms/SQLServerPlatform.php', 'Doctrine\\DBAL\\Platforms\\SQLServer\\Comparator' => $vendorDir . '/doctrine/dbal/src/Platforms/SQLServer/Comparator.php', @@ -787,6 +789,7 @@ 'Doctrine\\DBAL\\Schema\\Exception\\ColumnAlreadyExists' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/ColumnAlreadyExists.php', 'Doctrine\\DBAL\\Schema\\Exception\\ColumnDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/ColumnDoesNotExist.php', 'Doctrine\\DBAL\\Schema\\Exception\\ForeignKeyDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/ForeignKeyDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\ImproperlyQualifiedName' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/ImproperlyQualifiedName.php', 'Doctrine\\DBAL\\Schema\\Exception\\IncomparableNames' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/IncomparableNames.php', 'Doctrine\\DBAL\\Schema\\Exception\\IndexAlreadyExists' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/IndexAlreadyExists.php', 'Doctrine\\DBAL\\Schema\\Exception\\IndexDoesNotExist' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/IndexDoesNotExist.php', @@ -797,6 +800,7 @@ 'Doctrine\\DBAL\\Schema\\Exception\\InvalidIndexDefinition' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/InvalidIndexDefinition.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidName' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/InvalidName.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidPrimaryKeyConstraintDefinition' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/InvalidPrimaryKeyConstraintDefinition.php', + 'Doctrine\\DBAL\\Schema\\Exception\\InvalidSchemaModification' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/InvalidSchemaModification.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidSequenceDefinition' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/InvalidSequenceDefinition.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidState' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/InvalidState.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidTableDefinition' => $vendorDir . '/doctrine/dbal/src/Schema/Exception/InvalidTableDefinition.php', @@ -823,6 +827,7 @@ 'Doctrine\\DBAL\\Schema\\Identifier' => $vendorDir . '/doctrine/dbal/src/Schema/Identifier.php', 'Doctrine\\DBAL\\Schema\\Index' => $vendorDir . '/doctrine/dbal/src/Schema/Index.php', 'Doctrine\\DBAL\\Schema\\IndexEditor' => $vendorDir . '/doctrine/dbal/src/Schema/IndexEditor.php', + 'Doctrine\\DBAL\\Schema\\IndexRename' => $vendorDir . '/doctrine/dbal/src/Schema/IndexRename.php', 'Doctrine\\DBAL\\Schema\\Index\\IndexType' => $vendorDir . '/doctrine/dbal/src/Schema/Index/IndexType.php', 'Doctrine\\DBAL\\Schema\\Index\\IndexedColumn' => $vendorDir . '/doctrine/dbal/src/Schema/Index/IndexedColumn.php', 'Doctrine\\DBAL\\Schema\\Introspection\\IntrospectingSchemaProvider' => $vendorDir . '/doctrine/dbal/src/Schema/Introspection/IntrospectingSchemaProvider.php', @@ -830,6 +835,7 @@ 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\IndexColumnMetadataProcessor' => $vendorDir . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/IndexColumnMetadataProcessor.php', 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\PrimaryKeyConstraintColumnMetadataProcessor' => $vendorDir . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/PrimaryKeyConstraintColumnMetadataProcessor.php', 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\SequenceMetadataProcessor' => $vendorDir . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/SequenceMetadataProcessor.php', + 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\UniqueConstraintColumnMetadataProcessor' => $vendorDir . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/UniqueConstraintColumnMetadataProcessor.php', 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\ViewMetadataProcessor' => $vendorDir . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/ViewMetadataProcessor.php', 'Doctrine\\DBAL\\Schema\\Metadata\\DatabaseMetadataRow' => $vendorDir . '/doctrine/dbal/src/Schema/Metadata/DatabaseMetadataRow.php', 'Doctrine\\DBAL\\Schema\\Metadata\\ForeignKeyConstraintColumnMetadataRow' => $vendorDir . '/doctrine/dbal/src/Schema/Metadata/ForeignKeyConstraintColumnMetadataRow.php', @@ -840,6 +846,7 @@ 'Doctrine\\DBAL\\Schema\\Metadata\\SequenceMetadataRow' => $vendorDir . '/doctrine/dbal/src/Schema/Metadata/SequenceMetadataRow.php', 'Doctrine\\DBAL\\Schema\\Metadata\\TableColumnMetadataRow' => $vendorDir . '/doctrine/dbal/src/Schema/Metadata/TableColumnMetadataRow.php', 'Doctrine\\DBAL\\Schema\\Metadata\\TableMetadataRow' => $vendorDir . '/doctrine/dbal/src/Schema/Metadata/TableMetadataRow.php', + 'Doctrine\\DBAL\\Schema\\Metadata\\UniqueConstraintColumnMetadataRow' => $vendorDir . '/doctrine/dbal/src/Schema/Metadata/UniqueConstraintColumnMetadataRow.php', 'Doctrine\\DBAL\\Schema\\Metadata\\ViewMetadataRow' => $vendorDir . '/doctrine/dbal/src/Schema/Metadata/ViewMetadataRow.php', 'Doctrine\\DBAL\\Schema\\MySQLSchemaManager' => $vendorDir . '/doctrine/dbal/src/Schema/MySQLSchemaManager.php', 'Doctrine\\DBAL\\Schema\\Name' => $vendorDir . '/doctrine/dbal/src/Schema/Name.php', @@ -869,6 +876,7 @@ 'Doctrine\\DBAL\\Schema\\Schema' => $vendorDir . '/doctrine/dbal/src/Schema/Schema.php', 'Doctrine\\DBAL\\Schema\\SchemaConfig' => $vendorDir . '/doctrine/dbal/src/Schema/SchemaConfig.php', 'Doctrine\\DBAL\\Schema\\SchemaDiff' => $vendorDir . '/doctrine/dbal/src/Schema/SchemaDiff.php', + 'Doctrine\\DBAL\\Schema\\SchemaEditor' => $vendorDir . '/doctrine/dbal/src/Schema/SchemaEditor.php', 'Doctrine\\DBAL\\Schema\\SchemaException' => $vendorDir . '/doctrine/dbal/src/Schema/SchemaException.php', 'Doctrine\\DBAL\\Schema\\SchemaManagerFactory' => $vendorDir . '/doctrine/dbal/src/Schema/SchemaManagerFactory.php', 'Doctrine\\DBAL\\Schema\\SchemaProvider' => $vendorDir . '/doctrine/dbal/src/Schema/SchemaProvider.php', @@ -902,6 +910,8 @@ 'Doctrine\\DBAL\\Types\\DateTimeType' => $vendorDir . '/doctrine/dbal/src/Types/DateTimeType.php', 'Doctrine\\DBAL\\Types\\DateTimeTzImmutableType' => $vendorDir . '/doctrine/dbal/src/Types/DateTimeTzImmutableType.php', 'Doctrine\\DBAL\\Types\\DateTimeTzType' => $vendorDir . '/doctrine/dbal/src/Types/DateTimeTzType.php', + 'Doctrine\\DBAL\\Types\\DateTimeUtcImmutableType' => $vendorDir . '/doctrine/dbal/src/Types/DateTimeUtcImmutableType.php', + 'Doctrine\\DBAL\\Types\\DateTimeUtcType' => $vendorDir . '/doctrine/dbal/src/Types/DateTimeUtcType.php', 'Doctrine\\DBAL\\Types\\DateType' => $vendorDir . '/doctrine/dbal/src/Types/DateType.php', 'Doctrine\\DBAL\\Types\\DecimalType' => $vendorDir . '/doctrine/dbal/src/Types/DecimalType.php', 'Doctrine\\DBAL\\Types\\EnumType' => $vendorDir . '/doctrine/dbal/src/Types/EnumType.php', @@ -927,6 +937,7 @@ 'Doctrine\\DBAL\\Types\\NumberType' => $vendorDir . '/doctrine/dbal/src/Types/NumberType.php', 'Doctrine\\DBAL\\Types\\PhpDateMappingType' => $vendorDir . '/doctrine/dbal/src/Types/PhpDateMappingType.php', 'Doctrine\\DBAL\\Types\\PhpDateTimeMappingType' => $vendorDir . '/doctrine/dbal/src/Types/PhpDateTimeMappingType.php', + 'Doctrine\\DBAL\\Types\\PhpFloatMappingType' => $vendorDir . '/doctrine/dbal/src/Types/PhpFloatMappingType.php', 'Doctrine\\DBAL\\Types\\PhpIntegerMappingType' => $vendorDir . '/doctrine/dbal/src/Types/PhpIntegerMappingType.php', 'Doctrine\\DBAL\\Types\\PhpTimeMappingType' => $vendorDir . '/doctrine/dbal/src/Types/PhpTimeMappingType.php', 'Doctrine\\DBAL\\Types\\SimpleArrayType' => $vendorDir . '/doctrine/dbal/src/Types/SimpleArrayType.php', @@ -1486,6 +1497,8 @@ 'ExecWithFallback\\Passthru' => $vendorDir . '/rosell-dk/exec-with-fallback/src/Passthru.php', 'ExecWithFallback\\ProcOpen' => $vendorDir . '/rosell-dk/exec-with-fallback/src/ProcOpen.php', 'ExecWithFallback\\ShellExec' => $vendorDir . '/rosell-dk/exec-with-fallback/src/ShellExec.php', + 'Feed' => $vendorDir . '/dg/rss-php/src/Feed.php', + 'FeedException' => $vendorDir . '/dg/rss-php/src/Feed.php', 'FileUtil\\FileExists' => $vendorDir . '/rosell-dk/file-util/src/FileExists.php', 'FileUtil\\FileExistsUsingExec' => $vendorDir . '/rosell-dk/file-util/src/FileExistsUsingExec.php', 'FileUtil\\PathValidator' => $vendorDir . '/rosell-dk/file-util/src/PathValidator.php', @@ -4011,87 +4024,6 @@ 'Seld\\PharUtils\\Linter' => $vendorDir . '/seld/phar-utils/src/Linter.php', 'Seld\\PharUtils\\Timestamps' => $vendorDir . '/seld/phar-utils/src/Timestamps.php', 'Seld\\Signal\\SignalHandler' => $vendorDir . '/seld/signal-handler/src/SignalHandler.php', - 'SimplePie' => $vendorDir . '/simplepie/simplepie/library/SimplePie.php', - 'SimplePie\\Author' => $vendorDir . '/simplepie/simplepie/src/Author.php', - 'SimplePie\\Cache' => $vendorDir . '/simplepie/simplepie/src/Cache.php', - 'SimplePie\\Cache\\Base' => $vendorDir . '/simplepie/simplepie/src/Cache/Base.php', - 'SimplePie\\Cache\\BaseDataCache' => $vendorDir . '/simplepie/simplepie/src/Cache/BaseDataCache.php', - 'SimplePie\\Cache\\CallableNameFilter' => $vendorDir . '/simplepie/simplepie/src/Cache/CallableNameFilter.php', - 'SimplePie\\Cache\\DB' => $vendorDir . '/simplepie/simplepie/src/Cache/DB.php', - 'SimplePie\\Cache\\DataCache' => $vendorDir . '/simplepie/simplepie/src/Cache/DataCache.php', - 'SimplePie\\Cache\\File' => $vendorDir . '/simplepie/simplepie/src/Cache/File.php', - 'SimplePie\\Cache\\Memcache' => $vendorDir . '/simplepie/simplepie/src/Cache/Memcache.php', - 'SimplePie\\Cache\\Memcached' => $vendorDir . '/simplepie/simplepie/src/Cache/Memcached.php', - 'SimplePie\\Cache\\MySQL' => $vendorDir . '/simplepie/simplepie/src/Cache/MySQL.php', - 'SimplePie\\Cache\\NameFilter' => $vendorDir . '/simplepie/simplepie/src/Cache/NameFilter.php', - 'SimplePie\\Cache\\Psr16' => $vendorDir . '/simplepie/simplepie/src/Cache/Psr16.php', - 'SimplePie\\Cache\\Redis' => $vendorDir . '/simplepie/simplepie/src/Cache/Redis.php', - 'SimplePie\\Caption' => $vendorDir . '/simplepie/simplepie/src/Caption.php', - 'SimplePie\\Category' => $vendorDir . '/simplepie/simplepie/src/Category.php', - 'SimplePie\\Content\\Type\\Sniffer' => $vendorDir . '/simplepie/simplepie/src/Content/Type/Sniffer.php', - 'SimplePie\\Copyright' => $vendorDir . '/simplepie/simplepie/src/Copyright.php', - 'SimplePie\\Credit' => $vendorDir . '/simplepie/simplepie/src/Credit.php', - 'SimplePie\\Enclosure' => $vendorDir . '/simplepie/simplepie/src/Enclosure.php', - 'SimplePie\\Exception' => $vendorDir . '/simplepie/simplepie/src/Exception.php', - 'SimplePie\\File' => $vendorDir . '/simplepie/simplepie/src/File.php', - 'SimplePie\\Gzdecode' => $vendorDir . '/simplepie/simplepie/src/Gzdecode.php', - 'SimplePie\\HTTP\\Client' => $vendorDir . '/simplepie/simplepie/src/HTTP/Client.php', - 'SimplePie\\HTTP\\ClientException' => $vendorDir . '/simplepie/simplepie/src/HTTP/ClientException.php', - 'SimplePie\\HTTP\\FileClient' => $vendorDir . '/simplepie/simplepie/src/HTTP/FileClient.php', - 'SimplePie\\HTTP\\Parser' => $vendorDir . '/simplepie/simplepie/src/HTTP/Parser.php', - 'SimplePie\\HTTP\\Psr18Client' => $vendorDir . '/simplepie/simplepie/src/HTTP/Psr18Client.php', - 'SimplePie\\HTTP\\Psr7Response' => $vendorDir . '/simplepie/simplepie/src/HTTP/Psr7Response.php', - 'SimplePie\\HTTP\\RawTextResponse' => $vendorDir . '/simplepie/simplepie/src/HTTP/RawTextResponse.php', - 'SimplePie\\HTTP\\Response' => $vendorDir . '/simplepie/simplepie/src/HTTP/Response.php', - 'SimplePie\\IRI' => $vendorDir . '/simplepie/simplepie/src/IRI.php', - 'SimplePie\\Item' => $vendorDir . '/simplepie/simplepie/src/Item.php', - 'SimplePie\\Locator' => $vendorDir . '/simplepie/simplepie/src/Locator.php', - 'SimplePie\\Misc' => $vendorDir . '/simplepie/simplepie/src/Misc.php', - 'SimplePie\\Net\\IPv6' => $vendorDir . '/simplepie/simplepie/src/Net/IPv6.php', - 'SimplePie\\Parse\\Date' => $vendorDir . '/simplepie/simplepie/src/Parse/Date.php', - 'SimplePie\\Parser' => $vendorDir . '/simplepie/simplepie/src/Parser.php', - 'SimplePie\\Rating' => $vendorDir . '/simplepie/simplepie/src/Rating.php', - 'SimplePie\\Registry' => $vendorDir . '/simplepie/simplepie/src/Registry.php', - 'SimplePie\\RegistryAware' => $vendorDir . '/simplepie/simplepie/src/RegistryAware.php', - 'SimplePie\\Restriction' => $vendorDir . '/simplepie/simplepie/src/Restriction.php', - 'SimplePie\\Sanitize' => $vendorDir . '/simplepie/simplepie/src/Sanitize.php', - 'SimplePie\\SimplePie' => $vendorDir . '/simplepie/simplepie/src/SimplePie.php', - 'SimplePie\\Source' => $vendorDir . '/simplepie/simplepie/src/Source.php', - 'SimplePie\\XML\\Declaration\\Parser' => $vendorDir . '/simplepie/simplepie/src/XML/Declaration/Parser.php', - 'SimplePie_Author' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Author.php', - 'SimplePie_Cache' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Cache.php', - 'SimplePie_Cache_Base' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Cache/Base.php', - 'SimplePie_Cache_DB' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Cache/DB.php', - 'SimplePie_Cache_File' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Cache/File.php', - 'SimplePie_Cache_Memcache' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Cache/Memcache.php', - 'SimplePie_Cache_Memcached' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Cache/Memcached.php', - 'SimplePie_Cache_MySQL' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Cache/MySQL.php', - 'SimplePie_Cache_Redis' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Cache/Redis.php', - 'SimplePie_Caption' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Caption.php', - 'SimplePie_Category' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Category.php', - 'SimplePie_Content_Type_Sniffer' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Content/Type/Sniffer.php', - 'SimplePie_Copyright' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Copyright.php', - 'SimplePie_Core' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Core.php', - 'SimplePie_Credit' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Credit.php', - 'SimplePie_Decode_HTML_Entities' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Decode/HTML/Entities.php', - 'SimplePie_Enclosure' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Enclosure.php', - 'SimplePie_Exception' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Exception.php', - 'SimplePie_File' => $vendorDir . '/simplepie/simplepie/library/SimplePie/File.php', - 'SimplePie_HTTP_Parser' => $vendorDir . '/simplepie/simplepie/library/SimplePie/HTTP/Parser.php', - 'SimplePie_IRI' => $vendorDir . '/simplepie/simplepie/library/SimplePie/IRI.php', - 'SimplePie_Item' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Item.php', - 'SimplePie_Locator' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Locator.php', - 'SimplePie_Misc' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Misc.php', - 'SimplePie_Net_IPv6' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Net/IPv6.php', - 'SimplePie_Parse_Date' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Parse/Date.php', - 'SimplePie_Parser' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Parser.php', - 'SimplePie_Rating' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Rating.php', - 'SimplePie_Registry' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Registry.php', - 'SimplePie_Restriction' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Restriction.php', - 'SimplePie_Sanitize' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Sanitize.php', - 'SimplePie_Source' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Source.php', - 'SimplePie_XML_Declaration_Parser' => $vendorDir . '/simplepie/simplepie/library/SimplePie/XML/Declaration/Parser.php', - 'SimplePie_gzdecode' => $vendorDir . '/simplepie/simplepie/library/SimplePie/gzdecode.php', 'Stringable' => $vendorDir . '/marc-mabe/php-enum/stubs/Stringable.php', 'Symfony\\Component\\Clock\\Clock' => $vendorDir . '/symfony/clock/Clock.php', 'Symfony\\Component\\Clock\\ClockAwareTrait' => $vendorDir . '/symfony/clock/ClockAwareTrait.php', diff --git a/core/vendor/composer/autoload_namespaces.php b/core/vendor/composer/autoload_namespaces.php index b031e00bec..15a2ff3ad6 100644 --- a/core/vendor/composer/autoload_namespaces.php +++ b/core/vendor/composer/autoload_namespaces.php @@ -6,5 +6,4 @@ $baseDir = dirname($vendorDir); return array( - 'SimplePie' => array($vendorDir . '/simplepie/simplepie/library'), ); diff --git a/core/vendor/composer/autoload_psr4.php b/core/vendor/composer/autoload_psr4.php index 34707d4950..a16c61ef93 100644 --- a/core/vendor/composer/autoload_psr4.php +++ b/core/vendor/composer/autoload_psr4.php @@ -37,7 +37,6 @@ 'Symfony\\Component\\ErrorHandler\\' => array($vendorDir . '/symfony/error-handler'), 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), 'Symfony\\Component\\Clock\\' => array($vendorDir . '/symfony/clock'), - 'SimplePie\\' => array($vendorDir . '/simplepie/simplepie/src'), 'Seld\\Signal\\' => array($vendorDir . '/seld/signal-handler/src'), 'Seld\\PharUtils\\' => array($vendorDir . '/seld/phar-utils/src'), 'Seld\\JsonLint\\' => array($vendorDir . '/seld/jsonlint/src/Seld/JsonLint'), diff --git a/core/vendor/composer/autoload_static.php b/core/vendor/composer/autoload_static.php index ac86e7d958..8c0e8dd377 100644 --- a/core/vendor/composer/autoload_static.php +++ b/core/vendor/composer/autoload_static.php @@ -96,7 +96,6 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Symfony\\Component\\ErrorHandler\\' => 31, 'Symfony\\Component\\Console\\' => 26, 'Symfony\\Component\\Clock\\' => 24, - 'SimplePie\\' => 10, 'Seld\\Signal\\' => 12, 'Seld\\PharUtils\\' => 15, 'Seld\\JsonLint\\' => 14, @@ -341,10 +340,6 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 array ( 0 => __DIR__ . '/..' . '/symfony/clock', ), - 'SimplePie\\' => - array ( - 0 => __DIR__ . '/..' . '/simplepie/simplepie/src', - ), 'Seld\\Signal\\' => array ( 0 => __DIR__ . '/..' . '/seld/signal-handler/src', @@ -672,18 +667,9 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 ), ); - public static $prefixesPsr0 = array ( - 'S' => - array ( - 'SimplePie' => - array ( - 0 => __DIR__ . '/..' . '/simplepie/simplepie/library', - ), - ), - ); - public static $classMap = array ( 'AddCachepwdExpiryToUsers' => __DIR__ . '/../..' . '/database/migrations/2026_08_20_000000_add_cachepwd_expiry_to_users.php', + 'AddParentMenuindexIndexToSiteContent' => __DIR__ . '/../..' . '/database/migrations/2026_10_01_000000_add_parent_menuindex_index_to_site_content.php', 'AddTemplatefileextensionToSiteTemplates' => __DIR__ . '/../..' . '/database/migrations/2026_08_27_000000_add_templatefileextension_to_site_templates.php', 'AddTemplatesourceToSiteTemplates' => __DIR__ . '/../..' . '/database/migrations/2026_08_27_000100_add_templatesource_to_site_templates.php', 'BladeUI\\Icons\\BladeIconsServiceProvider' => __DIR__ . '/..' . '/blade-ui-kit/blade-icons/src/BladeIconsServiceProvider.php', @@ -1393,6 +1379,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Doctrine\\DBAL\\Platforms\\Oracle\\OracleMetadataProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/Oracle/OracleMetadataProvider.php', 'Doctrine\\DBAL\\Platforms\\PostgreSQL120Platform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQL120Platform.php', 'Doctrine\\DBAL\\Platforms\\PostgreSQLPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php', + 'Doctrine\\DBAL\\Platforms\\PostgreSQL\\Comparator' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQL/Comparator.php', 'Doctrine\\DBAL\\Platforms\\PostgreSQL\\PostgreSQLMetadataProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/PostgreSQL/PostgreSQLMetadataProvider.php', 'Doctrine\\DBAL\\Platforms\\SQLServerPlatform' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/SQLServerPlatform.php', 'Doctrine\\DBAL\\Platforms\\SQLServer\\Comparator' => __DIR__ . '/..' . '/doctrine/dbal/src/Platforms/SQLServer/Comparator.php', @@ -1464,6 +1451,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Doctrine\\DBAL\\Schema\\Exception\\ColumnAlreadyExists' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/ColumnAlreadyExists.php', 'Doctrine\\DBAL\\Schema\\Exception\\ColumnDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/ColumnDoesNotExist.php', 'Doctrine\\DBAL\\Schema\\Exception\\ForeignKeyDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/ForeignKeyDoesNotExist.php', + 'Doctrine\\DBAL\\Schema\\Exception\\ImproperlyQualifiedName' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/ImproperlyQualifiedName.php', 'Doctrine\\DBAL\\Schema\\Exception\\IncomparableNames' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/IncomparableNames.php', 'Doctrine\\DBAL\\Schema\\Exception\\IndexAlreadyExists' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/IndexAlreadyExists.php', 'Doctrine\\DBAL\\Schema\\Exception\\IndexDoesNotExist' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/IndexDoesNotExist.php', @@ -1474,6 +1462,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Doctrine\\DBAL\\Schema\\Exception\\InvalidIndexDefinition' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/InvalidIndexDefinition.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidName' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/InvalidName.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidPrimaryKeyConstraintDefinition' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/InvalidPrimaryKeyConstraintDefinition.php', + 'Doctrine\\DBAL\\Schema\\Exception\\InvalidSchemaModification' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/InvalidSchemaModification.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidSequenceDefinition' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/InvalidSequenceDefinition.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidState' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/InvalidState.php', 'Doctrine\\DBAL\\Schema\\Exception\\InvalidTableDefinition' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Exception/InvalidTableDefinition.php', @@ -1500,6 +1489,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Doctrine\\DBAL\\Schema\\Identifier' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Identifier.php', 'Doctrine\\DBAL\\Schema\\Index' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Index.php', 'Doctrine\\DBAL\\Schema\\IndexEditor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/IndexEditor.php', + 'Doctrine\\DBAL\\Schema\\IndexRename' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/IndexRename.php', 'Doctrine\\DBAL\\Schema\\Index\\IndexType' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Index/IndexType.php', 'Doctrine\\DBAL\\Schema\\Index\\IndexedColumn' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Index/IndexedColumn.php', 'Doctrine\\DBAL\\Schema\\Introspection\\IntrospectingSchemaProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Introspection/IntrospectingSchemaProvider.php', @@ -1507,6 +1497,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\IndexColumnMetadataProcessor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/IndexColumnMetadataProcessor.php', 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\PrimaryKeyConstraintColumnMetadataProcessor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/PrimaryKeyConstraintColumnMetadataProcessor.php', 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\SequenceMetadataProcessor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/SequenceMetadataProcessor.php', + 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\UniqueConstraintColumnMetadataProcessor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/UniqueConstraintColumnMetadataProcessor.php', 'Doctrine\\DBAL\\Schema\\Introspection\\MetadataProcessor\\ViewMetadataProcessor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/ViewMetadataProcessor.php', 'Doctrine\\DBAL\\Schema\\Metadata\\DatabaseMetadataRow' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Metadata/DatabaseMetadataRow.php', 'Doctrine\\DBAL\\Schema\\Metadata\\ForeignKeyConstraintColumnMetadataRow' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Metadata/ForeignKeyConstraintColumnMetadataRow.php', @@ -1517,6 +1508,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Doctrine\\DBAL\\Schema\\Metadata\\SequenceMetadataRow' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Metadata/SequenceMetadataRow.php', 'Doctrine\\DBAL\\Schema\\Metadata\\TableColumnMetadataRow' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Metadata/TableColumnMetadataRow.php', 'Doctrine\\DBAL\\Schema\\Metadata\\TableMetadataRow' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Metadata/TableMetadataRow.php', + 'Doctrine\\DBAL\\Schema\\Metadata\\UniqueConstraintColumnMetadataRow' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Metadata/UniqueConstraintColumnMetadataRow.php', 'Doctrine\\DBAL\\Schema\\Metadata\\ViewMetadataRow' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Metadata/ViewMetadataRow.php', 'Doctrine\\DBAL\\Schema\\MySQLSchemaManager' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/MySQLSchemaManager.php', 'Doctrine\\DBAL\\Schema\\Name' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Name.php', @@ -1546,6 +1538,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Doctrine\\DBAL\\Schema\\Schema' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/Schema.php', 'Doctrine\\DBAL\\Schema\\SchemaConfig' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SchemaConfig.php', 'Doctrine\\DBAL\\Schema\\SchemaDiff' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SchemaDiff.php', + 'Doctrine\\DBAL\\Schema\\SchemaEditor' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SchemaEditor.php', 'Doctrine\\DBAL\\Schema\\SchemaException' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SchemaException.php', 'Doctrine\\DBAL\\Schema\\SchemaManagerFactory' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SchemaManagerFactory.php', 'Doctrine\\DBAL\\Schema\\SchemaProvider' => __DIR__ . '/..' . '/doctrine/dbal/src/Schema/SchemaProvider.php', @@ -1579,6 +1572,8 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Doctrine\\DBAL\\Types\\DateTimeType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateTimeType.php', 'Doctrine\\DBAL\\Types\\DateTimeTzImmutableType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateTimeTzImmutableType.php', 'Doctrine\\DBAL\\Types\\DateTimeTzType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateTimeTzType.php', + 'Doctrine\\DBAL\\Types\\DateTimeUtcImmutableType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateTimeUtcImmutableType.php', + 'Doctrine\\DBAL\\Types\\DateTimeUtcType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateTimeUtcType.php', 'Doctrine\\DBAL\\Types\\DateType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DateType.php', 'Doctrine\\DBAL\\Types\\DecimalType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/DecimalType.php', 'Doctrine\\DBAL\\Types\\EnumType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/EnumType.php', @@ -1604,6 +1599,7 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Doctrine\\DBAL\\Types\\NumberType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/NumberType.php', 'Doctrine\\DBAL\\Types\\PhpDateMappingType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/PhpDateMappingType.php', 'Doctrine\\DBAL\\Types\\PhpDateTimeMappingType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/PhpDateTimeMappingType.php', + 'Doctrine\\DBAL\\Types\\PhpFloatMappingType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/PhpFloatMappingType.php', 'Doctrine\\DBAL\\Types\\PhpIntegerMappingType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/PhpIntegerMappingType.php', 'Doctrine\\DBAL\\Types\\PhpTimeMappingType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/PhpTimeMappingType.php', 'Doctrine\\DBAL\\Types\\SimpleArrayType' => __DIR__ . '/..' . '/doctrine/dbal/src/Types/SimpleArrayType.php', @@ -2163,6 +2159,8 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'ExecWithFallback\\Passthru' => __DIR__ . '/..' . '/rosell-dk/exec-with-fallback/src/Passthru.php', 'ExecWithFallback\\ProcOpen' => __DIR__ . '/..' . '/rosell-dk/exec-with-fallback/src/ProcOpen.php', 'ExecWithFallback\\ShellExec' => __DIR__ . '/..' . '/rosell-dk/exec-with-fallback/src/ShellExec.php', + 'Feed' => __DIR__ . '/..' . '/dg/rss-php/src/Feed.php', + 'FeedException' => __DIR__ . '/..' . '/dg/rss-php/src/Feed.php', 'FileUtil\\FileExists' => __DIR__ . '/..' . '/rosell-dk/file-util/src/FileExists.php', 'FileUtil\\FileExistsUsingExec' => __DIR__ . '/..' . '/rosell-dk/file-util/src/FileExistsUsingExec.php', 'FileUtil\\PathValidator' => __DIR__ . '/..' . '/rosell-dk/file-util/src/PathValidator.php', @@ -4688,87 +4686,6 @@ class ComposerStaticInit925fea465a58fa69f06ccf2629003e87 'Seld\\PharUtils\\Linter' => __DIR__ . '/..' . '/seld/phar-utils/src/Linter.php', 'Seld\\PharUtils\\Timestamps' => __DIR__ . '/..' . '/seld/phar-utils/src/Timestamps.php', 'Seld\\Signal\\SignalHandler' => __DIR__ . '/..' . '/seld/signal-handler/src/SignalHandler.php', - 'SimplePie' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie.php', - 'SimplePie\\Author' => __DIR__ . '/..' . '/simplepie/simplepie/src/Author.php', - 'SimplePie\\Cache' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache.php', - 'SimplePie\\Cache\\Base' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/Base.php', - 'SimplePie\\Cache\\BaseDataCache' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/BaseDataCache.php', - 'SimplePie\\Cache\\CallableNameFilter' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/CallableNameFilter.php', - 'SimplePie\\Cache\\DB' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/DB.php', - 'SimplePie\\Cache\\DataCache' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/DataCache.php', - 'SimplePie\\Cache\\File' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/File.php', - 'SimplePie\\Cache\\Memcache' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/Memcache.php', - 'SimplePie\\Cache\\Memcached' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/Memcached.php', - 'SimplePie\\Cache\\MySQL' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/MySQL.php', - 'SimplePie\\Cache\\NameFilter' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/NameFilter.php', - 'SimplePie\\Cache\\Psr16' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/Psr16.php', - 'SimplePie\\Cache\\Redis' => __DIR__ . '/..' . '/simplepie/simplepie/src/Cache/Redis.php', - 'SimplePie\\Caption' => __DIR__ . '/..' . '/simplepie/simplepie/src/Caption.php', - 'SimplePie\\Category' => __DIR__ . '/..' . '/simplepie/simplepie/src/Category.php', - 'SimplePie\\Content\\Type\\Sniffer' => __DIR__ . '/..' . '/simplepie/simplepie/src/Content/Type/Sniffer.php', - 'SimplePie\\Copyright' => __DIR__ . '/..' . '/simplepie/simplepie/src/Copyright.php', - 'SimplePie\\Credit' => __DIR__ . '/..' . '/simplepie/simplepie/src/Credit.php', - 'SimplePie\\Enclosure' => __DIR__ . '/..' . '/simplepie/simplepie/src/Enclosure.php', - 'SimplePie\\Exception' => __DIR__ . '/..' . '/simplepie/simplepie/src/Exception.php', - 'SimplePie\\File' => __DIR__ . '/..' . '/simplepie/simplepie/src/File.php', - 'SimplePie\\Gzdecode' => __DIR__ . '/..' . '/simplepie/simplepie/src/Gzdecode.php', - 'SimplePie\\HTTP\\Client' => __DIR__ . '/..' . '/simplepie/simplepie/src/HTTP/Client.php', - 'SimplePie\\HTTP\\ClientException' => __DIR__ . '/..' . '/simplepie/simplepie/src/HTTP/ClientException.php', - 'SimplePie\\HTTP\\FileClient' => __DIR__ . '/..' . '/simplepie/simplepie/src/HTTP/FileClient.php', - 'SimplePie\\HTTP\\Parser' => __DIR__ . '/..' . '/simplepie/simplepie/src/HTTP/Parser.php', - 'SimplePie\\HTTP\\Psr18Client' => __DIR__ . '/..' . '/simplepie/simplepie/src/HTTP/Psr18Client.php', - 'SimplePie\\HTTP\\Psr7Response' => __DIR__ . '/..' . '/simplepie/simplepie/src/HTTP/Psr7Response.php', - 'SimplePie\\HTTP\\RawTextResponse' => __DIR__ . '/..' . '/simplepie/simplepie/src/HTTP/RawTextResponse.php', - 'SimplePie\\HTTP\\Response' => __DIR__ . '/..' . '/simplepie/simplepie/src/HTTP/Response.php', - 'SimplePie\\IRI' => __DIR__ . '/..' . '/simplepie/simplepie/src/IRI.php', - 'SimplePie\\Item' => __DIR__ . '/..' . '/simplepie/simplepie/src/Item.php', - 'SimplePie\\Locator' => __DIR__ . '/..' . '/simplepie/simplepie/src/Locator.php', - 'SimplePie\\Misc' => __DIR__ . '/..' . '/simplepie/simplepie/src/Misc.php', - 'SimplePie\\Net\\IPv6' => __DIR__ . '/..' . '/simplepie/simplepie/src/Net/IPv6.php', - 'SimplePie\\Parse\\Date' => __DIR__ . '/..' . '/simplepie/simplepie/src/Parse/Date.php', - 'SimplePie\\Parser' => __DIR__ . '/..' . '/simplepie/simplepie/src/Parser.php', - 'SimplePie\\Rating' => __DIR__ . '/..' . '/simplepie/simplepie/src/Rating.php', - 'SimplePie\\Registry' => __DIR__ . '/..' . '/simplepie/simplepie/src/Registry.php', - 'SimplePie\\RegistryAware' => __DIR__ . '/..' . '/simplepie/simplepie/src/RegistryAware.php', - 'SimplePie\\Restriction' => __DIR__ . '/..' . '/simplepie/simplepie/src/Restriction.php', - 'SimplePie\\Sanitize' => __DIR__ . '/..' . '/simplepie/simplepie/src/Sanitize.php', - 'SimplePie\\SimplePie' => __DIR__ . '/..' . '/simplepie/simplepie/src/SimplePie.php', - 'SimplePie\\Source' => __DIR__ . '/..' . '/simplepie/simplepie/src/Source.php', - 'SimplePie\\XML\\Declaration\\Parser' => __DIR__ . '/..' . '/simplepie/simplepie/src/XML/Declaration/Parser.php', - 'SimplePie_Author' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Author.php', - 'SimplePie_Cache' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Cache.php', - 'SimplePie_Cache_Base' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Cache/Base.php', - 'SimplePie_Cache_DB' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Cache/DB.php', - 'SimplePie_Cache_File' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Cache/File.php', - 'SimplePie_Cache_Memcache' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Cache/Memcache.php', - 'SimplePie_Cache_Memcached' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Cache/Memcached.php', - 'SimplePie_Cache_MySQL' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Cache/MySQL.php', - 'SimplePie_Cache_Redis' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Cache/Redis.php', - 'SimplePie_Caption' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Caption.php', - 'SimplePie_Category' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Category.php', - 'SimplePie_Content_Type_Sniffer' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Content/Type/Sniffer.php', - 'SimplePie_Copyright' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Copyright.php', - 'SimplePie_Core' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Core.php', - 'SimplePie_Credit' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Credit.php', - 'SimplePie_Decode_HTML_Entities' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Decode/HTML/Entities.php', - 'SimplePie_Enclosure' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Enclosure.php', - 'SimplePie_Exception' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Exception.php', - 'SimplePie_File' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/File.php', - 'SimplePie_HTTP_Parser' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/HTTP/Parser.php', - 'SimplePie_IRI' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/IRI.php', - 'SimplePie_Item' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Item.php', - 'SimplePie_Locator' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Locator.php', - 'SimplePie_Misc' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Misc.php', - 'SimplePie_Net_IPv6' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Net/IPv6.php', - 'SimplePie_Parse_Date' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Parse/Date.php', - 'SimplePie_Parser' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Parser.php', - 'SimplePie_Rating' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Rating.php', - 'SimplePie_Registry' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Registry.php', - 'SimplePie_Restriction' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Restriction.php', - 'SimplePie_Sanitize' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Sanitize.php', - 'SimplePie_Source' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Source.php', - 'SimplePie_XML_Declaration_Parser' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/XML/Declaration/Parser.php', - 'SimplePie_gzdecode' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/gzdecode.php', 'Stringable' => __DIR__ . '/..' . '/marc-mabe/php-enum/stubs/Stringable.php', 'Symfony\\Component\\Clock\\Clock' => __DIR__ . '/..' . '/symfony/clock/Clock.php', 'Symfony\\Component\\Clock\\ClockAwareTrait' => __DIR__ . '/..' . '/symfony/clock/ClockAwareTrait.php', @@ -5787,7 +5704,6 @@ public static function getInitializer(ClassLoader $loader) return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit925fea465a58fa69f06ccf2629003e87::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit925fea465a58fa69f06ccf2629003e87::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit925fea465a58fa69f06ccf2629003e87::$prefixesPsr0; $loader->classMap = ComposerStaticInit925fea465a58fa69f06ccf2629003e87::$classMap; }, null, ClassLoader::class); diff --git a/core/vendor/composer/class-map-generator/README.md b/core/vendor/composer/class-map-generator/README.md index fe5ab828fd..ae0fa1ac52 100644 --- a/core/vendor/composer/class-map-generator/README.md +++ b/core/vendor/composer/class-map-generator/README.md @@ -56,6 +56,11 @@ foreach ($classMap->getMap() as $symbol => $path) { foreach ($classMap->getAmbiguousClasses() as $symbol => $paths) { // warn user about ambiguous class resolution } + +foreach ($classMap->getAmbiguousFolders() as $paths) { + // warn user that these paths only differ in casing, and therefore fold into a + // single file/folder on case insensitive filesystems like those of Windows/macOS +} ``` diff --git a/core/vendor/composer/class-map-generator/src/ClassMap.php b/core/vendor/composer/class-map-generator/src/ClassMap.php index f4391d27d4..7f3af6bdd5 100644 --- a/core/vendor/composer/class-map-generator/src/ClassMap.php +++ b/core/vendor/composer/class-map-generator/src/ClassMap.php @@ -19,6 +19,8 @@ */ class ClassMap implements \Countable { + private const DEFAULT_DUPLICATES_FILTER = '{(?:^|/)(test|fixture|example|stub)s?/}i'; + /** * @var array */ @@ -34,6 +36,13 @@ class ClassMap implements \Countable */ private $psrViolations = []; + /** + * Results of getAmbiguousFolders by filter, '' being used for false + * + * @var array>> + */ + private $ambiguousFoldersCache = []; + /** * Returns the class map, which is a list of paths indexed by class name * @@ -82,15 +91,13 @@ public function getPsrViolations(): array * * @return array> */ - public function getAmbiguousClasses($duplicatesFilter = '{/(test|fixture|example|stub)s?/}i'): array + public function getAmbiguousClasses($duplicatesFilter = self::DEFAULT_DUPLICATES_FILTER): array { if (false === $duplicatesFilter) { return $this->ambiguousClasses; } - if (true === $duplicatesFilter) { - throw new \InvalidArgumentException('$duplicatesFilter should be false or a string with a valid regex, got true.'); - } + self::assertValidDuplicatesFilter($duplicatesFilter); $ambiguousClasses = []; foreach ($this->ambiguousClasses as $class => $paths) { @@ -105,6 +112,156 @@ public function getAmbiguousClasses($duplicatesFilter = '{/(test|fixture|example return $ambiguousClasses; } + /** + * A list of sets of paths which are identical except for their casing + * + * Case-insensitive filesystems (Windows, macOS) fold each such set into a single file or + * directory, so a project which autoloads correctly on a case-sensitive filesystem can behave + * differently there. This typically happens when a folder is renamed to a different casing: + * on a case-sensitive checkout src/Foo and src/foo then co-exist, while elsewhere they merge + * and the classes below them no longer match the casing of the folder they end up in. + * + * Every folder or file whose own name differs in casing is reported, while differences it + * only inherits from a parent folder are reported once at that parent's level. + * + * By default, paths that contain test(s), fixture(s), example(s) or stub(s) are ignored + * as those are typically not problematic when they're dummy classes in the tests folder. + * If you want to get these back as well you can pass false to $duplicatesFilter. Or + * you can pass your own pattern to exclude if you need to change the default. + * + * A set of paths is only left out when every path below it is ignored though, as a test + * folder merging with a production folder is still a problem for the latter. + * + * The result is cached until a class is added. + * + * @param non-empty-string|false $duplicatesFilter + * + * @return list> + */ + public function getAmbiguousFolders($duplicatesFilter = self::DEFAULT_DUPLICATES_FILTER): array + { + self::assertValidDuplicatesFilter($duplicatesFilter); + + $cacheKey = false === $duplicatesFilter ? '' : $duplicatesFilter; + if (!isset($this->ambiguousFoldersCache[$cacheKey])) { + $this->ambiguousFoldersCache[$cacheKey] = $this->findAmbiguousFolders($duplicatesFilter); + } + + return $this->ambiguousFoldersCache[$cacheKey]; + } + + /** + * @param non-empty-string|false $duplicatesFilter + * + * @return list> + */ + private function findAmbiguousFolders($duplicatesFilter): array + { + $paths = []; + foreach ($this->map as $path) { + $paths[] = strtr($path, '\\', '/'); + } + // a class found in several files only has one of them in the map, but the others + // are just as relevant here, and typically are the renamed folder's stale copies + foreach ($this->ambiguousClasses as $duplicatePaths) { + foreach ($duplicatePaths as $path) { + $paths[] = strtr($path, '\\', '/'); + } + } + // sorted so the result does not depend on scan order, and so that each path can skip + // the folders it shares with the previous one as those were already registered + sort($paths, SORT_STRING); + + // folded prefix => first path seen for it, which has the lowest casing as paths are sorted + /** @var array $first */ + $first = []; + // folded prefix => name of its last segment as written => first path seen with that name + /** @var array> $variants */ + $variants = []; + $previous = ''; + foreach ($paths as $path) { + // length of the common prefix with the previous path, as XOR turns equal bytes into \0 + $common = strspn($path ^ $previous, "\0"); + // cut back to the last / within it, as only whole folders were registered already + $skipUntil = $common > 0 ? (int) strrpos($path, '/', $common - \strlen($path) - 1) : 0; + $previous = $path; + + // walk every prefix of the path, the full path included so that files which only + // differ in casing are caught as well as the folders above them + $foldedPath = self::foldCase($path); + // drive letters and stream wrapper schemes are never case sensitive so they are + // skipped, see also ClassMapGenerator::normalizePath which matches the same prefixes + $rootLength = Preg::isMatchStrictGroups('{^(?:[0-9a-z]{2,}+:(?://(?:[a-z]:)?)?|[a-z]:)}i', $path, $match) ? \strlen($match[0]) : 0; + $offset = 0; + foreach (explode('/', $path) as $name) { + $end = $offset + \strlen($name); + if ('' !== $name && $end > $rootLength && $end > $skipUntil) { + $foldedPrefix = substr($foldedPath, 0, $end); + if (!isset($first[$foldedPrefix])) { + $first[$foldedPrefix] = substr($path, 0, $offset).$name; + } elseif (0 !== substr_compare($first[$foldedPrefix], $name, $offset) && !isset($variants[$foldedPrefix][$name])) { + // a name written the same way as the first one only differs by its + // parents, which get reported at their own level + $variants[$foldedPrefix][$name] = substr($path, 0, $offset).$name; + } + } + $offset = $end + 1; + } + } + + if (\count($variants) === 0) { + return []; + } + + // only look for paths which are not filtered out once something was found + /** @var array|null $relevant */ + $relevant = null; + if (false !== $duplicatesFilter) { + $relevant = []; + foreach ($paths as $path) { + if (Preg::isMatch($duplicatesFilter, $path)) { + continue; + } + $foldedPath = self::foldCase($path); + $offset = 0; + while (false !== ($separator = strpos($foldedPath, '/', $offset))) { + $relevant[substr($foldedPath, 0, $separator)] = true; + $offset = $separator + 1; + } + $relevant[$foldedPath] = true; + } + } + + $ambiguousPaths = []; + foreach ($variants as $foldedPrefix => $names) { + if (null === $relevant || isset($relevant[$foldedPrefix])) { + // already sorted as the paths were walked in order + $ambiguousPaths[$foldedPrefix] = array_merge([$first[$foldedPrefix]], array_values($names)); + } + } + ksort($ambiguousPaths, SORT_STRING); + + return array_values($ambiguousPaths); + } + + /** + * @param non-empty-string|bool $duplicatesFilter + */ + private static function assertValidDuplicatesFilter($duplicatesFilter): void + { + if (true === $duplicatesFilter) { + throw new \InvalidArgumentException('$duplicatesFilter should be false or a string with a valid regex, got true.'); + } + } + + /** + * Lowercases ASCII characters only, as strtolower is locale dependent before PHP 8.2 + */ + private static function foldCase(string $str): string + { + return strtr($str, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + /** * Sorts the class map alphabetically by class names */ @@ -122,6 +279,7 @@ public function addClass(string $className, string $path): void unset($this->psrViolations[strtr($path, '\\', '/')]); $this->map[$className] = $path; + $this->ambiguousFoldersCache = []; } /** @@ -170,6 +328,7 @@ public function clearPsrViolationsByPath(string $pathPrefix): void public function addAmbiguousClass(string $className, string $path): void { $this->ambiguousClasses[$className][] = $path; + $this->ambiguousFoldersCache = []; } public function count(): int diff --git a/core/vendor/composer/class-map-generator/src/ClassMapGenerator.php b/core/vendor/composer/class-map-generator/src/ClassMapGenerator.php index 31ef653e74..5966f86055 100644 --- a/core/vendor/composer/class-map-generator/src/ClassMapGenerator.php +++ b/core/vendor/composer/class-map-generator/src/ClassMapGenerator.php @@ -152,7 +152,7 @@ public function scanPaths($path, ?string $excluded = null, string $autoloadType $filePath = $cwd . '/' . $filePath; $filePath = self::normalizePath($filePath); } else { - $filePath = Preg::replace('{(?=8.2" + }, + "require-dev": { + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.6", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1" + }, + "time": "2026-02-25T00:47:42+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + } + ], + "description": "RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed", + "homepage": "https://github.com/dg/rss-php", + "keywords": [ + "atom", + "feed", + "rss" + ], + "support": { + "source": "https://github.com/dg/rss-php/tree/v1.7" + }, + "install-path": "../dg/rss-php" + }, { "name": "dmitry-suffi/redis-session-handler", "version": "1.0.4", @@ -905,17 +960,17 @@ }, { "name": "doctrine/dbal", - "version": "4.4.4", - "version_normalized": "4.4.4.0", + "version": "4.5.0", + "version_normalized": "4.5.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "fb9e0ffe15e1590e24dc61c0c0a23f9a33ee42ce" + "reference": "c435cd7ea33e17d2a89288caf994cf3d4549b879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/fb9e0ffe15e1590e24dc61c0c0a23f9a33ee42ce", - "reference": "fb9e0ffe15e1590e24dc61c0c0a23f9a33ee42ce", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/c435cd7ea33e17d2a89288caf994cf3d4549b879", + "reference": "c435cd7ea33e17d2a89288caf994cf3d4549b879", "shasum": "" }, "require": { @@ -931,16 +986,16 @@ "phpstan/phpstan": "2.1.30", "phpstan/phpstan-phpunit": "2.0.7", "phpstan/phpstan-strict-rules": "^2", - "phpunit/phpunit": "11.5.50", - "slevomat/coding-standard": "8.27.1", - "squizlabs/php_codesniffer": "4.0.1", + "phpunit/phpunit": "11.5.56", + "slevomat/coding-standard": "8.31.1", + "squizlabs/php_codesniffer": "4.0.4", "symfony/cache": "^6.3.8|^7.0|^8.0", "symfony/console": "^5.4|^6.3|^7.0|^8.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." }, - "time": "2026-07-21T14:34:40+00:00", + "time": "2026-09-24T16:11:26+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -994,7 +1049,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/4.4.4" + "source": "https://github.com/doctrine/dbal/tree/4.5.0" }, "funding": [ { @@ -1158,17 +1213,17 @@ }, { "name": "doctrine/lexer", - "version": "3.0.2", - "version_normalized": "3.0.2.0", + "version": "3.0.3", + "version_normalized": "3.0.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e96fe45e92a54233726014a7cc7340abf29bb14c" + "reference": "71d305eaa6480d3d3460c7d053d1da7749fa9cca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e96fe45e92a54233726014a7cc7340abf29bb14c", - "reference": "e96fe45e92a54233726014a7cc7340abf29bb14c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/71d305eaa6480d3d3460c7d053d1da7749fa9cca", + "reference": "71d305eaa6480d3d3460c7d053d1da7749fa9cca", "shasum": "" }, "require": { @@ -1179,7 +1234,7 @@ "phpstan/phpstan": "^2", "phpunit/phpunit": "^10.5.58 || ^12.5.4" }, - "time": "2026-06-14T20:44:06+00:00", + "time": "2026-10-01T06:59:29+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1216,7 +1271,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.2" + "source": "https://github.com/doctrine/lexer/tree/3.0.3" }, "funding": [ { @@ -2019,8 +2074,8 @@ }, { "name": "illuminate/bus", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", @@ -2075,8 +2130,8 @@ }, { "name": "illuminate/cache", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/cache.git", @@ -2140,8 +2195,8 @@ }, { "name": "illuminate/collections", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", @@ -2203,8 +2258,8 @@ }, { "name": "illuminate/conditionable", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -2252,8 +2307,8 @@ }, { "name": "illuminate/config", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/config.git", @@ -2303,8 +2358,8 @@ }, { "name": "illuminate/console", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", @@ -2372,8 +2427,8 @@ }, { "name": "illuminate/container", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", @@ -2437,8 +2492,8 @@ }, { "name": "illuminate/contracts", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -2488,17 +2543,17 @@ }, { "name": "illuminate/database", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc" + "reference": "81bc26c9d40e8e5de3b5268d1465166db1ae7209" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/499f5112164d5bc4b744e0ac259b44e0a4c8aacc", - "reference": "499f5112164d5bc4b744e0ac259b44e0a4c8aacc", + "url": "https://api.github.com/repos/illuminate/database/zipball/81bc26c9d40e8e5de3b5268d1465166db1ae7209", + "reference": "81bc26c9d40e8e5de3b5268d1465166db1ae7209", "shasum": "" }, "require": { @@ -2525,7 +2580,7 @@ "illuminate/pagination": "Required to paginate the result set (^12.0).", "symfony/finder": "Required to use Eloquent model factories (^7.2)." }, - "time": "2026-09-06T21:11:25+00:00", + "time": "2026-09-17T21:16:04+00:00", "type": "library", "extra": { "branch-alias": { @@ -2564,8 +2619,8 @@ }, { "name": "illuminate/events", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", @@ -2622,17 +2677,17 @@ }, { "name": "illuminate/filesystem", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "dc0b7440f12753060b574fa8c20c2db259fa37c9" + "reference": "4e2bff4d2ac439db7a2903b8a99bc8dc5c8d5de4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/dc0b7440f12753060b574fa8c20c2db259fa37c9", - "reference": "dc0b7440f12753060b574fa8c20c2db259fa37c9", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/4e2bff4d2ac439db7a2903b8a99bc8dc5c8d5de4", + "reference": "4e2bff4d2ac439db7a2903b8a99bc8dc5c8d5de4", "shasum": "" }, "require": { @@ -2656,7 +2711,7 @@ "symfony/filesystem": "Required to enable support for relative symbolic links (^7.2).", "symfony/mime": "Required to enable support for guessing extensions (^7.2)." }, - "time": "2026-08-12T13:55:25+00:00", + "time": "2026-09-28T13:55:57+00:00", "type": "library", "extra": { "branch-alias": { @@ -2692,8 +2747,8 @@ }, { "name": "illuminate/http", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/http.git", @@ -2757,8 +2812,8 @@ }, { "name": "illuminate/log", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/log.git", @@ -2813,8 +2868,8 @@ }, { "name": "illuminate/macroable", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -2862,8 +2917,8 @@ }, { "name": "illuminate/pagination", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/pagination.git", @@ -2915,8 +2970,8 @@ }, { "name": "illuminate/pipeline", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", @@ -2970,17 +3025,17 @@ }, { "name": "illuminate/queue", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/queue.git", - "reference": "64171cef7be5f3ac660484de502e48c566b6feca" + "reference": "6d6d4da3c6a1bb02f6ac16e64eb3a22bb58c1c32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/queue/zipball/64171cef7be5f3ac660484de502e48c566b6feca", - "reference": "64171cef7be5f3ac660484de502e48c566b6feca", + "url": "https://api.github.com/repos/illuminate/queue/zipball/6d6d4da3c6a1bb02f6ac16e64eb3a22bb58c1c32", + "reference": "6d6d4da3c6a1bb02f6ac16e64eb3a22bb58c1c32", "shasum": "" }, "require": { @@ -3007,7 +3062,7 @@ "illuminate/redis": "Required to use the Redis queue driver (^12.0).", "pda/pheanstalk": "Required to use the Beanstalk queue driver (^5.0.6|^7.0.0)." }, - "time": "2026-07-11T15:13:30+00:00", + "time": "2026-09-17T18:39:21+00:00", "type": "library", "extra": { "branch-alias": { @@ -3040,8 +3095,8 @@ }, { "name": "illuminate/redis", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/redis.git", @@ -3097,8 +3152,8 @@ }, { "name": "illuminate/reflection", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/reflection.git", @@ -3151,17 +3206,17 @@ }, { "name": "illuminate/routing", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/routing.git", - "reference": "5d3cc9beca82c359f16e6c1d072903087e428ca1" + "reference": "50642c4215a5b3fd11e8e18dc4469aa989847a16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/routing/zipball/5d3cc9beca82c359f16e6c1d072903087e428ca1", - "reference": "5d3cc9beca82c359f16e6c1d072903087e428ca1", + "url": "https://api.github.com/repos/illuminate/routing/zipball/50642c4215a5b3fd11e8e18dc4469aa989847a16", + "reference": "50642c4215a5b3fd11e8e18dc4469aa989847a16", "shasum": "" }, "require": { @@ -3187,7 +3242,7 @@ "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.2)." }, - "time": "2026-08-05T14:58:10+00:00", + "time": "2026-09-28T20:31:58+00:00", "type": "library", "extra": { "branch-alias": { @@ -3220,8 +3275,8 @@ }, { "name": "illuminate/session", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/session.git", @@ -3280,17 +3335,17 @@ }, { "name": "illuminate/support", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "7d7a7d2dc5084aa4b1fd8b0a42094e1d3fb51e00" + "reference": "0ae65f419c69a3bb5f8100b9c5286354742e7ef8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/7d7a7d2dc5084aa4b1fd8b0a42094e1d3fb51e00", - "reference": "7d7a7d2dc5084aa4b1fd8b0a42094e1d3fb51e00", + "url": "https://api.github.com/repos/illuminate/support/zipball/0ae65f419c69a3bb5f8100b9c5286354742e7ef8", + "reference": "0ae65f419c69a3bb5f8100b9c5286354742e7ef8", "shasum": "" }, "require": { @@ -3326,7 +3381,7 @@ "symfony/var-dumper": "Required to use the dd function (^7.2).", "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.6.1)." }, - "time": "2026-08-06T14:28:07+00:00", + "time": "2026-09-28T00:20:42+00:00", "type": "library", "extra": { "branch-alias": { @@ -3363,17 +3418,17 @@ }, { "name": "illuminate/translation", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/translation.git", - "reference": "4b555f3ca37523d1064d08e99774ab32fd0cc228" + "reference": "431ac000adf17a024d6ef3a8131c3c1fa950459f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/translation/zipball/4b555f3ca37523d1064d08e99774ab32fd0cc228", - "reference": "4b555f3ca37523d1064d08e99774ab32fd0cc228", + "url": "https://api.github.com/repos/illuminate/translation/zipball/431ac000adf17a024d6ef3a8131c3c1fa950459f", + "reference": "431ac000adf17a024d6ef3a8131c3c1fa950459f", "shasum": "" }, "require": { @@ -3384,7 +3439,7 @@ "illuminate/support": "^12.0", "php": "^8.2" }, - "time": "2026-03-18T14:19:27+00:00", + "time": "2026-09-23T13:45:03+00:00", "type": "library", "extra": { "branch-alias": { @@ -3417,8 +3472,8 @@ }, { "name": "illuminate/validation", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/validation.git", @@ -3483,8 +3538,8 @@ }, { "name": "illuminate/view", - "version": "v12.69.2", - "version_normalized": "12.69.2.0", + "version": "v12.69.3", + "version_normalized": "12.69.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", @@ -3600,17 +3655,17 @@ }, { "name": "justinrainbow/json-schema", - "version": "6.12.0", - "version_normalized": "6.12.0.0", + "version": "6.13.1", + "version_normalized": "6.13.1.0", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "8ef236a1a37df364b518b7411a4b5bb95b040d79" + "reference": "e54aacc4c0657b3a4af4f628428d2702146828c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/8ef236a1a37df364b518b7411a4b5bb95b040d79", - "reference": "8ef236a1a37df364b518b7411a4b5bb95b040d79", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/e54aacc4c0657b3a4af4f628428d2702146828c6", + "reference": "e54aacc4c0657b3a4af4f628428d2702146828c6", "shasum": "" }, "require": { @@ -3627,7 +3682,7 @@ "phpstan/phpstan": "^1.12", "phpunit/phpunit": "^8.5" }, - "time": "2026-09-04T12:54:20+00:00", + "time": "2026-09-30T07:42:28+00:00", "bin": [ "bin/validate-json" ], @@ -3662,23 +3717,23 @@ ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/6.12.0" + "source": "https://github.com/jsonrainbow/json-schema/tree/6.13.1" }, "install-path": "../justinrainbow/json-schema" }, { "name": "laravel/prompts", - "version": "v0.3.24", - "version_normalized": "0.3.24.0", + "version": "v0.3.25", + "version_normalized": "0.3.25.0", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b" + "reference": "21b7b49d60fcb700016dd27b582ae739c75de816" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/5d3cdef29e93ca3b62b1871359db3078cd99908b", - "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b", + "url": "https://api.github.com/repos/laravel/prompts/zipball/21b7b49d60fcb700016dd27b582ae739c75de816", + "reference": "21b7b49d60fcb700016dd27b582ae739c75de816", "shasum": "" }, "require": { @@ -3701,7 +3756,7 @@ "suggest": { "ext-pcntl": "Required for the spinner to be animated." }, - "time": "2026-08-20T12:55:36+00:00", + "time": "2026-10-06T02:25:49+00:00", "type": "library", "extra": { "branch-alias": { @@ -3723,24 +3778,23 @@ ], "description": "Add beautiful and user-friendly forms to your command-line applications.", "support": { - "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.3.24" + "source": "https://github.com/laravel/prompts/tree/v0.3.25" }, "install-path": "../laravel/prompts" }, { "name": "laravel/serializable-closure", - "version": "v2.0.16", - "version_normalized": "2.0.16.0", + "version": "v2.1.0", + "version_normalized": "2.1.0.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed" + "reference": "2d5869a838bbcf37e0d8b0568fc41914e81374b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", - "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/2d5869a838bbcf37e0d8b0568fc41914e81374b5", + "reference": "2d5869a838bbcf37e0d8b0568fc41914e81374b5", "shasum": "" }, "require": { @@ -3753,7 +3807,7 @@ "phpstan/phpstan": "^2.0", "symfony/var-dumper": "^6.2.0|^7.0.0|^8.0.0" }, - "time": "2026-08-18T20:28:54+00:00", + "time": "2026-09-22T14:32:34+00:00", "type": "library", "extra": { "branch-alias": { @@ -4067,17 +4121,17 @@ }, { "name": "monolog/monolog", - "version": "3.12.0", - "version_normalized": "3.12.0.0", + "version": "3.12.1", + "version_normalized": "3.12.1.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "72c534fc0ab181ef52d92a68382318631e301608" + "reference": "d7059e4c691d05ea1222b5124bed0f961be46e15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/72c534fc0ab181ef52d92a68382318631e301608", - "reference": "72c534fc0ab181ef52d92a68382318631e301608", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/d7059e4c691d05ea1222b5124bed0f961be46e15", + "reference": "d7059e4c691d05ea1222b5124bed0f961be46e15", "shasum": "" }, "require": { @@ -4126,7 +4180,7 @@ "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, - "time": "2026-09-09T08:34:20+00:00", + "time": "2026-09-29T19:21:12+00:00", "type": "library", "extra": { "branch-alias": { @@ -4159,7 +4213,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.12.0" + "source": "https://github.com/Seldaek/monolog/tree/3.12.1" }, "funding": [ { @@ -4175,17 +4229,17 @@ }, { "name": "nesbot/carbon", - "version": "3.14.0", - "version_normalized": "3.14.0.0", + "version": "3.14.2", + "version_normalized": "3.14.2.0", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "0023eaa2c9110e47446dd512a263c69c40cd41f2" + "reference": "94cfc34887f07ab5c0efa07914c8f527544e3224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/0023eaa2c9110e47446dd512a263c69c40cd41f2", - "reference": "0023eaa2c9110e47446dd512a263c69c40cd41f2", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/94cfc34887f07ab5c0efa07914c8f527544e3224", + "reference": "94cfc34887f07ab5c0efa07914c8f527544e3224", "shasum": "" }, "require": { @@ -4205,13 +4259,13 @@ "doctrine/orm": "^2.15.2 || ^3.0", "friendsofphp/php-cs-fixer": "^v3.87.1", "kylekatarnls/multi-tester": "^2.5.3", - "phpmd/phpmd": "^2.15.0", + "phpmd/phpmd": "^3.0@dev", "phpstan/extension-installer": "^1.4.3", "phpstan/phpstan": "^2.1.22", "phpunit/phpunit": "^10.5.53", "squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0" }, - "time": "2026-09-12T20:45:19+00:00", + "time": "2026-10-02T07:26:52+00:00", "bin": [ "bin/carbon" ], @@ -5858,17 +5912,17 @@ }, { "name": "secondnetwork/blade-tabler-icons", - "version": "v3.46.0", - "version_normalized": "3.46.0.0", + "version": "v3.49.0", + "version_normalized": "3.49.0.0", "source": { "type": "git", "url": "https://github.com/secondnetwork/blade-tabler-icons.git", - "reference": "aedaebc18f382a9d0a1870e9ad394c5c89abd72b" + "reference": "d219634a7948627ebf861012ca798573c2ad2aa3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/secondnetwork/blade-tabler-icons/zipball/aedaebc18f382a9d0a1870e9ad394c5c89abd72b", - "reference": "aedaebc18f382a9d0a1870e9ad394c5c89abd72b", + "url": "https://api.github.com/repos/secondnetwork/blade-tabler-icons/zipball/d219634a7948627ebf861012ca798573c2ad2aa3", + "reference": "d219634a7948627ebf861012ca798573c2ad2aa3", "shasum": "" }, "require": { @@ -5880,7 +5934,7 @@ "orchestra/testbench": "^6.0|^7.0|^9.0|^10.0", "phpunit/phpunit": "^9.0|^10.0|^11.0|^12.0" }, - "time": "2026-07-30T13:49:44+00:00", + "time": "2026-10-06T09:09:30+00:00", "type": "library", "extra": { "laravel": { @@ -5913,7 +5967,7 @@ ], "support": { "issues": "https://github.com/secondnetwork/blade-tabler-icons/issues", - "source": "https://github.com/secondnetwork/blade-tabler-icons/tree/v3.46.0" + "source": "https://github.com/secondnetwork/blade-tabler-icons/tree/v3.49.0" }, "install-path": "../secondnetwork/blade-tabler-icons" }, @@ -5986,23 +6040,23 @@ }, { "name": "seld/phar-utils", - "version": "1.2.2", - "version_normalized": "1.2.2.0", + "version": "1.2.3", + "version_normalized": "1.2.3.0", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "990bbd0e92caa216d52eca0935f6e35e589bfaa5" + "reference": "65fb381613fd31745d39a740a112a233f978d2d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/990bbd0e92caa216d52eca0935f6e35e589bfaa5", - "reference": "990bbd0e92caa216d52eca0935f6e35e589bfaa5", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/65fb381613fd31745d39a740a112a233f978d2d9", + "reference": "65fb381613fd31745d39a740a112a233f978d2d9", "shasum": "" }, "require": { "php": ">=5.3" }, - "time": "2026-08-01T12:48:55+00:00", + "time": "2026-10-01T08:16:23+00:00", "type": "library", "extra": { "branch-alias": { @@ -6031,7 +6085,7 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.2.2" + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.3" }, "install-path": "../seld/phar-utils" }, @@ -6099,90 +6153,6 @@ }, "install-path": "../seld/signal-handler" }, - { - "name": "simplepie/simplepie", - "version": "1.9.0", - "version_normalized": "1.9.0.0", - "source": { - "type": "git", - "url": "https://github.com/simplepie/simplepie.git", - "reference": "76cccb1b2c5dcaf44f304c925ab30c0f48643992" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/simplepie/simplepie/zipball/76cccb1b2c5dcaf44f304c925ab30c0f48643992", - "reference": "76cccb1b2c5dcaf44f304c925ab30c0f48643992", - "shasum": "" - }, - "require": { - "ext-pcre": "*", - "ext-xml": "*", - "ext-xmlreader": "*", - "php": ">=7.2.0" - }, - "require-dev": { - "donatj/mock-webserver": "^2.7", - "friendsofphp/php-cs-fixer": "^2.19 || ^3.8", - "mf2/mf2": "^0.5.0", - "phpstan/phpstan": "~1.12.2", - "phpunit/phpunit": "^8 || ^9 || ^10", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/simple-cache": "^1 || ^2 || ^3" - }, - "suggest": { - "ext-curl": "", - "ext-iconv": "", - "ext-intl": "", - "ext-mbstring": "", - "mf2/mf2": "Microformat module that allows for parsing HTML for microformats" - }, - "time": "2025-09-12T06:34:27+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "SimplePie": "library" - }, - "psr-4": { - "SimplePie\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ryan Parman", - "homepage": "http://ryanparman.com/", - "role": "Creator, alumnus developer" - }, - { - "name": "Sam Sneddon", - "homepage": "https://gsnedders.com/", - "role": "Alumnus developer" - }, - { - "name": "Ryan McCue", - "email": "me@ryanmccue.info", - "homepage": "http://ryanmccue.info/", - "role": "Developer" - } - ], - "description": "A simple Atom/RSS parsing library for PHP", - "homepage": "http://simplepie.org/", - "keywords": [ - "atom", - "feeds", - "rss" - ], - "support": { - "issues": "https://github.com/simplepie/simplepie/issues", - "source": "https://github.com/simplepie/simplepie/tree/1.9.0" - }, - "install-path": "../simplepie/simplepie" - }, { "name": "symfony/clock", "version": "v7.4.8", @@ -6266,17 +6236,17 @@ }, { "name": "symfony/console", - "version": "v7.4.19", - "version_normalized": "7.4.19.0", + "version": "v7.4.20", + "version_normalized": "7.4.20.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3a1973458b153f566a8d7499bc06ece323d60063" + "reference": "d7bca2fe05241dc7732d0c8b6d551b879f5d0a7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3a1973458b153f566a8d7499bc06ece323d60063", - "reference": "3a1973458b153f566a8d7499bc06ece323d60063", + "url": "https://api.github.com/repos/symfony/console/zipball/d7bca2fe05241dc7732d0c8b6d551b879f5d0a7d", + "reference": "d7bca2fe05241dc7732d0c8b6d551b879f5d0a7d", "shasum": "" }, "require": { @@ -6309,7 +6279,7 @@ "symfony/stopwatch": "^6.4|^7.0|^8.0", "symfony/var-dumper": "^6.4|^7.0|^8.0" }, - "time": "2026-09-13T10:38:41+00:00", + "time": "2026-09-18T15:55:00+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6343,7 +6313,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.19" + "source": "https://github.com/symfony/console/tree/v7.4.20" }, "funding": [ { @@ -6441,17 +6411,17 @@ }, { "name": "symfony/error-handler", - "version": "v7.4.17", - "version_normalized": "7.4.17.0", + "version": "v7.4.20", + "version_normalized": "7.4.20.0", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "8373921e231e190a88e2ad526951bbaa791576fa" + "reference": "82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/8373921e231e190a88e2ad526951bbaa791576fa", - "reference": "8373921e231e190a88e2ad526951bbaa791576fa", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0", + "reference": "82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0", "shasum": "" }, "require": { @@ -6471,7 +6441,7 @@ "symfony/serializer": "^6.4|^7.0|^8.0", "symfony/webpack-encore-bundle": "^1.0|^2.0" }, - "time": "2026-08-21T17:40:08+00:00", + "time": "2026-09-22T18:56:40+00:00", "bin": [ "Resources/bin/patch-type-declarations" ], @@ -6502,7 +6472,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v7.4.17" + "source": "https://github.com/symfony/error-handler/tree/v7.4.20" }, "funding": [ { @@ -6770,17 +6740,17 @@ }, { "name": "symfony/finder", - "version": "v7.4.19", - "version_normalized": "7.4.19.0", + "version": "v7.4.20", + "version_normalized": "7.4.20.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "1b900bc6ae5ba60c5eee69c11ba44566190576fe" + "reference": "2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/1b900bc6ae5ba60c5eee69c11ba44566190576fe", - "reference": "1b900bc6ae5ba60c5eee69c11ba44566190576fe", + "url": "https://api.github.com/repos/symfony/finder/zipball/2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e", + "reference": "2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e", "shasum": "" }, "require": { @@ -6789,7 +6759,7 @@ "require-dev": { "symfony/filesystem": "^6.4|^7.0|^8.0" }, - "time": "2026-09-10T19:14:10+00:00", + "time": "2026-09-26T06:31:10+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6817,7 +6787,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.4.19" + "source": "https://github.com/symfony/finder/tree/v7.4.20" }, "funding": [ { @@ -6841,17 +6811,17 @@ }, { "name": "symfony/http-foundation", - "version": "v7.4.19", - "version_normalized": "7.4.19.0", + "version": "v7.4.20", + "version_normalized": "7.4.20.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "f7b953be7801974a5a0685e1228bbc3b12b35936" + "reference": "9d0761c0da6bd5b801b401666834901a9a1ffc33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/f7b953be7801974a5a0685e1228bbc3b12b35936", - "reference": "f7b953be7801974a5a0685e1228bbc3b12b35936", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9d0761c0da6bd5b801b401666834901a9a1ffc33", + "reference": "9d0761c0da6bd5b801b401666834901a9a1ffc33", "shasum": "" }, "require": { @@ -6874,7 +6844,7 @@ "symfony/mime": "^6.4|^7.0|^8.0", "symfony/rate-limiter": "^6.4|^7.0|^8.0" }, - "time": "2026-09-14T17:41:17+00:00", + "time": "2026-09-24T07:12:44+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6902,7 +6872,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.4.19" + "source": "https://github.com/symfony/http-foundation/tree/v7.4.20" }, "funding": [ { @@ -6926,17 +6896,17 @@ }, { "name": "symfony/http-kernel", - "version": "v7.4.19", - "version_normalized": "7.4.19.0", + "version": "v7.4.20", + "version_normalized": "7.4.20.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "683507424cc84ca85ac1551adb609b6b98216667" + "reference": "392784b5d7b959b8d872542a2530c50c540a788f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/683507424cc84ca85ac1551adb609b6b98216667", - "reference": "683507424cc84ca85ac1551adb609b6b98216667", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/392784b5d7b959b8d872542a2530c50c540a788f", + "reference": "392784b5d7b959b8d872542a2530c50c540a788f", "shasum": "" }, "require": { @@ -6996,7 +6966,7 @@ "symfony/var-exporter": "^6.4|^7.0|^8.0", "twig/twig": "^3.12|^4.0" }, - "time": "2026-09-15T07:09:35+00:00", + "time": "2026-09-29T14:05:16+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7024,7 +6994,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.4.19" + "source": "https://github.com/symfony/http-kernel/tree/v7.4.20" }, "funding": [ { @@ -7226,17 +7196,17 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.41.0", - "version_normalized": "1.41.0.0", + "version": "v1.43.0", + "version_normalized": "1.43.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d" + "reference": "5cac8f4db97208823aa353f59a01faad2da52c75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", - "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5cac8f4db97208823aa353f59a01faad2da52c75", + "reference": "5cac8f4db97208823aa353f59a01faad2da52c75", "shasum": "" }, "require": { @@ -7245,7 +7215,7 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2026-07-28T08:25:59+00:00", + "time": "2026-09-25T15:46:47+00:00", "type": "library", "extra": { "thanks": { @@ -7287,7 +7257,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.41.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.43.0" }, "funding": [ { @@ -7311,17 +7281,17 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.42.0", - "version_normalized": "1.42.0.0", + "version": "v1.43.0", + "version_normalized": "1.43.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9" + "reference": "533d68cf99c8f8ee2e8893c59ed59192e92cfd74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/51b5ff5ba85452b31ec6f55490b08148612339d9", - "reference": "51b5ff5ba85452b31ec6f55490b08148612339d9", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/533d68cf99c8f8ee2e8893c59ed59192e92cfd74", + "reference": "533d68cf99c8f8ee2e8893c59ed59192e92cfd74", "shasum": "" }, "require": { @@ -7331,7 +7301,7 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2026-08-24T10:51:20+00:00", + "time": "2026-09-23T14:40:04+00:00", "type": "library", "extra": { "thanks": { @@ -7377,7 +7347,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.42.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.43.0" }, "funding": [ { @@ -7401,17 +7371,17 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.42.0", - "version_normalized": "1.42.0.0", + "version": "v1.43.0", + "version_normalized": "1.43.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502" + "reference": "ebd57ccc7edb93d632e184efbe7693d2517bab3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/aa20edea75bd9c48cfecc8360922e5a6e5c44502", - "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/ebd57ccc7edb93d632e184efbe7693d2517bab3b", + "reference": "ebd57ccc7edb93d632e184efbe7693d2517bab3b", "shasum": "" }, "require": { @@ -7420,7 +7390,7 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2026-08-07T06:33:24+00:00", + "time": "2026-09-23T22:02:09+00:00", "type": "library", "extra": { "thanks": { @@ -7465,7 +7435,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.42.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.43.0" }, "funding": [ { @@ -7489,17 +7459,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.38.2", - "version_normalized": "1.38.2.0", + "version": "v1.43.0", + "version_normalized": "1.43.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6" + "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", - "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", + "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", "shasum": "" }, "require": { @@ -7512,7 +7482,7 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2026-05-27T06:59:30+00:00", + "time": "2026-09-24T15:19:04+00:00", "type": "library", "extra": { "thanks": { @@ -7553,7 +7523,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.43.0" }, "funding": [ { @@ -7577,23 +7547,23 @@ }, { "name": "symfony/polyfill-php84", - "version": "v1.38.1", - "version_normalized": "1.38.1.0", + "version": "v1.43.0", + "version_normalized": "1.43.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php84.git", - "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa" + "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", - "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/22c6548499cbe5c5bb072fc0c42312dff062a015", + "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015", "shasum": "" }, "require": { "php": ">=7.2" }, - "time": "2026-05-26T12:51:13+00:00", + "time": "2026-09-23T22:01:09+00:00", "type": "library", "extra": { "thanks": { @@ -7636,7 +7606,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php84/tree/v1.38.1" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.43.0" }, "funding": [ { @@ -7660,23 +7630,23 @@ }, { "name": "symfony/polyfill-php85", - "version": "v1.41.0", - "version_normalized": "1.41.0.0", + "version": "v1.43.0", + "version_normalized": "1.43.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php85.git", - "reference": "255fab485aaa1006ed411040c42aecd7b5302d7a" + "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/255fab485aaa1006ed411040c42aecd7b5302d7a", - "reference": "255fab485aaa1006ed411040c42aecd7b5302d7a", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/86a42cbcc07adc331481a5ab310a4024bfc227f6", + "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6", "shasum": "" }, "require": { "php": ">=7.2" }, - "time": "2026-07-01T12:47:55+00:00", + "time": "2026-09-25T15:46:47+00:00", "type": "library", "extra": { "thanks": { @@ -7719,7 +7689,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php85/tree/v1.41.0" + "source": "https://github.com/symfony/polyfill-php85/tree/v1.43.0" }, "funding": [ { @@ -7811,17 +7781,17 @@ }, { "name": "symfony/routing", - "version": "v7.4.18", - "version_normalized": "7.4.18.0", + "version": "v7.4.20", + "version_normalized": "7.4.20.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3" + "reference": "2bacb72be5eadeaf9874d5accb75bfb33d21c74b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/ddd558991e98f693ae6bf5063cc1b0362c6bbec3", - "reference": "ddd558991e98f693ae6bf5063cc1b0362c6bbec3", + "url": "https://api.github.com/repos/symfony/routing/zipball/2bacb72be5eadeaf9874d5accb75bfb33d21c74b", + "reference": "2bacb72be5eadeaf9874d5accb75bfb33d21c74b", "shasum": "" }, "require": { @@ -7841,7 +7811,7 @@ "symfony/http-foundation": "^6.4|^7.0|^8.0", "symfony/yaml": "^6.4|^7.0|^8.0" }, - "time": "2026-08-17T13:12:36+00:00", + "time": "2026-09-28T19:09:50+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7875,7 +7845,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.4.18" + "source": "https://github.com/symfony/routing/tree/v7.4.20" }, "funding": [ { diff --git a/core/vendor/composer/installed.php b/core/vendor/composer/installed.php index 47c0ba5217..4e2fb6fd4d 100644 --- a/core/vendor/composer/installed.php +++ b/core/vendor/composer/installed.php @@ -47,9 +47,9 @@ 'dev_requirement' => false, ), 'composer/class-map-generator' => array( - 'pretty_version' => '1.7.3', - 'version' => '1.7.3.0', - 'reference' => '86d8208fc3c649a3a999daf1a63c25201be2990f', + 'pretty_version' => '1.8.0', + 'version' => '1.8.0.0', + 'reference' => 'c0efbeb2f3fd7e23c7f180a59765c0b48a31fbc4', 'type' => 'library', 'install_path' => __DIR__ . '/./class-map-generator', 'aliases' => array(), @@ -83,9 +83,9 @@ 'dev_requirement' => false, ), 'composer/semver' => array( - 'pretty_version' => '3.4.4', - 'version' => '3.4.4.0', - 'reference' => '198166618906cb2de69b95d7d47e5fa8aa1b2b95', + 'pretty_version' => '3.5.1', + 'version' => '3.5.1.0', + 'reference' => '528948210cc46f967a4b98e83b19e76f2b504993', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), @@ -109,6 +109,15 @@ 'aliases' => array(), 'dev_requirement' => false, ), + 'dg/rss-php' => array( + 'pretty_version' => 'v1.7', + 'version' => '1.7.0.0', + 'reference' => 'bf5ab497046f9979a3a210104f7c73ce86bf68fe', + 'type' => 'library', + 'install_path' => __DIR__ . '/../dg/rss-php', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'dmitry-suffi/redis-session-handler' => array( 'pretty_version' => '1.0.4', 'version' => '1.0.4.0', @@ -119,9 +128,9 @@ 'dev_requirement' => false, ), 'doctrine/dbal' => array( - 'pretty_version' => '4.4.4', - 'version' => '4.4.4.0', - 'reference' => 'fb9e0ffe15e1590e24dc61c0c0a23f9a33ee42ce', + 'pretty_version' => '4.5.0', + 'version' => '4.5.0.0', + 'reference' => 'c435cd7ea33e17d2a89288caf994cf3d4549b879', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/dbal', 'aliases' => array(), @@ -146,9 +155,9 @@ 'dev_requirement' => false, ), 'doctrine/lexer' => array( - 'pretty_version' => '3.0.2', - 'version' => '3.0.2.0', - 'reference' => 'e96fe45e92a54233726014a7cc7340abf29bb14c', + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'reference' => '71d305eaa6480d3d3460c7d053d1da7749fa9cca', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/lexer', 'aliases' => array(), @@ -254,8 +263,8 @@ 'dev_requirement' => false, ), 'illuminate/bus' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '9e70f409c744e0ba6b301fa608bb5b3c8c38669a', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/bus', @@ -263,8 +272,8 @@ 'dev_requirement' => false, ), 'illuminate/cache' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '2689356ab45bc53ffe796d1b1241babae59c69f6', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/cache', @@ -272,8 +281,8 @@ 'dev_requirement' => false, ), 'illuminate/collections' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '83313b009c4afb6f02dbc090bdb67809756eefa2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/collections', @@ -281,8 +290,8 @@ 'dev_requirement' => false, ), 'illuminate/conditionable' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => 'ec677967c1f2faf90b8428919124d2184a4c9b49', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/conditionable', @@ -290,8 +299,8 @@ 'dev_requirement' => false, ), 'illuminate/config' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '7adbf5cc27081d4613e1fa2f4f53e2a4fc91ad53', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/config', @@ -299,8 +308,8 @@ 'dev_requirement' => false, ), 'illuminate/console' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '29f41bd7e07c14c04cb5acfaf9dc103adf2084aa', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/console', @@ -308,8 +317,8 @@ 'dev_requirement' => false, ), 'illuminate/container' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '9abe9dba6b3f5220205ce143069c975a601e4294', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', @@ -317,8 +326,8 @@ 'dev_requirement' => false, ), 'illuminate/contracts' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => 'c16fd7ba7d8e6b8f336639ceb6b7e1ff6ed0efb5', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', @@ -326,17 +335,17 @@ 'dev_requirement' => false, ), 'illuminate/database' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', - 'reference' => '499f5112164d5bc4b744e0ac259b44e0a4c8aacc', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', + 'reference' => '81bc26c9d40e8e5de3b5268d1465166db1ae7209', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/database', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/events' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => 'ff22aa6017bdbd90ace660f50638ed9c580ba555', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/events', @@ -344,17 +353,17 @@ 'dev_requirement' => false, ), 'illuminate/filesystem' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', - 'reference' => 'dc0b7440f12753060b574fa8c20c2db259fa37c9', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', + 'reference' => '4e2bff4d2ac439db7a2903b8a99bc8dc5c8d5de4', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/filesystem', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/http' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => 'a91f70083082bd6d466ea229dbbdfc48c553621c', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/http', @@ -362,8 +371,8 @@ 'dev_requirement' => false, ), 'illuminate/log' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '0309c15e63d07c05218b622caa514f3ed6b226a6', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/log', @@ -371,8 +380,8 @@ 'dev_requirement' => false, ), 'illuminate/macroable' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => 'e295d62d89dcdb87e2b1bd70dd14d074a0ed73cc', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/macroable', @@ -380,8 +389,8 @@ 'dev_requirement' => false, ), 'illuminate/pagination' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '8327d828676654053906a771abf5eea5426354ec', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pagination', @@ -389,8 +398,8 @@ 'dev_requirement' => false, ), 'illuminate/pipeline' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => 'b6a14c20d69a44bf0a6fba664a00d23ca71770ee', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pipeline', @@ -398,17 +407,17 @@ 'dev_requirement' => false, ), 'illuminate/queue' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', - 'reference' => '64171cef7be5f3ac660484de502e48c566b6feca', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', + 'reference' => '6d6d4da3c6a1bb02f6ac16e64eb3a22bb58c1c32', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/queue', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/redis' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => 'e46d4c3806d78d4d7733cd9b9bfb2fef30f4c8cb', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/redis', @@ -416,8 +425,8 @@ 'dev_requirement' => false, ), 'illuminate/reflection' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '348cf5da9de89b596d7723be6425fb048e2bf4bb', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/reflection', @@ -425,17 +434,17 @@ 'dev_requirement' => false, ), 'illuminate/routing' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', - 'reference' => '5d3cc9beca82c359f16e6c1d072903087e428ca1', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', + 'reference' => '50642c4215a5b3fd11e8e18dc4469aa989847a16', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/routing', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/session' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '98802e67dd5e059c0b978b3fe8f5f0a3ac17ec4e', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/session', @@ -443,26 +452,26 @@ 'dev_requirement' => false, ), 'illuminate/support' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', - 'reference' => '7d7a7d2dc5084aa4b1fd8b0a42094e1d3fb51e00', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', + 'reference' => '0ae65f419c69a3bb5f8100b9c5286354742e7ef8', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/support', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/translation' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', - 'reference' => '4b555f3ca37523d1064d08e99774ab32fd0cc228', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', + 'reference' => '431ac000adf17a024d6ef3a8131c3c1fa950459f', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/translation', 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/validation' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => 'ce2bb8d019e2510d1892b0c87f9086ea802c28e4', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/validation', @@ -470,8 +479,8 @@ 'dev_requirement' => false, ), 'illuminate/view' => array( - 'pretty_version' => 'v12.69.2', - 'version' => '12.69.2.0', + 'pretty_version' => 'v12.69.3', + 'version' => '12.69.3.0', 'reference' => '83bf8a22bb61145bcc1b8912103f6fb85078e35c', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/view', @@ -488,27 +497,27 @@ 'dev_requirement' => false, ), 'justinrainbow/json-schema' => array( - 'pretty_version' => '6.12.0', - 'version' => '6.12.0.0', - 'reference' => '8ef236a1a37df364b518b7411a4b5bb95b040d79', + 'pretty_version' => '6.13.1', + 'version' => '6.13.1.0', + 'reference' => 'e54aacc4c0657b3a4af4f628428d2702146828c6', 'type' => 'library', 'install_path' => __DIR__ . '/../justinrainbow/json-schema', 'aliases' => array(), 'dev_requirement' => false, ), 'laravel/prompts' => array( - 'pretty_version' => 'v0.3.24', - 'version' => '0.3.24.0', - 'reference' => '5d3cdef29e93ca3b62b1871359db3078cd99908b', + 'pretty_version' => 'v0.3.25', + 'version' => '0.3.25.0', + 'reference' => '21b7b49d60fcb700016dd27b582ae739c75de816', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/prompts', 'aliases' => array(), 'dev_requirement' => false, ), 'laravel/serializable-closure' => array( - 'pretty_version' => 'v2.0.16', - 'version' => '2.0.16.0', - 'reference' => '7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed', + 'pretty_version' => 'v2.1.0', + 'version' => '2.1.0.0', + 'reference' => '2d5869a838bbcf37e0d8b0568fc41914e81374b5', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/serializable-closure', 'aliases' => array(), @@ -551,9 +560,9 @@ 'dev_requirement' => false, ), 'monolog/monolog' => array( - 'pretty_version' => '3.12.0', - 'version' => '3.12.0.0', - 'reference' => '72c534fc0ab181ef52d92a68382318631e301608', + 'pretty_version' => '3.12.1', + 'version' => '3.12.1.0', + 'reference' => 'd7059e4c691d05ea1222b5124bed0f961be46e15', 'type' => 'library', 'install_path' => __DIR__ . '/../monolog/monolog', 'aliases' => array(), @@ -566,9 +575,9 @@ ), ), 'nesbot/carbon' => array( - 'pretty_version' => '3.14.0', - 'version' => '3.14.0.0', - 'reference' => '0023eaa2c9110e47446dd512a263c69c40cd41f2', + 'pretty_version' => '3.14.2', + 'version' => '3.14.2.0', + 'reference' => '94cfc34887f07ab5c0efa07914c8f527544e3224', 'type' => 'library', 'install_path' => __DIR__ . '/../nesbot/carbon', 'aliases' => array(), @@ -837,9 +846,9 @@ 'dev_requirement' => false, ), 'secondnetwork/blade-tabler-icons' => array( - 'pretty_version' => 'v3.46.0', - 'version' => '3.46.0.0', - 'reference' => 'aedaebc18f382a9d0a1870e9ad394c5c89abd72b', + 'pretty_version' => 'v3.49.0', + 'version' => '3.49.0.0', + 'reference' => 'd219634a7948627ebf861012ca798573c2ad2aa3', 'type' => 'library', 'install_path' => __DIR__ . '/../secondnetwork/blade-tabler-icons', 'aliases' => array(), @@ -855,9 +864,9 @@ 'dev_requirement' => false, ), 'seld/phar-utils' => array( - 'pretty_version' => '1.2.2', - 'version' => '1.2.2.0', - 'reference' => '990bbd0e92caa216d52eca0935f6e35e589bfaa5', + 'pretty_version' => '1.2.3', + 'version' => '1.2.3.0', + 'reference' => '65fb381613fd31745d39a740a112a233f978d2d9', 'type' => 'library', 'install_path' => __DIR__ . '/../seld/phar-utils', 'aliases' => array(), @@ -872,15 +881,6 @@ 'aliases' => array(), 'dev_requirement' => false, ), - 'simplepie/simplepie' => array( - 'pretty_version' => '1.9.0', - 'version' => '1.9.0.0', - 'reference' => '76cccb1b2c5dcaf44f304c925ab30c0f48643992', - 'type' => 'library', - 'install_path' => __DIR__ . '/../simplepie/simplepie', - 'aliases' => array(), - 'dev_requirement' => false, - ), 'spatie/once' => array( 'dev_requirement' => false, 'replaced' => array( @@ -897,9 +897,9 @@ 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v7.4.19', - 'version' => '7.4.19.0', - 'reference' => '3a1973458b153f566a8d7499bc06ece323d60063', + 'pretty_version' => 'v7.4.20', + 'version' => '7.4.20.0', + 'reference' => 'd7bca2fe05241dc7732d0c8b6d551b879f5d0a7d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), @@ -915,9 +915,9 @@ 'dev_requirement' => false, ), 'symfony/error-handler' => array( - 'pretty_version' => 'v7.4.17', - 'version' => '7.4.17.0', - 'reference' => '8373921e231e190a88e2ad526951bbaa791576fa', + 'pretty_version' => 'v7.4.20', + 'version' => '7.4.20.0', + 'reference' => '82239fe00f7cdc9f17c4166fff4ebdc22bd26ec0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/error-handler', 'aliases' => array(), @@ -957,27 +957,27 @@ 'dev_requirement' => false, ), 'symfony/finder' => array( - 'pretty_version' => 'v7.4.19', - 'version' => '7.4.19.0', - 'reference' => '1b900bc6ae5ba60c5eee69c11ba44566190576fe', + 'pretty_version' => 'v7.4.20', + 'version' => '7.4.20.0', + 'reference' => '2dd31e5208db7a0fda7bfc998ad727b79c2e4d1e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/http-foundation' => array( - 'pretty_version' => 'v7.4.19', - 'version' => '7.4.19.0', - 'reference' => 'f7b953be7801974a5a0685e1228bbc3b12b35936', + 'pretty_version' => 'v7.4.20', + 'version' => '7.4.20.0', + 'reference' => '9d0761c0da6bd5b801b401666834901a9a1ffc33', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-foundation', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/http-kernel' => array( - 'pretty_version' => 'v7.4.19', - 'version' => '7.4.19.0', - 'reference' => '683507424cc84ca85ac1551adb609b6b98216667', + 'pretty_version' => 'v7.4.20', + 'version' => '7.4.20.0', + 'reference' => '392784b5d7b959b8d872542a2530c50c540a788f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-kernel', 'aliases' => array(), @@ -1002,36 +1002,36 @@ 'dev_requirement' => false, ), 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.41.0', - 'version' => '1.41.0.0', - 'reference' => 'bb899c1db0aa8127dc3afe8cda4a67eb24915f8d', + 'pretty_version' => 'v1.43.0', + 'version' => '1.43.0.0', + 'reference' => '5cac8f4db97208823aa353f59a01faad2da52c75', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.42.0', - 'version' => '1.42.0.0', - 'reference' => '51b5ff5ba85452b31ec6f55490b08148612339d9', + 'pretty_version' => 'v1.43.0', + 'version' => '1.43.0.0', + 'reference' => '533d68cf99c8f8ee2e8893c59ed59192e92cfd74', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.42.0', - 'version' => '1.42.0.0', - 'reference' => 'aa20edea75bd9c48cfecc8360922e5a6e5c44502', + 'pretty_version' => 'v1.43.0', + 'version' => '1.43.0.0', + 'reference' => 'ebd57ccc7edb93d632e184efbe7693d2517bab3b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.38.2', - 'version' => '1.38.2.0', - 'reference' => 'd3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6', + 'pretty_version' => 'v1.43.0', + 'version' => '1.43.0.0', + 'reference' => '4d5d331bf731e0aedbc6b2f5e61135b7b7996a72', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), @@ -1068,18 +1068,18 @@ ), ), 'symfony/polyfill-php84' => array( - 'pretty_version' => 'v1.38.1', - 'version' => '1.38.1.0', - 'reference' => 'f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa', + 'pretty_version' => 'v1.43.0', + 'version' => '1.43.0.0', + 'reference' => '22c6548499cbe5c5bb072fc0c42312dff062a015', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php84', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-php85' => array( - 'pretty_version' => 'v1.41.0', - 'version' => '1.41.0.0', - 'reference' => '255fab485aaa1006ed411040c42aecd7b5302d7a', + 'pretty_version' => 'v1.43.0', + 'version' => '1.43.0.0', + 'reference' => '86a42cbcc07adc331481a5ab310a4024bfc227f6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php85', 'aliases' => array(), @@ -1095,9 +1095,9 @@ 'dev_requirement' => false, ), 'symfony/routing' => array( - 'pretty_version' => 'v7.4.18', - 'version' => '7.4.18.0', - 'reference' => 'ddd558991e98f693ae6bf5063cc1b0362c6bbec3', + 'pretty_version' => 'v7.4.20', + 'version' => '7.4.20.0', + 'reference' => '2bacb72be5eadeaf9874d5accb75bfb33d21c74b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/routing', 'aliases' => array(), diff --git a/core/vendor/composer/semver/CHANGELOG.md b/core/vendor/composer/semver/CHANGELOG.md index bad46cd1c1..09526fb31e 100644 --- a/core/vendor/composer/semver/CHANGELOG.md +++ b/core/vendor/composer/semver/CHANGELOG.md @@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +### [3.5.1] 2026-10-05 + + * Fixed `Intervals::isSubsetOf()` returning false for `< 0.0.0`, which now correctly matches nothing and so is a subset of any constraint (#192) + +### [3.5.0] 2026-09-24 + + * Added `VersionParser::isValid()` to check whether a version string can be normalized (#168) + * Fixed `Intervals::compactConstraint()` turning constraints that match no dev versions, like `> 1.0.0 != 2.0.0 || < 1.9.0`, into `!= 2.0.0` which matches all `dev-*` versions (#189) + * Fixed `>=` and `<` constraints on RC versions, like `>=1.0-RC1`, getting an extra `-dev` suffix which `beta` and `alpha` constraints did not get (#187) + * Improved `CompilingMatcher` performance by avoiding building concatenated cache keys on every call (#186) + +### [3.4.4] 2025-08-20 + + * Fixed some type annotations to use `list` return types (#171) + ### [3.4.3] 2024-09-19 * Fixed some type annotations @@ -191,6 +206,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Namespace: `Composer\Test\Package\LinkConstraint` -> `Composer\Test\Semver\Constraint` * Changed: code style using php-cs-fixer. +[3.5.1]: https://github.com/composer/semver/compare/3.5.0...3.5.1 +[3.5.0]: https://github.com/composer/semver/compare/3.4.4...3.5.0 +[3.4.4]: https://github.com/composer/semver/compare/3.4.3...3.4.4 [3.4.3]: https://github.com/composer/semver/compare/3.4.2...3.4.3 [3.4.2]: https://github.com/composer/semver/compare/3.4.1...3.4.2 [3.4.1]: https://github.com/composer/semver/compare/3.4.0...3.4.1 diff --git a/core/vendor/composer/semver/README.md b/core/vendor/composer/semver/README.md index 7677849065..570dda675f 100644 --- a/core/vendor/composer/semver/README.md +++ b/core/vendor/composer/semver/README.md @@ -1,7 +1,10 @@ composer/semver =============== -Semver (Semantic Versioning) library that offers utilities, version constraint parsing and validation. +Version comparison library that offers utilities, version constraint parsing and validation. + +It follows semver (semantic versioning) where possible but is also constrained by +`version_compare` and backwards compatibility and as such cannot implement semver strictly. Originally written as part of [composer/composer](https://github.com/composer/composer), now extracted and made available as a stand-alone library. @@ -36,7 +39,32 @@ article in the documentation section of the [getcomposer.org](https://getcompose Basic usage ----------- -### Comparator +### Validation / Normalization + +The [`Composer\Semver\VersionParser`](https://github.com/composer/semver/blob/main/src/VersionParser.php) +class provides the following methods for parsing, normalizing and validating versions and constraints. + +Numeric versions are normalized to a 4 component versions (e.g. `1.2.3` is normalized to `1.2.3.0`) +for internal consistency and compatibility with `version_compare`. Normalized versions are used for +constraints internally but should not be shown to end users. + +For versions: + +* isValid($version) +* normalize($version, $fullVersion = null) +* normalizeBranch($name) +* normalizeDefaultBranch($name) + +For constraints: + +* parseConstraints($constraints) + +For stabilities: + +* parseStability($version) +* normalizeStability($stability) + +### Comparison The [`Composer\Semver\Comparator`](https://github.com/composer/semver/blob/main/src/Comparator.php) class provides the following methods for comparing versions: diff --git a/core/vendor/composer/semver/composer.json b/core/vendor/composer/semver/composer.json index 1fad9e5486..773196e378 100644 --- a/core/vendor/composer/semver/composer.json +++ b/core/vendor/composer/semver/composer.json @@ -1,6 +1,6 @@ { "name": "composer/semver", - "description": "Semver library that offers utilities, version constraint parsing and validation.", + "description": "Version comparison library that offers utilities, version constraint parsing and validation.", "type": "library", "license": "MIT", "keywords": [ diff --git a/core/vendor/composer/semver/src/CompilingMatcher.php b/core/vendor/composer/semver/src/CompilingMatcher.php index aea1d3b95c..afa9cb35a1 100644 --- a/core/vendor/composer/semver/src/CompilingMatcher.php +++ b/core/vendor/composer/semver/src/CompilingMatcher.php @@ -21,12 +21,12 @@ class CompilingMatcher { /** * @var array - * @phpstan-var array + * @phpstan-var array> */ private static $compiledCheckerCache = array(); /** * @var array - * @phpstan-var array + * @phpstan-var array>> */ private static $resultCache = array(); @@ -68,27 +68,29 @@ public static function clear() */ public static function match(ConstraintInterface $constraint, $operator, $version) { - $resultCacheKey = $operator.$constraint.';'.$version; + $constraintString = (string) $constraint; + // Resolve the operator and constraint cache bucket once, so each read or write below + // only needs to look up the version. Using a reference avoids repeating both outer + // array lookups and ensures new results are stored in the static cache, not a local copy. + $resultCache = &self::$resultCache[$operator][$constraintString]; - if (isset(self::$resultCache[$resultCacheKey])) { - return self::$resultCache[$resultCacheKey]; + if (isset($resultCache[$version])) { + return $resultCache[$version]; } if (self::$enabled === null) { self::$enabled = !\in_array('eval', explode(',', (string) ini_get('disable_functions')), true); } if (!self::$enabled) { - return self::$resultCache[$resultCacheKey] = $constraint->matches(new Constraint(self::$transOpInt[$operator], $version)); + return $resultCache[$version] = $constraint->matches(new Constraint(self::$transOpInt[$operator], $version)); } - $cacheKey = $operator.$constraint; - if (!isset(self::$compiledCheckerCache[$cacheKey])) { + $compiledCheckerCache = &self::$compiledCheckerCache[$operator][$constraintString]; + if (null === $compiledCheckerCache) { $code = $constraint->compile($operator); - self::$compiledCheckerCache[$cacheKey] = $function = eval('return function($v, $b){return '.$code.';};'); - } else { - $function = self::$compiledCheckerCache[$cacheKey]; + $compiledCheckerCache = eval('return function($v, $b){return '.$code.';};'); } - return self::$resultCache[$resultCacheKey] = $function($version, strpos($version, 'dev-') === 0); + return $resultCache[$version] = $compiledCheckerCache($version, strpos($version, 'dev-') === 0); } } diff --git a/core/vendor/composer/semver/src/Intervals.php b/core/vendor/composer/semver/src/Intervals.php index d889d0ada4..1329800dfd 100644 --- a/core/vendor/composer/semver/src/Intervals.php +++ b/core/vendor/composer/semver/src/Intervals.php @@ -150,16 +150,37 @@ public static function compactConstraint(ConstraintInterface $constraint) $constraints[] = $intervals['numeric'][0]->getStart(); $hasNumericMatchAll = true; } else { + // A bare != N matches all dev-* versions, so if the numeric part is the whole line minus some points, + // only compact it into unbounded != constraints when the branches already match all dev versions + $numeric = $intervals['numeric']; + $count = \count($numeric); + $skipNotEqual = false; + if (!$intervals['branches']['exclude'] && $count > 1 + && (string) $numeric[0]->getStart() === (string) Interval::fromZero() + && (string) $numeric[$count - 1]->getEnd() === (string) Interval::untilPositiveInfinity() + ) { + $skipNotEqual = true; + for ($i = 0; $i < $count - 1; $i++) { + if ($numeric[$i]->getEnd()->getOperator() !== '<' + || $numeric[$i + 1]->getStart()->getOperator() !== '>' + || $numeric[$i]->getEnd()->getVersion() !== $numeric[$i + 1]->getStart()->getVersion() + ) { + $skipNotEqual = false; + break; + } + } + } + $unEqualConstraints = array(); - for ($i = 0, $count = \count($intervals['numeric']); $i < $count; $i++) { - $interval = $intervals['numeric'][$i]; + for ($i = 0; $i < $count; $i++) { + $interval = $numeric[$i]; // if current interval ends with < N and next interval begins with > N we can swap this out for != N // but this needs to happen as a conjunctive expression together with the start of the current interval // and end of next interval, so [>=M, N, [>=M, !=N, getEnd()->getOperator() === '<' && $i+1 < $count) { - $nextInterval = $intervals['numeric'][$i+1]; + if (!$skipNotEqual && $interval->getEnd()->getOperator() === '<' && $i+1 < $count) { + $nextInterval = $numeric[$i+1]; if ($interval->getEnd()->getVersion() === $nextInterval->getStart()->getVersion() && $nextInterval->getStart()->getOperator() === '>') { // only add a start if we didn't already do so, can be skipped if we're looking at second // interval in [>=M, N, P, array(new Interval($constraint, Interval::untilPositiveInfinity())), 'branches' => Interval::noDev()); } if ($op[0] === '<') { // < & <= + // filter out the invalid interval >= 0.0.0.0-dev - < 0.0.0.0-dev + if ($op === '<' && $constraint->getVersion() === '0.0.0.0-dev') { + return array('numeric' => array(), 'branches' => Interval::noDev()); + } + return array('numeric' => array(new Interval(Interval::fromZero(), $constraint)), 'branches' => Interval::noDev()); } if ($op === '!=') { diff --git a/core/vendor/composer/semver/src/VersionParser.php b/core/vendor/composer/semver/src/VersionParser.php index 305a0faec1..6a7473acc2 100644 --- a/core/vendor/composer/semver/src/VersionParser.php +++ b/core/vendor/composer/semver/src/VersionParser.php @@ -95,6 +95,22 @@ public static function normalizeStability($stability) return $stability === 'rc' ? 'RC' : $stability; } + /** + * @param string $version + * + * @return bool + */ + public function isValid($version) + { + try { + $this->normalize($version); + } catch (\UnexpectedValueException $e) { + return false; + } + + return true; + } + /** * Normalizes a version string to be able to perform comparisons on it. * @@ -506,7 +522,7 @@ private function parseConstraint($constraint) if ($op !== '==' && $op !== '=' && !empty($stabilityModifier) && self::parseStability($version) === 'stable') { $version .= '-' . $stabilityModifier; } elseif ('<' === $op || '>=' === $op) { - if (!preg_match('/-' . self::$modifierRegex . '$/', strtolower($matches[2]))) { + if (!preg_match('/-' . self::$modifierRegex . '$/i', $matches[2])) { if (strpos($matches[2], 'dev-') !== 0) { $version .= '-dev'; } diff --git a/core/vendor/dg/rss-php/composer.json b/core/vendor/dg/rss-php/composer.json new file mode 100644 index 0000000000..330967b860 --- /dev/null +++ b/core/vendor/dg/rss-php/composer.json @@ -0,0 +1,35 @@ +{ + "name": "dg/rss-php", + "description": "RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed", + "keywords": ["rss", "atom", "feed"], + "homepage": "https://github.com/dg/rss-php", + "license": ["BSD-3-Clause"], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + } + ], + "require": { + "php": ">=8.2", + "ext-simplexml": "*" + }, + "require-dev": { + "nette/tester": "^2.6", + "phpstan/phpstan": "^2.1", + "phpstan/extension-installer": "^1.4", + "nette/phpstan-rules": "^1.0" + }, + "autoload": { + "classmap": ["src/"] + }, + "scripts": { + "phpstan": "phpstan analyse", + "tester": "tester tests -s" + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true + } + } +} diff --git a/core/vendor/dg/rss-php/example-atom.php b/core/vendor/dg/rss-php/example-atom.php new file mode 100644 index 0000000000..0475bad735 --- /dev/null +++ b/core/vendor/dg/rss-php/example-atom.php @@ -0,0 +1,26 @@ + + +

title) ?>

+ +entry as $entry): ?> +

title) ?> + timestamp) ?>

+ + content['type'] == 'html'): ?> +
content ?>
+ +

content) ?>

+ + diff --git a/core/vendor/dg/rss-php/example-rss.php b/core/vendor/dg/rss-php/example-rss.php new file mode 100644 index 0000000000..3305dc6d8a --- /dev/null +++ b/core/vendor/dg/rss-php/example-rss.php @@ -0,0 +1,27 @@ + + +

title) ?>

+ +

description) ?>

+ +item as $item): ?> +

title) ?> + timestamp) ?>

+ + {'content:encoded'})): ?> +
{'content:encoded'} ?>
+ +

description) ?>

+ + diff --git a/core/vendor/dg/rss-php/license.md b/core/vendor/dg/rss-php/license.md new file mode 100644 index 0000000000..3aa00adf9c --- /dev/null +++ b/core/vendor/dg/rss-php/license.md @@ -0,0 +1,27 @@ +Copyright (c) 2008, Copyright (c) 2008 David Grudl +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of David Grudl nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/core/vendor/dg/rss-php/readme.md b/core/vendor/dg/rss-php/readme.md new file mode 100644 index 0000000000..7e962d2ffe --- /dev/null +++ b/core/vendor/dg/rss-php/readme.md @@ -0,0 +1,73 @@ +RSS & Atom Feeds for PHP +======================== + +[![Downloads this Month](https://img.shields.io/packagist/dm/dg/rss-php.svg)](https://packagist.org/packages/dg/rss-php) +[![Latest Stable Version](https://poser.pugx.org/dg/rss-php/v/stable)](https://github.com/dg/rss-php/releases) +[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/dg/rss-php/blob/master/license.md) + +RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feeds. + +It requires PHP 5.3 or newer with CURL extension or enabled allow_url_fopen +and is licensed under the New BSD License. You can obtain the latest version from +our [GitHub repository](https://github.com/dg/rss-php/releases) or install it via Composer: + +``` +composer require dg/rss-php +``` + +[Support Me](https://github.com/sponsors/dg) +-------------------------------------------- + +Do you like RSS? Are you looking forward to the new features? + +[![Buy me a coffee](https://files.nette.org/icons/donation-3.svg)](https://github.com/sponsors/dg) + +Thank you! + + +Usage +----- + +Download RSS feed from URL: + +```php +$rss = Feed::loadRss($url); +``` + +The returned properties are SimpleXMLElement objects. Extracting +the information from the channel is easy: + +```php +echo 'Title: ', $rss->title; +echo 'Description: ', $rss->description; +echo 'Link: ', $rss->url; + +foreach ($rss->item as $item) { + echo 'Title: ', $item->title; + echo 'Link: ', $item->url; + echo 'Timestamp: ', $item->timestamp; + echo 'Description ', $item->description; + echo 'HTML encoded content: ', $item->{'content:encoded'}; +} +``` + +Download Atom feed from URL: + +```php +$atom = Feed::loadAtom($url); +``` + +You can also enable caching: + +```php +Feed::$cacheDir = __DIR__ . '/tmp'; +Feed::$cacheExpire = '5 hours'; +``` + +You can setup a User-Agent if needed: + +```php +Feed::$userAgent = "FeedFetcher-Google; (+http://www.google.com/feedfetcher.html)"; +``` + +If you like it, **[please make a donation now](https://nette.org/make-donation?to=rss-php)**. Thank you! diff --git a/core/vendor/dg/rss-php/src/Feed.php b/core/vendor/dg/rss-php/src/Feed.php new file mode 100644 index 0000000000..0bb42977e9 --- /dev/null +++ b/core/vendor/dg/rss-php/src/Feed.php @@ -0,0 +1,232 @@ +channel) { + return self::fromRss($xml); + } else { + return self::fromAtom($xml); + } + } + + + /** + * Loads RSS feed. + * @throws FeedException + */ + public static function loadRss(string $url, ?string $user = null, ?string $pass = null): static + { + return self::fromRss(self::loadXml($url, $user, $pass)); + } + + + /** + * Loads Atom feed. + * @throws FeedException + */ + public static function loadAtom(string $url, ?string $user = null, ?string $pass = null): static + { + return self::fromAtom(self::loadXml($url, $user, $pass)); + } + + + private static function fromRss(SimpleXMLElement $xml): static + { + if (!$xml->channel) { + throw new FeedException('Invalid feed.'); + } + + self::adjustNamespaces($xml); + + foreach ($xml->channel->item as $item) { + // converts namespaces to dotted tags + self::adjustNamespaces($item); + + // generate 'url' & 'timestamp' tags + $item->url = (string) $item->link; + if (isset($item->{'dc:date'})) { + $item->timestamp = strtotime((string) $item->{'dc:date'}); + } elseif (isset($item->pubDate)) { + $item->timestamp = strtotime((string) $item->pubDate); + } + } + $feed = new static; + $feed->xml = $xml->channel; + return $feed; + } + + + private static function fromAtom(SimpleXMLElement $xml): static + { + $ns = $xml->getDocNamespaces() ?: []; + if (!in_array('http://www.w3.org/2005/Atom', $ns, strict: true) + && !in_array('http://purl.org/atom/ns#', $ns, strict: true) + ) { + throw new FeedException('Invalid feed.'); + } + + // generate 'url' & 'timestamp' tags + foreach ($xml->entry as $entry) { + $entry->url = (string) $entry->link['href']; + $entry->timestamp = strtotime((string) $entry->updated); + } + $feed = new static; + $feed->xml = $xml; + return $feed; + } + + + /** + * Returns property value. Do not call directly. + */ + public function __get(string $name): mixed + { + return $this->xml->{$name}; + } + + + /** + * Sets value of a property. Do not call directly. + */ + public function __set(string $name, mixed $value): void + { + throw new Exception("Cannot assign to a read-only property '$name'."); + } + + + /** + * Converts a SimpleXMLElement into an array. + */ + public function toArray(?SimpleXMLElement $xml = null): string|array + { + if ($xml === null) { + $xml = $this->xml; + } + + if (!$xml->children()) { + return (string) $xml; + } + + $arr = []; + foreach ($xml->children() as $tag => $child) { + if (count($xml->$tag) === 1) { + $arr[$tag] = $this->toArray($child); + } else { + $arr[$tag][] = $this->toArray($child); + } + } + + return $arr; + } + + + /** + * Load XML from cache or HTTP. + * @throws FeedException + */ + private static function loadXml(string $url, ?string $user, ?string $pass): SimpleXMLElement + { + $e = self::$cacheExpire; + $cacheFile = self::$cacheDir . '/feed.' . md5(serialize(func_get_args())) . '.xml'; + + if (self::$cacheDir + && (time() - @filemtime($cacheFile) <= (is_string($e) ? strtotime($e) - time() : $e)) + && $data = @file_get_contents($cacheFile) + ) { + // ok + } elseif (($data = self::httpRequest($url, $user, $pass)) !== false && $data = trim($data)) { + if (self::$cacheDir) { + file_put_contents($cacheFile, $data); + } + } elseif (self::$cacheDir && $data = @file_get_contents($cacheFile)) { + // ok + } else { + throw new FeedException('Cannot load feed.'); + } + + return new SimpleXMLElement($data, LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOCDATA); + } + + + /** + * Process HTTP request. + */ + private static function httpRequest(string $url, ?string $user, ?string $pass): string|false + { + if (extension_loaded('curl')) { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $url); + if ($user !== null || $pass !== null) { + curl_setopt($curl, CURLOPT_USERPWD, "$user:$pass"); + } + curl_setopt($curl, CURLOPT_USERAGENT, self::$userAgent); // some feeds require a user agent + curl_setopt($curl, CURLOPT_HEADER, value: false); + curl_setopt($curl, CURLOPT_TIMEOUT, 20); + curl_setopt($curl, CURLOPT_ENCODING, ''); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, value: true); // no echo, just return result + if (!ini_get('open_basedir')) { + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, value: true); // sometime is useful :) + } + $result = curl_exec($curl); + return curl_errno($curl) === 0 && curl_getinfo($curl, CURLINFO_HTTP_CODE) === 200 && is_string($result) + ? $result + : false; + + } else { + $context = null; + if ($user !== null && $pass !== null) { + $options = [ + 'http' => [ + 'method' => 'GET', + 'header' => 'Authorization: Basic ' . base64_encode($user . ':' . $pass) . "\r\n", + ], + ]; + $context = stream_context_create($options); + } + + return file_get_contents($url, false, $context); + } + } + + + /** + * Generates better accessible namespaced tags. + */ + private static function adjustNamespaces(SimpleXMLElement $el): void + { + foreach ($el->getNamespaces(true) as $prefix => $ns) { + if ($prefix === '') { + continue; + } + $children = $el->children($ns); + foreach ($children as $tag => $content) { + $el->{$prefix . ':' . $tag} = $content; + } + } + } +} + + + +/** + * An exception generated by Feed. + */ +class FeedException extends Exception +{ +} diff --git a/core/vendor/doctrine/dbal/composer.json b/core/vendor/doctrine/dbal/composer.json index 5dc9e2e8fc..9746c795dc 100644 --- a/core/vendor/doctrine/dbal/composer.json +++ b/core/vendor/doctrine/dbal/composer.json @@ -43,9 +43,9 @@ "phpstan/phpstan": "2.1.30", "phpstan/phpstan-phpunit": "2.0.7", "phpstan/phpstan-strict-rules": "^2", - "phpunit/phpunit": "11.5.50", - "slevomat/coding-standard": "8.27.1", - "squizlabs/php_codesniffer": "4.0.1", + "phpunit/phpunit": "11.5.56", + "slevomat/coding-standard": "8.31.1", + "squizlabs/php_codesniffer": "4.0.4", "symfony/cache": "^6.3.8|^7.0|^8.0", "symfony/console": "^5.4|^6.3|^7.0|^8.0" }, diff --git a/core/vendor/doctrine/dbal/src/Cache/ArrayResult.php b/core/vendor/doctrine/dbal/src/Cache/ArrayResult.php index 3b13b88ca9..690d0dfac3 100644 --- a/core/vendor/doctrine/dbal/src/Cache/ArrayResult.php +++ b/core/vendor/doctrine/dbal/src/Cache/ArrayResult.php @@ -107,7 +107,7 @@ public function __serialize(): array return [$this->columnNames, $this->rows]; } - /** @param mixed[] $data */ + /** @param array{list, list>} $data */ public function __unserialize(array $data): void { // Handle objects serialized with DBAL 4.1 and earlier. diff --git a/core/vendor/doctrine/dbal/src/Connection.php b/core/vendor/doctrine/dbal/src/Connection.php index 0e523708c0..2e4cbf3bc2 100644 --- a/core/vendor/doctrine/dbal/src/Connection.php +++ b/core/vendor/doctrine/dbal/src/Connection.php @@ -830,7 +830,6 @@ public function executeCacheQuery(string $sql, array $params, array $types, Quer [$cacheKey, $realKey] = $qcp->generateCacheKeys($sql, $params, $types, $connectionParams); - // @phpstan-ignore missingType.checkedException $item = $resultCache->getItem($cacheKey); if ($item->isHit()) { diff --git a/core/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver/EasyConnectString.php b/core/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver/EasyConnectString.php index 8d35e8f0da..d0fa0b807b 100644 --- a/core/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver/EasyConnectString.php +++ b/core/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver/EasyConnectString.php @@ -48,6 +48,12 @@ public static function fromConnectionParameters(array $params): self } if (! isset($params['host'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7244', + 'Not specifying either of the "host" and "connectstring" parameters is deprecated.', + ); + return new self($params['dbname'] ?? ''); } @@ -62,6 +68,15 @@ public static function fromConnectionParameters(array $params): self ); } + if (isset($params['dbname'])) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7239', + 'Using the "dbname" parameter is deprecated. Use "servicename", "sid" or "connectstring"' + . ' instead.', + ); + } + if (isset($params['servicename']) || isset($params['dbname'])) { $serviceKey = 'SID'; @@ -74,6 +89,10 @@ public static function fromConnectionParameters(array $params): self $connectData[$serviceKey] = $serviceName; } + if (isset($params['sid'])) { + $connectData['SID'] = $params['sid']; + } + if (isset($params['instancename'])) { $connectData['INSTANCE_NAME'] = $params['instancename']; } diff --git a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php index a7854a2f94..9d0aaf513a 100644 --- a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php +++ b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Connection.php @@ -10,6 +10,8 @@ use mysqli; use mysqli_sql_exception; +use function assert; + final class Connection implements ConnectionInterface { /** @@ -35,9 +37,7 @@ public function prepare(string $sql): Statement throw ConnectionError::upcast($e); } - if ($stmt === false) { - throw ConnectionError::new($this->connection); - } + assert($stmt !== false); return new Statement($stmt); } @@ -55,15 +55,11 @@ public function quote(string $value): string public function exec(string $sql): int|string { try { - $result = $this->connection->query($sql); + $this->connection->query($sql); } catch (mysqli_sql_exception $e) { throw ConnectionError::upcast($e); } - if ($result === false) { - throw ConnectionError::new($this->connection); - } - return $this->connection->affected_rows; } @@ -81,6 +77,9 @@ public function lastInsertId(): int|string public function beginTransaction(): void { try { + // Prior to PHP 8.5.2, PHP 8.4.17 and PHP 8.3.30, mysqli::begin_transaction() didn't respect error reporting + // configuration and reported failure as false return value + // See: https://github.com/php/php-src/commit/dbf56e0eba68c61385e9a2d15a3e3f5066f80ec4 if (! $this->connection->begin_transaction()) { throw ConnectionError::new($this->connection); } @@ -92,9 +91,7 @@ public function beginTransaction(): void public function commit(): void { try { - if (! $this->connection->commit()) { - throw ConnectionError::new($this->connection); - } + $this->connection->commit(); } catch (mysqli_sql_exception $e) { throw ConnectionError::upcast($e); } @@ -103,9 +100,7 @@ public function commit(): void public function rollBack(): void { try { - if (! $this->connection->rollback()) { - throw ConnectionError::new($this->connection); - } + $this->connection->rollback(); } catch (mysqli_sql_exception $e) { throw ConnectionError::upcast($e); } diff --git a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php index b90f035fb4..78c2556a19 100644 --- a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php +++ b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php @@ -41,7 +41,7 @@ public function connect( } try { - $success = @$connection->real_connect( + @$connection->real_connect( $host, $params['user'] ?? '', $params['password'] ?? '', @@ -54,10 +54,6 @@ public function connect( throw ConnectionFailed::upcast($e); } - if (! $success) { - throw ConnectionFailed::new($connection); - } - foreach ($this->compilePostInitializers($params) as $initializer) { $initializer->initialize($connection); } @@ -81,22 +77,20 @@ private function compilePreInitializers( } if ( - ! isset($params['ssl_key']) && - ! isset($params['ssl_cert']) && - ! isset($params['ssl_ca']) && - ! isset($params['ssl_capath']) && - ! isset($params['ssl_cipher']) + isset($params['ssl_key']) || + isset($params['ssl_cert']) || + isset($params['ssl_ca']) || + isset($params['ssl_capath']) || + isset($params['ssl_cipher']) ) { - return; + yield new Secure( + $params['ssl_key'] ?? '', + $params['ssl_cert'] ?? '', + $params['ssl_ca'] ?? '', + $params['ssl_capath'] ?? '', + $params['ssl_cipher'] ?? '', + ); } - - yield new Secure( - $params['ssl_key'] ?? '', - $params['ssl_cert'] ?? '', - $params['ssl_ca'] ?? '', - $params['ssl_capath'] ?? '', - $params['ssl_cipher'] ?? '', - ); } /** diff --git a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php index d34aafbc73..dbcf81189d 100644 --- a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php +++ b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php @@ -5,23 +5,12 @@ namespace Doctrine\DBAL\Driver\Mysqli\Exception; use Doctrine\DBAL\Driver\AbstractException; -use mysqli; use mysqli_sql_exception; use ReflectionProperty; -use function assert; - /** @internal */ final class ConnectionFailed extends AbstractException { - public static function new(mysqli $connection): self - { - $error = $connection->connect_error; - assert($error !== null); - - return new self($error, 'HY000', $connection->connect_errno); - } - public static function upcast(mysqli_sql_exception $exception): self { $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); diff --git a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php index afd94f11fe..839a629050 100644 --- a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php +++ b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidCharset.php @@ -5,7 +5,6 @@ namespace Doctrine\DBAL\Driver\Mysqli\Exception; use Doctrine\DBAL\Driver\AbstractException; -use mysqli; use mysqli_sql_exception; use ReflectionProperty; @@ -14,15 +13,6 @@ /** @internal */ final class InvalidCharset extends AbstractException { - public static function fromCharset(mysqli $connection, string $charset): self - { - return new self( - sprintf('Failed to set charset "%s": %s', $charset, $connection->error), - $connection->sqlstate, - $connection->errno, - ); - } - public static function upcast(mysqli_sql_exception $exception, string $charset): self { $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); diff --git a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php index 683db01d3e..cae56eb2fa 100644 --- a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php +++ b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/StatementError.php @@ -6,17 +6,11 @@ use Doctrine\DBAL\Driver\AbstractException; use mysqli_sql_exception; -use mysqli_stmt; use ReflectionProperty; /** @internal */ final class StatementError extends AbstractException { - public static function new(mysqli_stmt $statement): self - { - return new self($statement->error, $statement->sqlstate, $statement->errno); - } - public static function upcast(mysqli_sql_exception $exception): self { $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); diff --git a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php index 677d87043d..ed76560f5e 100644 --- a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php +++ b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Charset.php @@ -18,13 +18,9 @@ public function __construct(private readonly string $charset) public function initialize(mysqli $connection): void { try { - $success = $connection->set_charset($this->charset); + $connection->set_charset($this->charset); } catch (mysqli_sql_exception $e) { throw InvalidCharset::upcast($e, $this->charset); } - - if (! $success) { - throw InvalidCharset::fromCharset($connection, $this->charset); - } } } diff --git a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php index 3223951351..da8e3e0a46 100644 --- a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php +++ b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php @@ -20,6 +20,8 @@ public function __construct(private readonly array $options) public function initialize(mysqli $connection): void { foreach ($this->options as $option => $value) { + // mysqli::options() doesn't respect error reporting configuration and reports failure as false return value + // See: https://github.com/php/php-src/issues/20968 if (! mysqli_options($connection, $option, $value)) { throw InvalidOption::fromOption($option, $value); } diff --git a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php index 89f94f368d..876b7aba3d 100644 --- a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php +++ b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php @@ -9,32 +9,17 @@ use Doctrine\DBAL\Driver\Mysqli\Exception\StatementError; use Doctrine\DBAL\Driver\Result as ResultInterface; use Doctrine\DBAL\Exception\InvalidColumnIndex; +use mysqli_result; use mysqli_sql_exception; use mysqli_stmt; +use ValueError; -use function array_column; -use function array_combine; -use function array_fill; -use function count; +use const MYSQLI_ASSOC; +use const MYSQLI_NUM; final class Result implements ResultInterface { - /** - * Whether the statement result has columns. The property should be used only after the result metadata - * has been fetched ({@see $metadataFetched}). Otherwise, the property value is undetermined. - */ - private readonly bool $hasColumns; - - /** - * Mapping of statement result column indexes to their names. The property should be used only - * if the statement result has columns ({@see $hasColumns}). Otherwise, the property value is undetermined. - * - * @var array - */ - private readonly array $columnNames; - - /** @var mixed[] */ - private array $boundValues = []; + private mysqli_result|false $result; /** * @internal The result can be only instantiated by its driver connection or statement. @@ -50,81 +35,39 @@ public function __construct( private readonly mysqli_stmt $statement, private ?Statement $statementReference = null, // @phpstan-ignore property.onlyWritten ) { - $meta = $statement->result_metadata(); - $this->hasColumns = $meta !== false; - $this->columnNames = $meta !== false ? array_column($meta->fetch_fields(), 'name') : []; - - if ($meta === false) { - return; - } - - $meta->free(); - - // Store result of every execution which has it. Otherwise it will be impossible - // to execute a new statement in case if the previous one has non-fetched rows - // @link http://dev.mysql.com/doc/refman/5.7/en/commands-out-of-sync.html - $this->statement->store_result(); - - // Bind row values _after_ storing the result. Otherwise, if mysqli is compiled with libmysql, - // it will have to allocate as much memory as it may be needed for the given column type - // (e.g. for a LONGBLOB column it's 4 gigabytes) - // @link https://bugs.php.net/bug.php?id=51386#1270673122 - // - // Make sure that the values are bound after each execution. Otherwise, if free() has been - // previously called on the result, the values are unbound making the statement unusable. - // - // It's also important that row values are bound after _each_ call to store_result(). Otherwise, - // if mysqli is compiled with libmysql, subsequently fetched string values will get truncated - // to the length of the ones fetched during the previous execution. - $this->boundValues = array_fill(0, count($this->columnNames), null); - - // The following is necessary as PHP cannot handle references to properties properly - $refs = &$this->boundValues; - - if (! $this->statement->bind_result(...$refs)) { - throw StatementError::new($this->statement); + try { + $this->result = $statement->get_result(); + } catch (mysqli_sql_exception $exception) { + throw StatementError::upcast($exception); } } public function fetchNumeric(): array|false { - try { - $ret = $this->statement->fetch(); - } catch (mysqli_sql_exception $e) { - throw StatementError::upcast($e); - } - - if ($ret === false) { - throw StatementError::new($this->statement); - } - - if ($ret === null) { + if ($this->result === false) { return false; } - $values = []; - - foreach ($this->boundValues as $v) { - $values[] = $v; - } - - return $values; + /** @phpstan-ignore return.type */ + return $this->result->fetch_row() ?? false; } public function fetchAssociative(): array|false { - $values = $this->fetchNumeric(); - - if ($values === false) { + if ($this->result === false) { return false; } - return array_combine($this->columnNames, $values); + return $this->result->fetch_assoc() ?? false; } public function fetchOne(): mixed { - return FetchUtils::fetchOne($this); + if ($this->result === false) { + return false; + } + + return $this->result->fetch_column(); } /** @@ -132,7 +75,12 @@ public function fetchOne(): mixed */ public function fetchAllNumeric(): array { - return FetchUtils::fetchAllNumeric($this); + if ($this->result === false) { + return []; + } + + /** @phpstan-ignore return.type */ + return $this->result->fetch_all(MYSQLI_NUM); } /** @@ -140,7 +88,11 @@ public function fetchAllNumeric(): array */ public function fetchAllAssociative(): array { - return FetchUtils::fetchAllAssociative($this); + if ($this->result === false) { + return []; + } + + return $this->result->fetch_all(MYSQLI_ASSOC); } /** @@ -153,8 +105,8 @@ public function fetchFirstColumn(): array public function rowCount(): int|string { - if ($this->hasColumns) { - return $this->statement->num_rows; + if ($this->result !== false) { + return $this->result->num_rows; } return $this->statement->affected_rows; @@ -162,16 +114,29 @@ public function rowCount(): int|string public function columnCount(): int { - return $this->statement->field_count; + if ($this->result === false) { + return 0; + } + + return $this->result->field_count; } public function getColumnName(int $index): string { - return $this->columnNames[$index] ?? throw InvalidColumnIndex::new($index); + if ($this->result === false) { + throw InvalidColumnIndex::new($index); + } + + try { + /** @phpstan-ignore property.nonObject */ + return $this->result->fetch_field_direct($index)->name; + } catch (ValueError $exception) { + throw InvalidColumnIndex::new($index, $exception); + } } public function free(): void { - $this->statement->free_result(); + $this->result = false; } } diff --git a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php index 9a2151786e..0cda62eb5c 100644 --- a/core/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php +++ b/core/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php @@ -70,9 +70,7 @@ public function execute(): Result } try { - if (! $this->stmt->execute()) { - throw StatementError::new($this->stmt); - } + $this->stmt->execute(); } catch (mysqli_sql_exception $e) { throw StatementError::upcast($e); } @@ -113,8 +111,10 @@ private function bindParameters(): void $values[$parameter] = $value; } - if (! $this->stmt->bind_param($types, ...$values)) { - throw StatementError::new($this->stmt); + try { + $this->stmt->bind_param($types, ...$values); + } catch (mysqli_sql_exception $e) { + throw StatementError::upcast($e); } $this->sendLongData($streams); @@ -137,8 +137,10 @@ private function sendLongData(array $streams): void throw FailedReadingStreamOffset::new($paramNr); } - if (! $this->stmt->send_long_data($paramNr - 1, $chunk)) { - throw StatementError::new($this->stmt); + try { + $this->stmt->send_long_data($paramNr - 1, $chunk); + } catch (mysqli_sql_exception $e) { + throw StatementError::upcast($e); } } } diff --git a/core/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php b/core/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php index 64c210c498..4cc5691650 100644 --- a/core/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php +++ b/core/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php @@ -47,10 +47,7 @@ public function getServerVersion(): string return $matches[1]; } - /** - * @throws Parser\Exception - * @throws Error - */ + /** @throws Error */ public function prepare(string $sql): Statement { $visitor = new ConvertPositionalToNamedPlaceholders(); @@ -66,10 +63,7 @@ public function prepare(string $sql): Statement return new Statement($this->connection, $statement, $visitor->getParameterMap(), $this->executionMode); } - /** - * @throws Exception - * @throws Parser\Exception - */ + /** @throws Exception */ public function query(string $sql): Result { return $this->prepare($sql)->execute(); @@ -80,10 +74,7 @@ public function quote(string $value): string return "'" . addcslashes(str_replace("'", "''", $value), "\000\n\r\\\032") . "'"; } - /** - * @throws Exception - * @throws Parser\Exception - */ + /** @throws Exception */ public function exec(string $sql): int|string { return $this->prepare($sql)->execute()->rowCount(); diff --git a/core/vendor/doctrine/dbal/src/Driver/PgSQL/Connection.php b/core/vendor/doctrine/dbal/src/Driver/PgSQL/Connection.php index 043c2de4b8..48f0013cdf 100644 --- a/core/vendor/doctrine/dbal/src/Driver/PgSQL/Connection.php +++ b/core/vendor/doctrine/dbal/src/Driver/PgSQL/Connection.php @@ -41,7 +41,6 @@ public function prepare(string $sql): Statement { $visitor = new ConvertParameters(); - /** @phpstan-ignore missingType.checkedException */ $this->parser->parse($sql, $visitor); $statementName = uniqid('dbal', true); diff --git a/core/vendor/doctrine/dbal/src/Driver/PgSQL/Statement.php b/core/vendor/doctrine/dbal/src/Driver/PgSQL/Statement.php index d6aa2f90fb..fab3daf2a0 100644 --- a/core/vendor/doctrine/dbal/src/Driver/PgSQL/Statement.php +++ b/core/vendor/doctrine/dbal/src/Driver/PgSQL/Statement.php @@ -40,14 +40,12 @@ public function __construct( public function __destruct() { // @phpstan-ignore isset.initializedProperty - if (! isset($this->connection)) { - return; + if (isset($this->connection)) { + @pg_query( + $this->connection, + 'DEALLOCATE ' . pg_escape_identifier($this->connection, $this->name), + ); } - - @pg_query( - $this->connection, - 'DEALLOCATE ' . pg_escape_identifier($this->connection, $this->name), - ); } /** {@inheritDoc} */ diff --git a/core/vendor/doctrine/dbal/src/Driver/SQLite3/Connection.php b/core/vendor/doctrine/dbal/src/Driver/SQLite3/Connection.php index 1e9af93c94..939161a91a 100644 --- a/core/vendor/doctrine/dbal/src/Driver/SQLite3/Connection.php +++ b/core/vendor/doctrine/dbal/src/Driver/SQLite3/Connection.php @@ -72,29 +72,17 @@ public function lastInsertId(): int public function beginTransaction(): void { - try { - $this->connection->exec('BEGIN'); - } catch (\Exception $e) { - throw Exception::new($e); - } + $this->exec('BEGIN'); } public function commit(): void { - try { - $this->connection->exec('COMMIT'); - } catch (\Exception $e) { - throw Exception::new($e); - } + $this->exec('COMMIT'); } public function rollBack(): void { - try { - $this->connection->exec('ROLLBACK'); - } catch (\Exception $e) { - throw Exception::new($e); - } + $this->exec('ROLLBACK'); } public function getNativeConnection(): SQLite3 diff --git a/core/vendor/doctrine/dbal/src/DriverManager.php b/core/vendor/doctrine/dbal/src/DriverManager.php index 34fbe236e0..878383f5c8 100644 --- a/core/vendor/doctrine/dbal/src/DriverManager.php +++ b/core/vendor/doctrine/dbal/src/DriverManager.php @@ -26,45 +26,78 @@ * @phpstan-type OverrideParams = array{ * application_name?: string, * charset?: string, + * connectstring?: string, * dbname?: string, * defaultTableOptions?: array, * driver?: key-of, * driverClass?: class-string, * driverOptions?: array, + * gssencmode?: string, * host?: string, + * instancename?: string, * memory?: bool, * password?: string, * path?: string, * persistent?: bool, + * pooled?: bool, * port?: int, * serverVersion?: string, + * service?: bool, + * servicename?: string, * sessionMode?: int, - * user?: string, + * ssl_ca?: string, + * ssl_capath?: string, + * ssl_cert?: string, + * ssl_cipher?: string, + * ssl_key?: string, + * sslcert?: string, + * sslcrl?: string, + * sslkey?: string, + * sslmode?: string, + * sslrootcert?: string, * unix_socket?: string, + * user?: string, * wrapperClass?: class-string, * } * @phpstan-type Params = array{ * application_name?: string, * charset?: string, + * connectstring?: string, * dbname?: string, * defaultTableOptions?: array, * driver?: key-of, * driverClass?: class-string, * driverOptions?: array, + * gssencmode?: string, * host?: string, + * instancename?: string, * keepReplica?: bool, * memory?: bool, * password?: string, * path?: string, * persistent?: bool, + * pooled?: bool, * port?: int, * primary?: OverrideParams, * replica?: array, * serverVersion?: string, + * service?: bool, + * servicename?: string, * sessionMode?: int, + * sid?: string, + * ssl_ca?: string, + * ssl_capath?: string, + * ssl_cert?: string, + * ssl_cipher?: string, + * ssl_key?: string, + * sslcert?: string, + * sslcrl?: string, + * sslkey?: string, + * sslmode?: string, + * sslrootcert?: string, + * unix_socket?: string, * user?: string, * wrapperClass?: class-string, - * unix_socket?: string, * } */ final class DriverManager diff --git a/core/vendor/doctrine/dbal/src/Exception/InvalidColumnDeclaration.php b/core/vendor/doctrine/dbal/src/Exception/InvalidColumnDeclaration.php index de68f4cf2f..a687bfd344 100644 --- a/core/vendor/doctrine/dbal/src/Exception/InvalidColumnDeclaration.php +++ b/core/vendor/doctrine/dbal/src/Exception/InvalidColumnDeclaration.php @@ -15,4 +15,12 @@ public static function fromInvalidColumnType(string $columnName, InvalidColumnTy { return new self(sprintf('Column "%s" has invalid type', $columnName), 0, $e); } + + public static function fromMissingColumnType(string $columnName): self + { + return new self(sprintf( + 'Column "%s" has no type. The column definition must contain a "typeName" key.', + $columnName, + )); + } } diff --git a/core/vendor/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php b/core/vendor/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php index 04e903f397..90f123e806 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php +++ b/core/vendor/doctrine/dbal/src/Platforms/AbstractMySQLPlatform.php @@ -366,7 +366,7 @@ public function getAlterTableSQL(TableDiff $diff): array $queryParts = []; foreach ($diff->getAddedColumns() as $column) { - $columnProperties = array_merge($column->toArray(), [ + $columnProperties = array_merge($column->toArray(true), [ 'comment' => $column->getComment(), ]); @@ -383,7 +383,7 @@ public function getAlterTableSQL(TableDiff $diff): array foreach ($diff->getChangedColumns() as $columnDiff) { $newColumn = $columnDiff->getNewColumn(); - $newColumnProperties = array_merge($newColumn->toArray(), [ + $newColumnProperties = array_merge($newColumn->toArray(true), [ 'comment' => $newColumn->getComment(), ]); @@ -467,7 +467,7 @@ protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff): array $sql = array_merge($sql, $this->getPreAlterTableAlterPrimaryKeySQL($diff, $droppedIndex)); foreach ($diff->getAddedIndexes() as $addedIndex) { - if ($droppedIndex->getColumns() !== $addedIndex->getColumns()) { + if ($droppedIndex->getUnquotedColumns() !== $addedIndex->getUnquotedColumns()) { continue; } @@ -536,7 +536,7 @@ private function getPreAlterTableAlterPrimaryKeySQL(TableDiff $diff, Index $inde $column->setAutoincrement(false); $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' MODIFY ' . - $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray(true)); // original autoincrement information might be needed later on by other parts of the table alteration $column->setAutoincrement(true); @@ -593,7 +593,7 @@ private function getPreAlterTableAlterIndexForeignKeySQL(TableDiff $diff): array $column->setAutoincrement(false); $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' MODIFY ' . - $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray(true)); // Restore the autoincrement attribute as it might be needed later on // by other parts of the table alteration. diff --git a/core/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php b/core/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php index bad3590b62..0bca8377be 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php +++ b/core/vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php @@ -889,6 +889,57 @@ final protected function getCreateTableWithoutForeignKeysSQL(Table $table): arra return $this->buildCreateTableSQL($table, false); } + /** + * Resolves the DBAL type instance of a column or of a column definition array. + * + * @param array|Column $column Column properties. + */ + final protected function getColumnType(array|Column $column): Type + { + if ($column instanceof Column) { + // @phpstan-ignore missingType.checkedException + return Type::getType($column->getTypeName()); + } + + $type = $this->getColumnTypeOrNull($column); + + if ($type === null) { + $name = $column['name'] ?? ''; + + throw InvalidColumnDeclaration::fromMissingColumnType(is_string($name) ? $name : ''); + } + + return $type; + } + + /** + * Resolves the DBAL type instance of a column or of a column definition array, or null when the definition + * carries no type. + * + * @param array $column Column properties. + */ + final protected function getColumnTypeOrNull(array $column): ?Type + { + if (isset($column['typeName']) && is_string($column['typeName'])) { + // @phpstan-ignore missingType.checkedException + return Type::getType($column['typeName']); + } + + if (isset($column['type']) && $column['type'] instanceof Type) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7490', + 'Providing a %s instance under the "type" key of a column definition array is deprecated.' + . ' Provide the type name under the "typeName" key instead.', + Type::class, + ); + + return $column['type']; + } + + return null; + } + /** @return list */ private function buildCreateTableSQL(Table $table, bool $createForeignKeys): array { @@ -1096,23 +1147,21 @@ protected function _getCreateTableSQL(string $name, array $columns, array $optio final protected function validateCreateTableOptions(array $options, string $methodName): void { if ( - isset( + ! isset( $options['primary'], $options['indexes'], $options['uniqueConstraints'], $options['foreignKeys'], ) ) { - return; + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6805', + 'Not passing $options or any of its following keys to %s() is deprecated:' + . ' "primary", "indexes", "uniqueConstraints", "foreignKeys".', + $methodName, + ); } - - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/6805', - 'Not passing $options or any of its following keys to %s() is deprecated:' - . ' "primary", "indexes", "uniqueConstraints", "foreignKeys".', - $methodName, - ); } public function getCreateTemporaryTableSnippetSQL(): string @@ -1495,7 +1544,7 @@ public function getColumnDeclarationSQL(string $name, array $column): string $notnull = ! empty($column['notnull']) ? ' NOT NULL' : ''; - $typeDecl = $column['type']->getSQLDeclaration($column, $this); + $typeDecl = $this->getColumnType($column)->getSQLDeclaration($column, $this); $declaration = $typeDecl . $charset . $default . $notnull . $collation; if ($this->supportsInlineColumnComments() && isset($column['comment']) && $column['comment'] !== '') { @@ -1546,12 +1595,12 @@ public function getDefaultValueDeclarationSQL(array $column): string return ' DEFAULT ' . $default->toSQL($this); } - if (! isset($column['type'])) { + $type = $this->getColumnTypeOrNull($column); + + if ($type === null) { return " DEFAULT '" . $default . "'"; } - $type = $column['type']; - if ($type instanceof Types\PhpIntegerMappingType) { return ' DEFAULT ' . $default; } @@ -1597,6 +1646,10 @@ public function getDefaultValueDeclarationSQL(array $column): string return ' DEFAULT ' . $default; } + if ($type instanceof Types\PhpFloatMappingType) { + return ' DEFAULT ' . (float) $default; + } + return ' DEFAULT ' . $this->quoteStringLiteral($default); } @@ -2289,6 +2342,8 @@ public function getDummySelectSQL(string $expression = '1'): string /** * Returns the SQL to create a new savepoint. + * + * This method should be invoked only if {@see supportsSavepoints()} returns true. */ public function createSavePoint(string $savepoint): string { @@ -2297,6 +2352,8 @@ public function createSavePoint(string $savepoint): string /** * Returns the SQL to release a savepoint. + * + * This method should be invoked only if {@see supportsReleaseSavepoints()} returns true. */ public function releaseSavePoint(string $savepoint): string { @@ -2305,6 +2362,8 @@ public function releaseSavePoint(string $savepoint): string /** * Returns the SQL to rollback a savepoint. + * + * This method should be invoked only if {@see supportsSavepoints()} returns true. */ public function rollbackSavePoint(string $savepoint): string { @@ -2378,7 +2437,7 @@ final public function escapeStringForLike(string $inputString, string $escapeCha */ private function columnToArray(Column $column): array { - return array_merge($column->toArray(), [ + return array_merge($column->toArray(true), [ 'name' => $column->getQuotedName($this), 'version' => $column->hasPlatformOption('version') ? $column->getPlatformOption('version') : false, 'comment' => $column->getComment(), diff --git a/core/vendor/doctrine/dbal/src/Platforms/DB2Platform.php b/core/vendor/doctrine/dbal/src/Platforms/DB2Platform.php index f9caa53683..1286679399 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/DB2Platform.php +++ b/core/vendor/doctrine/dbal/src/Platforms/DB2Platform.php @@ -18,7 +18,7 @@ use Doctrine\DBAL\SQL\Builder\DefaultSelectSQLBuilder; use Doctrine\DBAL\SQL\Builder\SelectSQLBuilder; use Doctrine\DBAL\TransactionIsolationLevel; -use Doctrine\DBAL\Types\DateTimeType; +use Doctrine\DBAL\Types\PhpDateTimeMappingType; use Doctrine\DBAL\Types\Types; use Doctrine\Deprecations\Deprecation; @@ -284,7 +284,7 @@ public function getAlterTableSQL(TableDiff $diff): array $queryParts = []; foreach ($diff->getAddedColumns() as $column) { - $columnDef = $column->toArray(); + $columnDef = $column->toArray(true); $queryPart = 'ADD COLUMN ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnDef); // Adding non-nullable columns to a table requires a default value to be specified. @@ -300,15 +300,13 @@ public function getAlterTableSQL(TableDiff $diff): array $comment = $column->getComment(); - if ($comment === '') { - continue; + if ($comment !== '') { + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $column->getQuotedName($this), + $comment, + ); } - - $commentsSQL[] = $this->getCommentOnColumnSQL( - $tableNameSQL, - $column->getQuotedName($this), - $comment, - ); } $needsReorg = false; @@ -402,7 +400,7 @@ private function gatherAlterColumnSQL( private function getAlterColumnClausesSQL(ColumnDiff $columnDiff, bool &$needsReorg): array { $newColumn = $columnDiff->getNewColumn(); - $columnArray = $newColumn->toArray(); + $columnArray = $newColumn->toArray(true); $newName = $columnDiff->getNewColumn()->getQuotedName($this); $oldName = $columnDiff->getOldColumn()->getQuotedName($this); @@ -429,7 +427,7 @@ private function getAlterColumnClausesSQL(ColumnDiff $columnDiff, bool &$needsRe $columnDiff->hasFixedChanged() ) { $needsReorg = true; - $clauses[] = $alterClause . ' SET DATA TYPE ' . $newColumn->getType() + $clauses[] = $alterClause . ' SET DATA TYPE ' . $this->getColumnType($newColumn) ->getSQLDeclaration($columnArray, $this); } @@ -486,7 +484,7 @@ public function getDefaultValueDeclarationSQL(array $column): string 'The "version" column platform option is deprecated.', ); - if ($column['type'] instanceof DateTimeType) { + if ($this->getColumnTypeOrNull($column) instanceof PhpDateTimeMappingType) { $column['default'] = '1'; } } diff --git a/core/vendor/doctrine/dbal/src/Platforms/Db2/Db2MetadataProvider.php b/core/vendor/doctrine/dbal/src/Platforms/Db2/Db2MetadataProvider.php index 39a3779c14..75e5aa69f5 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/Db2/Db2MetadataProvider.php +++ b/core/vendor/doctrine/dbal/src/Platforms/Db2/Db2MetadataProvider.php @@ -19,6 +19,7 @@ use Doctrine\DBAL\Schema\Metadata\PrimaryKeyConstraintColumnRow; use Doctrine\DBAL\Schema\Metadata\TableColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\TableMetadataRow; +use Doctrine\DBAL\Schema\Metadata\UniqueConstraintColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\ViewMetadataRow; use Doctrine\DBAL\Types\Exception\TypesException; use Doctrine\DBAL\Types\Types; @@ -275,7 +276,7 @@ private function getIndexColumns(?string $tableName): iterable schemaName: null, tableName: $row[0], indexName: $row[1], - type: $row[2] === 'U' ? IndexType::UNIQUE : IndexType::REGULAR, + type: $row[2] === 'D' ? IndexType::REGULAR : IndexType::UNIQUE, isClustered: false, predicate: null, columnName: $row[3], @@ -342,6 +343,72 @@ private function getPrimaryKeyConstraintColumns(?string $tableName): iterable } } + /** + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForAllTables(): iterable + { + return $this->getUniqueConstraintColumns(null); + } + + /** + * @param ?non-empty-string $schemaName + * @param non-empty-string $tableName + * + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForTable(?string $schemaName, string $tableName): iterable + { + if ($schemaName !== null) { + throw UnsupportedName::fromNonNullSchemaName($schemaName, __METHOD__); + } + + return $this->getUniqueConstraintColumns($tableName); + } + + /** + * @return iterable + * + * @throws Exception + */ + private function getUniqueConstraintColumns(?string $tableName): iterable + { + $params = []; + + $sql = sprintf( + <<<'SQL' + SELECT TC.TABNAME, + TC.CONSTNAME, + KCU.COLNAME + FROM SYSCAT.TABCONST TC + JOIN SYSCAT.KEYCOLUSE KCU + ON KCU.TABSCHEMA = TC.TABSCHEMA + AND KCU.TABNAME = TC.TABNAME + AND KCU.CONSTNAME = TC.CONSTNAME + WHERE %s + AND TC.TYPE = 'U' + ORDER BY TC.TABNAME, + TC.CONSTNAME, + KCU.COLSEQ + SQL, + $this->buildTableQueryPredicate('TC', $tableName, $params), + ); + + foreach ($this->connection->iterateNumeric($sql, $params) as $row) { + yield new UniqueConstraintColumnMetadataRow( + schemaName: null, + tableName: $row[0], + id: null, + name: $row[1], + columnName: $row[2], + ); + } + } + /** {@inheritDoc} */ public function getForeignKeyConstraintColumnsForAllTables(): iterable { diff --git a/core/vendor/doctrine/dbal/src/Platforms/MariaDBPlatform.php b/core/vendor/doctrine/dbal/src/Platforms/MariaDBPlatform.php index e0c436d3af..22b977c899 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/MariaDBPlatform.php +++ b/core/vendor/doctrine/dbal/src/Platforms/MariaDBPlatform.php @@ -149,7 +149,10 @@ public function getColumnDeclarationSQL(string $name, array $column): string { // MariaDb forces column collation to utf8mb4_bin where the column was declared as JSON so ignore // collation and character set for json columns as attempting to set them can cause an error. - if ($this->getJsonTypeDeclarationSQL([]) === 'JSON' && ($column['type'] ?? null) instanceof JsonType) { + if ( + $this->getJsonTypeDeclarationSQL([]) === 'JSON' + && $this->getColumnTypeOrNull($column) instanceof JsonType + ) { unset($column['collation']); unset($column['charset']); } diff --git a/core/vendor/doctrine/dbal/src/Platforms/MySQL/Comparator.php b/core/vendor/doctrine/dbal/src/Platforms/MySQL/Comparator.php index 30956ec4d1..9a963be624 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/MySQL/Comparator.php +++ b/core/vendor/doctrine/dbal/src/Platforms/MySQL/Comparator.php @@ -70,12 +70,10 @@ private function normalizeTable(Table $table): Table $overrideOptions = array_diff_assoc($normalizedOptions, $tableOptions); - if ($overrideOptions === $originalOptions) { - continue; + if ($overrideOptions !== $originalOptions) { + /** @phpstan-ignore argument.type */ + $column->setPlatformOptions($overrideOptions); } - - /** @phpstan-ignore argument.type */ - $column->setPlatformOptions($overrideOptions); } return $table; diff --git a/core/vendor/doctrine/dbal/src/Platforms/MySQL/MySQLMetadataProvider.php b/core/vendor/doctrine/dbal/src/Platforms/MySQL/MySQLMetadataProvider.php index 697cf41a48..14ef52a7d8 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/MySQL/MySQLMetadataProvider.php +++ b/core/vendor/doctrine/dbal/src/Platforms/MySQL/MySQLMetadataProvider.php @@ -22,6 +22,7 @@ use Doctrine\DBAL\Schema\Metadata\PrimaryKeyConstraintColumnRow; use Doctrine\DBAL\Schema\Metadata\TableColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\TableMetadataRow; +use Doctrine\DBAL\Schema\Metadata\UniqueConstraintColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\ViewMetadataRow; use Doctrine\DBAL\Types\Exception\TypesException; @@ -397,6 +398,7 @@ private function getIndexColumns(?string $tableName): iterable WHERE %s AND INDEX_NAME != 'PRIMARY' ORDER BY TABLE_NAME, + INDEX_NAME, SEQ_IN_INDEX SQL, implode(' AND ', $conditions), @@ -507,6 +509,83 @@ private function getPrimaryKeyConstraintColumns(?string $tableName): iterable } } + /** + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForAllTables(): iterable + { + return $this->getUniqueConstraintColumns(null); + } + + /** + * @param ?non-empty-string $schemaName + * @param non-empty-string $tableName + * + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForTable(?string $schemaName, string $tableName): iterable + { + if ($schemaName !== null) { + throw UnsupportedName::fromNonNullSchemaName($schemaName, __METHOD__); + } + + return $this->getUniqueConstraintColumns($tableName); + } + + /** + * @return iterable + * + * @throws Exception + */ + private function getUniqueConstraintColumns(?string $tableName): iterable + { + // The schema name is passed multiple times in the WHERE clause instead of using a JOIN condition to avoid + // performance issues on MySQL older than 8.0 and the corresponding MariaDB versions caused by + // https://bugs.mysql.com/bug.php?id=81347 + $conditions = ['tc.TABLE_SCHEMA = ?', 'kcu.TABLE_SCHEMA = ?']; + $params = [$this->databaseName, $this->databaseName]; + + if ($tableName !== null) { + $conditions[] = 'tc.TABLE_NAME = ?'; + $params[] = $tableName; + } + + // On MySQL < 8.0 and MariaDB, information_schema compares object names case-insensitively and so + // conflates table names that differ only in case. The binary comparison prevents that. + $sql = sprintf( + <<<'SQL' + SELECT tc.TABLE_NAME, + tc.CONSTRAINT_NAME, + kcu.COLUMN_NAME + FROM information_schema.TABLE_CONSTRAINTS tc + INNER JOIN information_schema.KEY_COLUMN_USAGE kcu + ON kcu.TABLE_NAME = tc.TABLE_NAME + AND CONVERT(kcu.TABLE_NAME USING binary) = CONVERT(tc.TABLE_NAME USING binary) + AND kcu.CONSTRAINT_NAME = tc.CONSTRAINT_NAME + WHERE %s + AND tc.CONSTRAINT_TYPE = 'UNIQUE' + ORDER BY tc.TABLE_NAME, + tc.CONSTRAINT_NAME, + kcu.ORDINAL_POSITION + SQL, + implode(' AND ', $conditions), + ); + + foreach ($this->connection->iterateNumeric($sql, $params) as $row) { + yield new UniqueConstraintColumnMetadataRow( + schemaName: null, + tableName: $row[0], + id: null, + name: $row[1], + columnName: $row[2], + ); + } + } + /** {@inheritDoc} */ public function getForeignKeyConstraintColumnsForAllTables(): iterable { diff --git a/core/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php b/core/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php index ad804b36aa..72266862bb 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php +++ b/core/vendor/doctrine/dbal/src/Platforms/MySQLPlatform.php @@ -30,8 +30,10 @@ class MySQLPlatform extends AbstractMySQLPlatform */ public function getDefaultValueDeclarationSQL(array $column): string { - if ($column['type'] instanceof TextType || $column['type'] instanceof BlobType) { - unset($column['default']); + $type = $this->getColumnTypeOrNull($column); + + if ($type instanceof TextType || $type instanceof BlobType) { + $column['default'] = null; } return parent::getDefaultValueDeclarationSQL($column); diff --git a/core/vendor/doctrine/dbal/src/Platforms/Oracle/OracleMetadataProvider.php b/core/vendor/doctrine/dbal/src/Platforms/Oracle/OracleMetadataProvider.php index eea1581233..864bd54a4e 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/Oracle/OracleMetadataProvider.php +++ b/core/vendor/doctrine/dbal/src/Platforms/Oracle/OracleMetadataProvider.php @@ -21,6 +21,7 @@ use Doctrine\DBAL\Schema\Metadata\SequenceMetadataRow; use Doctrine\DBAL\Schema\Metadata\TableColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\TableMetadataRow; +use Doctrine\DBAL\Schema\Metadata\UniqueConstraintColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\ViewMetadataRow; use Doctrine\DBAL\Types\Exception\TypesException; @@ -381,6 +382,71 @@ private function getPrimaryKeyConstraintColumns(?string $tableName): iterable } } + /** + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForAllTables(): iterable + { + return $this->getUniqueConstraintColumns(null); + } + + /** + * @param ?non-empty-string $schemaName + * @param non-empty-string $tableName + * + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForTable(?string $schemaName, string $tableName): iterable + { + if ($schemaName !== null) { + throw UnsupportedName::fromNonNullSchemaName($schemaName, __METHOD__); + } + + return $this->getUniqueConstraintColumns($tableName); + } + + /** + * @return iterable + * + * @throws Exception + */ + private function getUniqueConstraintColumns(?string $tableName): iterable + { + $params = []; + + $sql = sprintf( + <<<'SQL' + SELECT C.TABLE_NAME, + C.CONSTRAINT_NAME, + CC.COLUMN_NAME + FROM USER_CONSTRAINTS C + JOIN USER_CONS_COLUMNS CC + ON CC.TABLE_NAME = C.TABLE_NAME + AND CC.CONSTRAINT_NAME = C.CONSTRAINT_NAME + WHERE %s + AND C.CONSTRAINT_TYPE = 'U' + ORDER BY C.TABLE_NAME, + C.CONSTRAINT_NAME, + CC.POSITION + SQL, + $this->buildTableQueryPredicate('C', $tableName, $params), + ); + + foreach ($this->connection->iterateNumeric($sql, $params) as $row) { + yield new UniqueConstraintColumnMetadataRow( + schemaName: null, + tableName: $row[0], + id: null, + name: $row[1], + columnName: $row[2], + ); + } + } + /** {@inheritDoc} */ public function getForeignKeyConstraintColumnsForAllTables(): iterable { diff --git a/core/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php b/core/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php index a2b555e6d2..99ec1366aa 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php +++ b/core/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php @@ -337,12 +337,10 @@ protected function _getCreateTableSQL(string $name, array $columns, array $optio } if ( - ! isset($column['autoincrement']) || $column['autoincrement'] === false + isset($column['autoincrement']) && $column['autoincrement'] !== false ) { - continue; + $sql = array_merge($sql, $this->getCreateAutoincrementSql($column['name'], $name)); } - - $sql = array_merge($sql, $this->getCreateAutoincrementSql($column['name'], $name)); } foreach ($indexes as $index) { @@ -579,18 +577,16 @@ public function getAlterTableSQL(TableDiff $diff): array $tableNameSQL = $diff->getOldTable()->getQuotedName($this); foreach ($diff->getAddedColumns() as $column) { - $addColumnSQL[] = $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + $addColumnSQL[] = $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray(true)); $comment = $column->getComment(); - if ($comment === '') { - continue; + if ($comment !== '') { + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $column->getQuotedName($this), + $comment, + ); } - - $commentsSQL[] = $this->getCommentOnColumnSQL( - $tableNameSQL, - $column->getQuotedName($this), - $comment, - ); } if (count($addColumnSQL) > 0) { @@ -618,7 +614,7 @@ public function getAlterTableSQL(TableDiff $diff): array // Oracle only supports binary type columns with variable length. // Avoids unnecessary table alteration statements. if ( - $newColumn->getType() instanceof BinaryType && + $this->getColumnType($newColumn) instanceof BinaryType && $columnDiff->hasFixedChanged() && $countChangedProperties === 1 ) { @@ -631,9 +627,9 @@ public function getAlterTableSQL(TableDiff $diff): array * Do not add query part if only comment has changed */ if ($countChangedProperties > ($columnHasChangedComment ? 1 : 0)) { - $newColumnProperties = $newColumn->toArray(); + $newColumnProperties = $newColumn->toArray(true); - $oldSQL = $this->getColumnDeclarationSQL('', $oldColumn->toArray()); + $oldSQL = $this->getColumnDeclarationSQL('', $oldColumn->toArray(true)); $newSQL = $this->getColumnDeclarationSQL('', $newColumnProperties); if ($newSQL !== $oldSQL) { @@ -646,15 +642,13 @@ public function getAlterTableSQL(TableDiff $diff): array } } - if (! $columnDiff->hasCommentChanged()) { - continue; + if ($columnDiff->hasCommentChanged()) { + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $newColumn->getQuotedName($this), + $newColumn->getComment(), + ); } - - $commentsSQL[] = $this->getCommentOnColumnSQL( - $tableNameSQL, - $newColumn->getQuotedName($this), - $newColumn->getComment(), - ); } if (count($modifyColumnSQL) > 0) { @@ -696,7 +690,7 @@ public function getColumnDeclarationSQL(string $name, array $column): string $notnull = $column['notnull'] ? ' NOT NULL' : ' NULL'; } - $typeDecl = $column['type']->getSQLDeclaration($column, $this); + $typeDecl = $this->getColumnType($column)->getSQLDeclaration($column, $this); $declaration = $typeDecl . $default . $notnull; } diff --git a/core/vendor/doctrine/dbal/src/Platforms/PostgreSQL/Comparator.php b/core/vendor/doctrine/dbal/src/Platforms/PostgreSQL/Comparator.php new file mode 100644 index 0000000000..57d1af7f86 --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Platforms/PostgreSQL/Comparator.php @@ -0,0 +1,44 @@ +normalizeColumns($oldTable), + $this->normalizeColumns($newTable), + ); + } + + private function normalizeColumns(Table $table): Table + { + $table = clone $table; + + foreach ($table->getColumns() as $column) { + $options = $column->getPlatformOptions(); + + if (! isset($options['collation']) || $options['collation'] !== 'default') { + continue; + } + + unset($options['collation']); + $column->setPlatformOptions($options); + } + + return $table; + } +} diff --git a/core/vendor/doctrine/dbal/src/Platforms/PostgreSQL/PostgreSQLMetadataProvider.php b/core/vendor/doctrine/dbal/src/Platforms/PostgreSQL/PostgreSQLMetadataProvider.php index 6b6e91a192..a3642f6b8d 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/PostgreSQL/PostgreSQLMetadataProvider.php +++ b/core/vendor/doctrine/dbal/src/Platforms/PostgreSQL/PostgreSQLMetadataProvider.php @@ -21,6 +21,7 @@ use Doctrine\DBAL\Schema\Metadata\SequenceMetadataRow; use Doctrine\DBAL\Schema\Metadata\TableColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\TableMetadataRow; +use Doctrine\DBAL\Schema\Metadata\UniqueConstraintColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\ViewMetadataRow; use Doctrine\DBAL\Types\Exception\TypesException; @@ -479,6 +480,88 @@ private function getPrimaryKeyConstraintColumns(?string $schemaName, ?string $ta } } + /** + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForAllTables(): iterable + { + return $this->getUniqueConstraintColumns(null, null); + } + + /** + * @param ?non-empty-string $schemaName + * @param non-empty-string $tableName + * + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForTable(?string $schemaName, string $tableName): iterable + { + if ($schemaName === null) { + throw UnsupportedName::fromNullSchemaName(__METHOD__); + } + + return $this->getUniqueConstraintColumns($schemaName, $tableName); + } + + /** + * @link https://www.postgresql.org/docs/current/catalog-pg-namespace.html + * @link https://www.postgresql.org/docs/current/catalog-pg-class.html + * @link https://www.postgresql.org/docs/current/catalog-pg-constraint.html + * @link https://www.postgresql.org/docs/current/catalog-pg-index.html + * + * @return iterable + * + * @throws Exception + */ + private function getUniqueConstraintColumns(?string $schemaName, ?string $tableName): iterable + { + $params = []; + + $sql = sprintf( + <<<'SQL' + SELECT n.nspname, + c.relname, + ct.conname, + a.attname + FROM pg_namespace n + INNER JOIN pg_class c + ON c.relnamespace = n.oid + INNER JOIN pg_constraint ct + ON ct.conrelid = c.oid + INNER JOIN pg_index i + ON i.indrelid = c.oid + AND i.indexrelid = ct.conindid + INNER JOIN LATERAL unnest(i.indkey) WITH ORDINALITY AS keys(attnum, ord) + ON true + INNER JOIN + pg_attribute a + ON a.attrelid = c.oid + AND a.attnum = keys.attnum + WHERE %s + AND ct.contype = 'u' + ORDER BY n.nspname, + c.relname, + ct.conname, + keys.ord + SQL, + $this->buildTableQueryPredicate('n', $schemaName, 'c', $tableName, $params), + ); + + foreach ($this->connection->iterateNumeric($sql, $params) as $row) { + yield new UniqueConstraintColumnMetadataRow( + schemaName: $row[0], + tableName: $row[1], + id: null, + name: $row[2], + columnName: $row[3], + ); + } + } + /** {@inheritDoc} */ public function getForeignKeyConstraintColumnsForAllTables(): iterable { diff --git a/core/vendor/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php b/core/vendor/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php index 34275cff0d..054bf2f0bf 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php +++ b/core/vendor/doctrine/dbal/src/Platforms/PostgreSQLPlatform.php @@ -44,6 +44,9 @@ */ class PostgreSQLPlatform extends AbstractPlatform { + /** @see https://www.postgresql.org/docs/current/collation.html */ + private const DEFAULT_COLLATION = 'default'; + private bool $useBooleanTrueFalseStrings = true; /** @var string[][] PostgreSQL booleans literals */ @@ -214,22 +217,20 @@ public function getAlterTableSQL(TableDiff $diff): array foreach ($diff->getAddedColumns() as $addedColumn) { $query = 'ADD ' . $this->getColumnDeclarationSQL( $addedColumn->getQuotedName($this), - $addedColumn->toArray(), + $addedColumn->toArray(true), ); $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; $comment = $addedColumn->getComment(); - if ($comment === '') { - continue; + if ($comment !== '') { + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $addedColumn->getQuotedName($this), + $comment, + ); } - - $commentsSQL[] = $this->getCommentOnColumnSQL( - $tableNameSQL, - $addedColumn->getQuotedName($this), - $comment, - ); } foreach ($diff->getDroppedColumns() as $droppedColumn) { @@ -253,15 +254,25 @@ public function getAlterTableSQL(TableDiff $diff): array $newTypeSQLDeclaration = $this->getTypeSQLDeclaration($newColumn); $oldTypeSQLDeclaration = $this->getTypeSQLDeclaration($oldColumn); - if ($oldTypeSQLDeclaration !== $newTypeSQLDeclaration) { + + $newCollation = $newColumn->getCollation() ?? self::DEFAULT_COLLATION; + $oldCollation = $oldColumn->getCollation() ?? self::DEFAULT_COLLATION; + + $typeChanged = $oldTypeSQLDeclaration !== $newTypeSQLDeclaration; + $collationChanged = $oldCollation !== $newCollation; + if ($typeChanged || $collationChanged) { $query = 'ALTER ' . $newColumnName . ' TYPE ' . $newTypeSQLDeclaration; + if (! $typeChanged || $newCollation !== self::DEFAULT_COLLATION) { + $query .= ' ' . $this->getColumnCollationDeclarationSQL($newCollation); + } + $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; } if ($columnDiff->hasDefaultChanged()) { $defaultClause = $newColumn->getDefault() === null ? ' DROP DEFAULT' - : ' SET' . $this->getDefaultValueDeclarationSQL($newColumn->toArray()); + : ' SET' . $this->getDefaultValueDeclarationSQL($newColumn->toArray(true)); $query = 'ALTER ' . $newColumnName . $defaultClause; $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ' . $query; @@ -282,15 +293,13 @@ public function getAlterTableSQL(TableDiff $diff): array $sql[] = 'ALTER TABLE ' . $tableNameSQL . ' ALTER ' . $newColumnName . ' ' . $query; } - if (! $columnDiff->hasCommentChanged()) { - continue; + if ($columnDiff->hasCommentChanged()) { + $commentsSQL[] = $this->getCommentOnColumnSQL( + $tableNameSQL, + $newColumn->getQuotedName($this), + $newColumn->getComment(), + ); } - - $commentsSQL[] = $this->getCommentOnColumnSQL( - $tableNameSQL, - $newColumn->getQuotedName($this), - $newColumn->getComment(), - ); } return array_merge( @@ -303,10 +312,10 @@ public function getAlterTableSQL(TableDiff $diff): array private function getTypeSQLDeclaration(Column $column): string { - $type = $column->getType(); + $type = $this->getColumnType($column); // SERIAL/BIGSERIAL are not "real" types and we can't alter a column to that type - $columnDefinition = $column->toArray(); + $columnDefinition = $column->toArray(true); $columnDefinition['autoincrement'] = false; return $type->getSQLDeclaration($columnDefinition, $this); diff --git a/core/vendor/doctrine/dbal/src/Platforms/SQLServer/SQLServerMetadataProvider.php b/core/vendor/doctrine/dbal/src/Platforms/SQLServer/SQLServerMetadataProvider.php index 1835e6a5ed..050bab87cc 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/SQLServer/SQLServerMetadataProvider.php +++ b/core/vendor/doctrine/dbal/src/Platforms/SQLServer/SQLServerMetadataProvider.php @@ -21,6 +21,7 @@ use Doctrine\DBAL\Schema\Metadata\SequenceMetadataRow; use Doctrine\DBAL\Schema\Metadata\TableColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\TableMetadataRow; +use Doctrine\DBAL\Schema\Metadata\UniqueConstraintColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\ViewMetadataRow; use Doctrine\DBAL\Types\Exception\TypesException; @@ -412,6 +413,80 @@ private function getPrimaryKeyConstraintColumns(?string $schemaName, ?string $ta } } + /** + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForAllTables(): iterable + { + return $this->getUniqueConstraintColumns(null, null); + } + + /** + * @param ?non-empty-string $schemaName + * @param non-empty-string $tableName + * + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForTable(?string $schemaName, string $tableName): iterable + { + if ($schemaName === null) { + throw UnsupportedName::fromNullSchemaName(__METHOD__); + } + + return $this->getUniqueConstraintColumns($schemaName, $tableName); + } + + /** + * @return iterable + * + * @throws Exception + */ + private function getUniqueConstraintColumns(?string $schemaName, ?string $tableName): iterable + { + $params = []; + + $sql = sprintf( + <<<'SQL' + SELECT s.name, + t.name, + i.name, + c.name + FROM sys.schemas s + INNER JOIN sys.tables t + ON t.schema_id = s.schema_id + INNER JOIN sys.indexes i + ON i.object_id = t.object_id + AND i.is_unique_constraint = 1 + INNER JOIN sys.index_columns ic + ON ic.object_id = t.object_id + AND ic.index_id = i.index_id + INNER JOIN sys.columns c + ON c.object_id = t.object_id + AND c.column_id = ic.column_id + WHERE %s + ORDER BY s.name, + t.name, + i.name, + ic.key_ordinal + SQL, + $this->buildTableQueryPredicate('s', $schemaName, 't', $tableName, $params), + ); + + foreach ($this->connection->iterateNumeric($sql, $params) as $row) { + yield new UniqueConstraintColumnMetadataRow( + schemaName: $row[0], + tableName: $row[1], + id: null, + name: $row[2], + columnName: $row[3], + ); + } + } + /** {@inheritDoc} */ public function getForeignKeyConstraintColumnsForAllTables(): iterable { diff --git a/core/vendor/doctrine/dbal/src/Platforms/SQLServerPlatform.php b/core/vendor/doctrine/dbal/src/Platforms/SQLServerPlatform.php index 160a49772a..cd24e08f04 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/SQLServerPlatform.php +++ b/core/vendor/doctrine/dbal/src/Platforms/SQLServerPlatform.php @@ -50,6 +50,8 @@ /** * Provides the behavior, features and SQL dialect of the Microsoft SQL Server database platform * of the oldest supported version. + * + * @phpstan-import-type ColumnProperties from Column */ class SQLServerPlatform extends AbstractPlatform { @@ -208,8 +210,10 @@ protected function _getCreateTableSQL(string $name, array $columns, array $optio ' ADD' . $this->getDefaultConstraintDeclarationSQL($column); } - if (! empty($column['comment']) || is_numeric($column['comment'])) { - $commentsSql[] = $this->getCreateColumnCommentSQL($name, $column['name'], $column['comment']); + $comment = $column['comment'] ?? ''; + + if (! empty($comment) || is_numeric($comment)) { + $commentsSql[] = $this->getCreateColumnCommentSQL($name, $column['name'], $comment); } } @@ -325,7 +329,7 @@ protected function getCreateColumnCommentSQL(string $tableName, string $columnNa * * @internal The method should be only used by the {@see SQLServerPlatform} class. * - * @param mixed[] $column Column definition. + * @param ColumnProperties $column Column definition. */ protected function getDefaultConstraintDeclarationSQL(array $column): string { @@ -393,7 +397,7 @@ public function getAlterTableSQL(TableDiff $diff): array $tableName = $table->getName(); foreach ($diff->getAddedColumns() as $column) { - $columnProperties = $column->toArray(); + $columnProperties = $column->toArray(true); $addColumnSql = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnProperties); @@ -405,15 +409,13 @@ public function getAlterTableSQL(TableDiff $diff): array $comment = $column->getComment(); - if ($comment === '') { - continue; + if ($comment !== '') { + $commentsSql[] = $this->getCreateColumnCommentSQL( + $tableName, + $column->getQuotedName($this), + $comment, + ); } - - $commentsSql[] = $this->getCreateColumnCommentSQL( - $tableName, - $column->getQuotedName($this), - $comment, - ); } foreach ($diff->getDroppedColumns() as $column) { @@ -471,8 +473,8 @@ public function getAlterTableSQL(TableDiff $diff): array $columnNameSQL = $newColumn->getQuotedName($this); - $newDeclarationSQL = $this->getColumnDeclarationSQL($columnNameSQL, $newColumn->toArray()); - $oldDeclarationSQL = $this->getColumnDeclarationSQL($columnNameSQL, $oldColumn->toArray()); + $newDeclarationSQL = $this->getColumnDeclarationSQL($columnNameSQL, $newColumn->toArray(true)); + $oldDeclarationSQL = $this->getColumnDeclarationSQL($columnNameSQL, $oldColumn->toArray(true)); $declarationSQLChanged = $newDeclarationSQL !== $oldDeclarationSQL; $defaultChanged = $columnDiff->hasDefaultChanged(); @@ -492,13 +494,11 @@ public function getAlterTableSQL(TableDiff $diff): array } if ( - $newColumn->getDefault() === null - || (! $requireDropDefaultConstraint && ! $defaultChanged) + $newColumn->getDefault() !== null + && ($requireDropDefaultConstraint || $defaultChanged) ) { - continue; + $queryParts[] = $this->getAlterTableAddDefaultConstraintClause($tableName, $newColumn); } - - $queryParts[] = $this->getAlterTableAddDefaultConstraintClause($tableName, $newColumn); } foreach ($queryParts as $query) { @@ -526,7 +526,7 @@ public function getRenameTableSQL(string $oldName, string $newName): string */ private function getAlterTableAddDefaultConstraintClause(string $tableName, Column $column): string { - $columnDef = $column->toArray(); + $columnDef = $column->toArray(true); $columnDef['name'] = $column->getQuotedName($this); return 'ADD' . $this->getDefaultConstraintDeclarationSQL($columnDef); @@ -1248,7 +1248,7 @@ public function getColumnDeclarationSQL(string $name, array $column): string $notnull = ! empty($column['notnull']) ? ' NOT NULL' : ''; - $typeDecl = $column['type']->getSQLDeclaration($column, $this); + $typeDecl = $this->getColumnType($column)->getSQLDeclaration($column, $this); $declaration = $typeDecl . $collation . $notnull; } @@ -1269,8 +1269,8 @@ public function columnsEqual(Column $column1, Column $column2): bool return false; } - return $this->getDefaultValueDeclarationSQL($column1->toArray()) - === $this->getDefaultValueDeclarationSQL($column2->toArray()); + return $this->getDefaultValueDeclarationSQL($column1->toArray(true)) + === $this->getDefaultValueDeclarationSQL($column2->toArray(true)); } /** diff --git a/core/vendor/doctrine/dbal/src/Platforms/SQLite/SQLiteMetadataProvider.php b/core/vendor/doctrine/dbal/src/Platforms/SQLite/SQLiteMetadataProvider.php index 04ed05421d..99914a5117 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/SQLite/SQLiteMetadataProvider.php +++ b/core/vendor/doctrine/dbal/src/Platforms/SQLite/SQLiteMetadataProvider.php @@ -21,6 +21,7 @@ use Doctrine\DBAL\Schema\Metadata\PrimaryKeyConstraintColumnRow; use Doctrine\DBAL\Schema\Metadata\TableColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\TableMetadataRow; +use Doctrine\DBAL\Schema\Metadata\UniqueConstraintColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\ViewMetadataRow; use Doctrine\DBAL\Types\Exception\TypesException; use Doctrine\DBAL\Types\Types; @@ -397,6 +398,101 @@ private function getPrimaryKeyConstraintColumns(?string $tableName): iterable } } + /** + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForAllTables(): iterable + { + return $this->getUniqueConstraintColumns(null); + } + + /** + * @param ?non-empty-string $schemaName + * @param non-empty-string $tableName + * + * @return iterable + * + * @throws Exception + */ + public function getUniqueConstraintColumnsForTable(?string $schemaName, string $tableName): iterable + { + if ($schemaName !== null) { + throw UnsupportedName::fromNonNullSchemaName($schemaName, __METHOD__); + } + + return $this->getUniqueConstraintColumns($tableName); + } + + /** + * @return iterable + * + * @throws Exception + */ + private function getUniqueConstraintColumns(?string $tableName): iterable + { + $params = []; + + $sql = sprintf( + <<<'SQL' + SELECT t.name, + i.name, + c.name + FROM sqlite_master t + JOIN pragma_index_list(t.name) i + JOIN pragma_index_info(i.name) c + WHERE %s + AND i.origin = 'u' + ORDER BY t.name, + i.seq DESC, + c.seqno + SQL, + $this->buildTableQueryPredicate($tableName, $params), + ); + + $currentTableName = null; + $currentIndexName = null; + $constraintNames = []; + $position = -1; + + foreach ($this->connection->iterateNumeric($sql, $params) as $row) { + if ($row[0] !== $currentTableName) { + $currentTableName = $row[0]; + $constraintNames = $this->getUniqueConstraintNames($row[0]); + $currentIndexName = null; + $position = -1; + } + + if ($row[1] !== $currentIndexName) { + $currentIndexName = $row[1]; + $position++; + } + + yield new UniqueConstraintColumnMetadataRow( + schemaName: null, + tableName: $row[0], + id: $row[1], + name: $constraintNames[$position] ?? null, + columnName: $row[2], + ); + } + } + + /** + * @return list + * + * @throws Exception + */ + private function getUniqueConstraintNames(string $tableName): array + { + $sql = $this->getCreateTableSQL($tableName); + + preg_match_all('#(?:CONSTRAINT\s+(\S+)\s+)?UNIQUE\b#i', $sql, $matches); + + return array_map($this->parseOptionallyQuotedName(...), $matches[1]); + } + /** {@inheritDoc} */ public function getForeignKeyConstraintColumnsForAllTables(): iterable { @@ -630,11 +726,11 @@ public function getTableOptionsForTable( private function getTableOptions(iterable $tableNames): iterable { foreach ($tableNames as $tableName) { + $createSQL = $this->getCreateTableSQL($tableName); + yield new TableMetadataRow(null, $tableName, [ - 'comment' => $this->parseTableCommentFromSQL( - $tableName, - $this->getCreateTableSQL($tableName), - ), + 'comment' => $this->parseTableCommentFromSQL($tableName, $createSQL), + 'without_rowid' => $this->parseWithoutRowidFromSQL($createSQL), ]); } } @@ -681,6 +777,15 @@ private function parseTableCommentFromSQL(string $table, string $sql): ?string return $comment === '' ? null : $comment; } + private function parseWithoutRowidFromSQL(string $sql): bool + { + if (preg_match('/\)[^)]*$/s', $sql, $match) !== 1) { + return false; + } + + return preg_match('/\bWITHOUT\s+ROWID\b/i', $match[0]) === 1; + } + /** {@inheritDoc} */ public function getAllViews(): iterable { diff --git a/core/vendor/doctrine/dbal/src/Platforms/SQLitePlatform.php b/core/vendor/doctrine/dbal/src/Platforms/SQLitePlatform.php index 6fcf04883f..bc6fb540e6 100644 --- a/core/vendor/doctrine/dbal/src/Platforms/SQLitePlatform.php +++ b/core/vendor/doctrine/dbal/src/Platforms/SQLitePlatform.php @@ -10,6 +10,7 @@ use Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords; use Doctrine\DBAL\Platforms\SQLite\SQLiteMetadataProvider; use Doctrine\DBAL\Schema\Column; +use Doctrine\DBAL\Schema\DefaultExpression; use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist; use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\Identifier; @@ -298,7 +299,13 @@ protected function _getCreateTableSQL(string $name, array $columns, array $optio $tableComment = $this->getInlineCommentSQL($options['comment']); } - $query = ['CREATE TABLE ' . $name . ' ' . $tableComment . '(' . $queryFields . ')']; + $sql = 'CREATE TABLE ' . $name . ' ' . $tableComment . '(' . $queryFields . ')'; + + if (isset($options['without_rowid']) && $options['without_rowid'] === true) { + $sql .= ' WITHOUT ROWID'; + } + + $query = [$sql]; if (isset($options['alter']) && $options['alter'] === true) { return $query; @@ -638,15 +645,13 @@ public function getAlterTableSQL(TableDiff $diff): array foreach ($diff->getDroppedColumns() as $column) { $columnName = strtolower($column->getName()); - if (! isset($columns[$columnName])) { - continue; + if (isset($columns[$columnName])) { + unset( + $columns[$columnName], + $oldColumnNames[$columnName], + $newColumnNames[$columnName], + ); } - - unset( - $columns[$columnName], - $oldColumnNames[$columnName], - $newColumnNames[$columnName], - ); } foreach ($diff->getChangedColumns() as $columnDiff) { @@ -757,17 +762,21 @@ private function getSimpleAlterTableSQL(TableDiff $diff): array|false $sql = []; foreach ($diff->getAddedColumns() as $column) { - $definition = $column->toArray(); + $definition = $column->toArray(true); - $type = $definition['type']; + $type = $this->getColumnType($definition); + $default = $column->getDefault(); switch (true) { - case isset($definition['columnDefinition']): - case $definition['autoincrement']: - case $definition['comment'] !== '': - case $type instanceof Types\DateTimeType && $definition['default'] === $this->getCurrentTimestampSQL(): - case $type instanceof Types\DateType && $definition['default'] === $this->getCurrentDateSQL(): - case $type instanceof Types\TimeType && $definition['default'] === $this->getCurrentTimeSQL(): + case $column->getColumnDefinition() !== null: + case $column->getAutoincrement(): + case $column->getComment() !== '': + // A non-constant default expression (e.g. CURRENT_TIMESTAMP) cannot be used with + // ALTER TABLE ... ADD COLUMN on a non-empty table, so fall back to a table rebuild. + case $default instanceof DefaultExpression: + case $type instanceof Types\PhpDateTimeMappingType && $default === $this->getCurrentTimestampSQL(): + case $type instanceof Types\PhpDateMappingType && $default === $this->getCurrentDateSQL(): + case $type instanceof Types\PhpTimeMappingType && $default === $this->getCurrentTimeSQL(): return false; } @@ -832,7 +841,9 @@ private function getIndexesInAlteredTable(TableDiff $diff): array $changed = false; $indexColumns = []; - foreach ($index->getColumns() as $columnName) { + // Use the unquoted column names so the lookup is agnostic of whether the index + // was introspected (which marks its column names as quoted) or built in memory. + foreach ($index->getUnquotedColumns() as $columnName) { $normalizedColumnName = strtolower($columnName); if (! isset($nameMap[$normalizedColumnName])) { unset($indexes[$key]); @@ -845,17 +856,15 @@ private function getIndexesInAlteredTable(TableDiff $diff): array } } - if (! $changed) { - continue; + if ($changed) { + $indexes[$key] = new Index( + $index->getName(), + $indexColumns, + $index->isUnique(), + $index->isPrimary(), + $index->getFlags(), + ); } - - $indexes[$key] = new Index( - $index->getName(), - $indexColumns, - $index->isUnique(), - $index->isPrimary(), - $index->getFlags(), - ); } foreach ($diff->getDroppedIndexes() as $index) { @@ -895,7 +904,9 @@ private function getForeignKeysInAlteredTable(TableDiff $diff): array foreach ($foreignKeys as $key => $constraint) { $changed = false; $localColumns = []; - foreach ($constraint->getLocalColumns() as $columnName) { + // Use the unquoted column names so the lookup is agnostic of whether the constraint + // was introspected (which marks its column names as quoted) or built in memory. + foreach ($constraint->getUnquotedLocalColumns() as $columnName) { $normalizedColumnName = strtolower($columnName); if (! isset($nameMap[$normalizedColumnName])) { unset($foreignKeys[$key]); @@ -908,17 +919,15 @@ private function getForeignKeysInAlteredTable(TableDiff $diff): array } } - if (! $changed) { - continue; + if ($changed) { + $foreignKeys[$key] = new ForeignKeyConstraint( + $localColumns, // @phpstan-ignore argument.type + $constraint->getForeignTableName(), + $constraint->getForeignColumns(), // @phpstan-ignore argument.type + $constraint->getName(), + $constraint->getOptions(), + ); } - - $foreignKeys[$key] = new ForeignKeyConstraint( - $localColumns, // @phpstan-ignore argument.type - $constraint->getForeignTableName(), - $constraint->getForeignColumns(), // @phpstan-ignore argument.type - $constraint->getName(), - $constraint->getOptions(), - ); } foreach ($diff->getDroppedForeignKeys() as $constraint) { diff --git a/core/vendor/doctrine/dbal/src/Query/Join.php b/core/vendor/doctrine/dbal/src/Query/Join.php index 7373a89054..173c612ad1 100644 --- a/core/vendor/doctrine/dbal/src/Query/Join.php +++ b/core/vendor/doctrine/dbal/src/Query/Join.php @@ -29,4 +29,9 @@ public static function right(string $table, string $alias, ?string $condition): { return new self('RIGHT', $table, $alias, $condition); } + + public static function full(string $table, string $alias, ?string $condition): Join + { + return new self('FULL', $table, $alias, $condition); + } } diff --git a/core/vendor/doctrine/dbal/src/Query/QueryBuilder.php b/core/vendor/doctrine/dbal/src/Query/QueryBuilder.php index 77e0b972b2..a11f756109 100644 --- a/core/vendor/doctrine/dbal/src/Query/QueryBuilder.php +++ b/core/vendor/doctrine/dbal/src/Query/QueryBuilder.php @@ -891,6 +891,32 @@ public function rightJoin(string $fromAlias, string $join, string $alias, ?strin return $this; } + /** + * Creates and adds a full join to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->fullJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); + * + * + * @param string $fromAlias The alias that points to a from clause. + * @param string $join The table name to join. + * @param string $alias The alias of the join table. + * @param string|null $condition The condition for the join. + * + * @return $this This QueryBuilder instance. + */ + public function fullJoin(string $fromAlias, string $join, string $alias, ?string $condition = null): self + { + $this->join[$fromAlias][] = Join::full($join, $alias, $condition); + + $this->sql = null; + + return $this; + } + /** * Sets a new value for a column in a bulk update query. * diff --git a/core/vendor/doctrine/dbal/src/SQL/Parser.php b/core/vendor/doctrine/dbal/src/SQL/Parser.php index c332a1ee5e..31d485fcbc 100644 --- a/core/vendor/doctrine/dbal/src/SQL/Parser.php +++ b/core/vendor/doctrine/dbal/src/SQL/Parser.php @@ -4,7 +4,6 @@ namespace Doctrine\DBAL\SQL; -use Doctrine\DBAL\SQL\Parser\Exception; use Doctrine\DBAL\SQL\Parser\Exception\RegularExpressionError; use Doctrine\DBAL\SQL\Parser\Visitor; @@ -77,8 +76,6 @@ public function __construct(bool $mySQLStringEscaping) /** * Parses the given SQL statement - * - * @throws Exception */ public function parse(string $sql, Visitor $visitor): void { diff --git a/core/vendor/doctrine/dbal/src/SQL/Parser/Exception.php b/core/vendor/doctrine/dbal/src/SQL/Parser/Exception.php index 0c14b3584c..182c410616 100644 --- a/core/vendor/doctrine/dbal/src/SQL/Parser/Exception.php +++ b/core/vendor/doctrine/dbal/src/SQL/Parser/Exception.php @@ -6,6 +6,11 @@ use Throwable; +/** + * @deprecated The SQL parser does not raise checked exceptions. The only concrete + * implementation, {@see Exception\RegularExpressionError}, is an unchecked + * {@see \RuntimeException} subclass. This interface will be removed in 5.0. + */ interface Exception extends Throwable { } diff --git a/core/vendor/doctrine/dbal/src/Schema/AbstractAsset.php b/core/vendor/doctrine/dbal/src/Schema/AbstractAsset.php index f7d5a2f46e..d953200764 100644 --- a/core/vendor/doctrine/dbal/src/Schema/AbstractAsset.php +++ b/core/vendor/doctrine/dbal/src/Schema/AbstractAsset.php @@ -227,17 +227,15 @@ protected function _setName(string $name): void ); } - if ($this->_namespace === $futureNamespace) { - return; + if ($this->_namespace !== $futureNamespace) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6592', + 'Instead of %s, the namespace in this name will be interpreted as %s in 5.0.', + $this->_namespace !== null ? sprintf('"%s"', $this->_namespace) : 'null', + $futureNamespace !== null ? sprintf('"%s"', $futureNamespace) : 'null', + ); } - - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/6592', - 'Instead of %s, the namespace in this name will be interpreted as %s in 5.0.', - $this->_namespace !== null ? sprintf('"%s"', $this->_namespace) : 'null', - $futureNamespace !== null ? sprintf('"%s"', $futureNamespace) : 'null', - ); } /** diff --git a/core/vendor/doctrine/dbal/src/Schema/AbstractNamedObject.php b/core/vendor/doctrine/dbal/src/Schema/AbstractNamedObject.php index 54fe5124ad..2615967c28 100644 --- a/core/vendor/doctrine/dbal/src/Schema/AbstractNamedObject.php +++ b/core/vendor/doctrine/dbal/src/Schema/AbstractNamedObject.php @@ -10,6 +10,8 @@ /** * An abstract {@see NamedObject}. * + * @internal since doctrine/dbal 4.5, use {@see NamedObject} instead. + * * @template N of Name * @extends AbstractAsset * @implements NamedObject diff --git a/core/vendor/doctrine/dbal/src/Schema/AbstractOptionallyNamedObject.php b/core/vendor/doctrine/dbal/src/Schema/AbstractOptionallyNamedObject.php index c1fe096ad6..cf557064b8 100644 --- a/core/vendor/doctrine/dbal/src/Schema/AbstractOptionallyNamedObject.php +++ b/core/vendor/doctrine/dbal/src/Schema/AbstractOptionallyNamedObject.php @@ -9,6 +9,8 @@ /** * An abstract {@see OptionallyNamedObject}. * + * @internal since doctrine/dbal 4.5, use {@see OptionallyNamedObject} instead. + * * @template N of Name * @extends AbstractAsset * @implements OptionallyNamedObject diff --git a/core/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php b/core/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php index 134c335af1..58e78bc465 100644 --- a/core/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php +++ b/core/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php @@ -252,19 +252,17 @@ public function listTables(): array ->toTableConfiguration(); foreach ($tableColumnsByTable as $tableName => $tableColumns) { - if (! $filter($tableName)) { - continue; + if ($filter($tableName)) { + $tables[] = new Table( + $tableName, + $this->_getPortableTableColumnList($tableName, $database, $tableColumns), + $this->_getPortableTableIndexesList($indexColumnsByTable[$tableName] ?? [], $tableName), + [], + $this->_getPortableTableForeignKeysList($foreignKeyColumnsByTable[$tableName] ?? []), + $tableOptionsByTable[$tableName] ?? [], + $configuration, + ); } - - $tables[] = new Table( - $tableName, - $this->_getPortableTableColumnList($tableName, $database, $tableColumns), - $this->_getPortableTableIndexesList($indexColumnsByTable[$tableName] ?? [], $tableName), - [], - $this->_getPortableTableForeignKeysList($foreignKeyColumnsByTable[$tableName] ?? []), - $tableOptionsByTable[$tableName] ?? [], - $configuration, - ); } return $tables; @@ -324,10 +322,8 @@ protected function normalizeName(string $name): string private function validateTableName(string $input, string $methodName): void { - $parser = Parsers::getOptionallyQualifiedNameParser(); - try { - $tableName = $parser->parse($input); + $tableName = Parsers::parseOptionallyQualifiedName($input); } catch (Throwable $e) { Deprecation::trigger( 'doctrine/dbal', @@ -340,18 +336,16 @@ private function validateTableName(string $input, string $methodName): void return; } - if ($tableName->getQualifier() === null || $this->platform->supportsSchemas()) { - return; + if ($tableName->getQualifier() !== null && ! $this->platform->supportsSchemas()) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6768', + 'Relying on %s() not parsing an unquoted table name containing a dot while working with %s is' + . ' deprecated. Pass a quoted name instead.', + $methodName, + $this->platform::class, + ); } - - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/6768', - 'Relying on %s() not parsing an unquoted table name containing a dot while working with %s is' - . ' deprecated. Pass a quoted name instead.', - $methodName, - $this->platform::class, - ); } /** @@ -665,6 +659,7 @@ private function introspectTable0(OptionallyQualifiedName $tableName): Table ->setColumns(...$columns) ->setPrimaryKeyConstraint($this->introspectTablePrimaryKeyConstraint($tableName)) ->setIndexes(...$this->introspectTableIndexes($tableName)) + ->setUniqueConstraints(...$this->introspectTableUniqueConstraints($tableName)) ->setForeignKeyConstraints(...$this->introspectTableForeignKeyConstraints($tableName)) ->setOptions($options) ->create(); @@ -844,6 +839,72 @@ static function ( ); } + /** + * Introspects the unique constraints of a given table and returns their definitions. If the name is unqualified, + * and the underlying database platform supports schemas, the current schema is used. + * + * Returns an empty value if the table does not exist. + * + * @return list + * + * @throws Exception + */ + public function introspectTableUniqueConstraints(OptionallyQualifiedName $tableName): array + { + return $this->introspectTableObjects( + $tableName, + static function (SchemaProvider $schemaProvider, ?string $schemaName, string $tableName): array { + return $schemaProvider->getUniqueConstraintsForTable($schemaName, $tableName); + }, + ); + } + + /** + * Introspects the unique constraints of the table with the given unquoted name and schema name and returns their + * definitions. If the name is unqualified, and the underlying database platform supports schemas, the current + * schema is used. + * + * Returns an empty value if the table does not exist. + * + * @param non-empty-string $tableName + * @param ?non-empty-string $schemaName + * + * @return list + * + * @throws Exception + */ + public function introspectTableUniqueConstraintsByUnquotedName( + string $tableName, + ?string $schemaName = null, + ): array { + return $this->introspectTableUniqueConstraints( + OptionallyQualifiedName::unquoted($tableName, $schemaName), + ); + } + + /** + * Introspects the unique constraints of the table with the given quoted name and schema name and returns their + * definitions. If the name is unqualified, and the underlying database platform supports schemas, the current + * schema is used. + * + * Returns an empty value if the table does not exist. + * + * @param non-empty-string $tableName + * @param ?non-empty-string $schemaName + * + * @return list + * + * @throws Exception + */ + public function introspectTableUniqueConstraintsByQuotedName( + string $tableName, + ?string $schemaName = null, + ): array { + return $this->introspectTableUniqueConstraints( + OptionallyQualifiedName::quoted($tableName, $schemaName), + ); + } + /** * Introspects the foreign key constraints of a given table and returns their definitions. If the name is * unqualified, and the underlying database platform supports schemas, the current schema is used. diff --git a/core/vendor/doctrine/dbal/src/Schema/Column.php b/core/vendor/doctrine/dbal/src/Schema/Column.php index 69035f7bad..5e70b77ccd 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Column.php +++ b/core/vendor/doctrine/dbal/src/Schema/Column.php @@ -9,11 +9,18 @@ use Doctrine\DBAL\Schema\Name\Parser\UnqualifiedNameParser; use Doctrine\DBAL\Schema\Name\Parsers; use Doctrine\DBAL\Schema\Name\UnqualifiedName; +use Doctrine\DBAL\Types\Exception\TypesException; use Doctrine\DBAL\Types\Type; use Doctrine\Deprecations\Deprecation; +use TypeError; use function array_merge; +use function func_get_arg; +use function func_num_args; +use function get_debug_type; +use function is_bool; use function method_exists; +use function sprintf; /** * Object representation of a database column. @@ -22,12 +29,13 @@ * @extends AbstractNamedObject * @phpstan-type ColumnProperties = array{ * name: string, - * type: Type, - * default: mixed, + * type?: Type, // Deprecated; use typeName instead. + * typeName?: string, // Will be required in 5.0 + * default?: mixed, * notnull?: bool, - * autoincrement: bool, - * columnDefinition: ?non-empty-string, - * comment: string, + * autoincrement?: bool, + * columnDefinition?: ?non-empty-string, + * comment?: string, * charset?: ?non-empty-string, * collation?: ?non-empty-string, * } @@ -42,8 +50,11 @@ */ class Column extends AbstractNamedObject { + /** @deprecated use {@see getType()} instead; not initialized when the column is built via {@see setTypeName()} */ protected Type $_type; + private string $_typeName; + protected ?int $_length = null; protected ?int $_precision = null; @@ -75,13 +86,29 @@ class Column extends AbstractNamedObject * @internal Use {@link Column::editor()} to instantiate an editor and {@link ColumnEditor::create()} to create a * column. * + * @param Type|string $type Passing a {@see Type} instance is deprecated; pass the type name instead. * @param array $options + * + * @throws TypesException */ - public function __construct(string $name, Type $type, array $options = []) + public function __construct(string $name, Type|string $type, array $options = []) { parent::__construct($name); - $this->setType($type); + if ($type instanceof Type) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7490', + 'Passing a %s instance to %s() is deprecated, pass the type name instead.', + Type::class, + __METHOD__, + ); + + $this->setType($type); + } else { + $this->setTypeName($type); + } + $this->setOptions($options); } @@ -90,9 +117,20 @@ protected function getNameParser(): UnqualifiedNameParser return Parsers::getUnqualifiedNameParser(); } - /** @param array $options */ + /** + * @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} instead. + * + * @param array $options + */ public function setOptions(array $options): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() instead.', + __METHOD__, + ); + foreach ($options as $name => $value) { $method = 'set' . $name; @@ -106,65 +144,160 @@ public function setOptions(array $options): self return $this; } + /** + * @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setTypeName()} instead. + * + * @throws TypesException + */ public function setType(Type $type): self { - $this->_type = $type; + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setTypeName() instead.', + __METHOD__, + ); + + $this->_type = $type; + $this->_typeName = Type::getTypeRegistry()->lookupName($type); + + return $this; + } + + public function setTypeName(string $typeName): self + { + $this->_typeName = $typeName; + unset($this->_type); return $this; } + /** @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setLength()} instead. */ public function setLength(?int $length): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setLength() instead.', + __METHOD__, + ); + $this->_length = $length; return $this; } + /** @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setPrecision()} instead. */ public function setPrecision(?int $precision): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setPrecision() instead.', + __METHOD__, + ); + $this->_precision = $precision; return $this; } + /** @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setScale()} instead. */ public function setScale(int $scale): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setScale() instead.', + __METHOD__, + ); + $this->_scale = $scale; return $this; } + /** @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setUnsigned()} instead. */ public function setUnsigned(bool $unsigned): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setUnsigned() instead.', + __METHOD__, + ); + $this->_unsigned = $unsigned; return $this; } + /** @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setFixed()} instead. */ public function setFixed(bool $fixed): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setFixed() instead.', + __METHOD__, + ); + $this->_fixed = $fixed; return $this; } + /** @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setNotNull()} instead. */ public function setNotnull(bool $notnull): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setNotNull() instead.', + __METHOD__, + ); + $this->_notnull = $notnull; return $this; } + /** + * @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setDefaultValue()} + * instead. + */ public function setDefault(mixed $default): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setDefaultValue() instead.', + __METHOD__, + ); + $this->_default = $default; return $this; } - /** @param PlatformOptions $platformOptions */ + /** + * @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and the option-specific {@see ColumnEditor} + * methods ({@see ColumnEditor::setCharset()}, {@see ColumnEditor::setCollation()}, + * {@see ColumnEditor::setMinimumValue()}, {@see ColumnEditor::setMaximumValue()}, + * {@see ColumnEditor::setEnumType()}) instead. + * + * @param PlatformOptions $platformOptions + */ public function setPlatformOptions(array $platformOptions): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and the option-specific ColumnEditor methods' + . ' (setCharset(), setCollation(), setMinimumValue(), setMaximumValue(), setEnumType()) instead.', + __METHOD__, + ); + if (isset($platformOptions['jsonb']) && $platformOptions['jsonb']) { Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', @@ -178,9 +311,24 @@ public function setPlatformOptions(array $platformOptions): self return $this; } - /** @param key-of $name */ + /** + * @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and the option-specific {@see ColumnEditor} + * methods ({@see ColumnEditor::setCharset()}, {@see ColumnEditor::setCollation()}, + * {@see ColumnEditor::setMinimumValue()}, {@see ColumnEditor::setMaximumValue()}, + * {@see ColumnEditor::setEnumType()}) instead. + * + * @param key-of $name + */ public function setPlatformOption(string $name, mixed $value): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and the option-specific ColumnEditor methods' + . ' (setCharset(), setCollation(), setMinimumValue(), setMaximumValue(), setEnumType()) instead.', + __METHOD__, + ); + if ($name === 'jsonb' && (bool) $value === true) { Deprecation::triggerIfCalledFromOutside( 'doctrine/dbal', @@ -194,17 +342,52 @@ public function setPlatformOption(string $name, mixed $value): self return $this; } - /** @param ?non-empty-string $value */ + /** + * @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setColumnDefinition()} + * instead. + * + * @param ?non-empty-string $value + */ public function setColumnDefinition(?string $value): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setColumnDefinition() instead.', + __METHOD__, + ); + $this->_columnDefinition = $value; return $this; } + /** + * @deprecated Use {@see getTypeName()} to obtain the type name, or resolve the {@see Type} + * instance from the type registry when needed. + * + * @throws TypesException + */ public function getType(): Type { - return $this->_type; + // Called from toArray() when $skipType is false, which already triggers its own + // deprecation, so triggering unconditionally here would report the same call twice. + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7490', + '%s is deprecated. Use Column::getTypeName() instead.', + __METHOD__, + ); + + return Type::getType($this->_typeName); + } + + /** + * Returns the name of the DBAL type of this column. + */ + public function getTypeName(): string + { + return $this->_typeName; } public function getLength(): ?int @@ -344,15 +527,34 @@ public function getAutoincrement(): bool return $this->_autoincrement; } + /** + * @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setAutoincrement()} + * instead. + */ public function setAutoincrement(bool $flag): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setAutoincrement() instead.', + __METHOD__, + ); + $this->_autoincrement = $flag; return $this; } + /** @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setComment()} instead. */ public function setComment(string $comment): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setComment() instead.', + __METHOD__, + ); + $this->_comment = $comment; return $this; @@ -364,12 +566,21 @@ public function getComment(): string } /** + * @deprecated since doctrine/dbal 4.5. Use {@see Column::editor()} and {@see ColumnEditor::setValues()} instead. + * * @param list $values * * @return $this */ public function setValues(array $values): static { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7381', + '%s is deprecated. Use Column::editor() and ColumnEditor::setValues() instead.', + __METHOD__, + ); + $this->_values = $values; return $this; @@ -381,24 +592,50 @@ public function getValues(): array return $this->_values; } - /** @return ColumnProperties */ - public function toArray(): array - { + /** + * Pass `true` as the first (virtual) argument to omit the resolved {@see Type} instance from the returned array + * and rely on the `typeName` key instead. Omitting the argument is deprecated. + * + * @return ColumnProperties + */ + public function toArray(/* bool $skipType = false */): array + { + $skipType = func_num_args() > 0 ? func_get_arg(0) : false; + if (! is_bool($skipType)) { + // @phpstan-ignore missingType.checkedException + throw new TypeError(sprintf( + 'Argument 1 passed to %s must be a boolean, %s given', + __METHOD__, + get_debug_type($skipType), + )); + } + + if (! $skipType) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7490', + 'Calling %s() without the $skipType argument is deprecated. Pass true to omit the Type instance from ' + . 'the returned array and read the "typeName" key instead.', + __METHOD__, + ); + } + return array_merge([ - 'name' => $this->_name, - 'type' => $this->_type, - 'default' => $this->_default, - 'notnull' => $this->_notnull, - 'length' => $this->_length, - 'precision' => $this->_precision, - 'scale' => $this->_scale, + 'name' => $this->_name, + 'typeName' => $this->_typeName, + 'default' => $this->_default, + 'notnull' => $this->_notnull, + 'length' => $this->_length, + 'precision' => $this->_precision, + 'scale' => $this->_scale, 'fixed' => $this->_fixed, - 'unsigned' => $this->_unsigned, - 'autoincrement' => $this->_autoincrement, + 'unsigned' => $this->_unsigned, + 'autoincrement' => $this->_autoincrement, 'columnDefinition' => $this->_columnDefinition, - 'comment' => $this->_comment, - 'values' => $this->_values, - ], $this->_platformOptions); + 'comment' => $this->_comment, + 'values' => $this->_values, + // @phpstan-ignore missingType.checkedException + ], $skipType ? [] : ['type' => $this->getType()], $this->_platformOptions); } public static function editor(): ColumnEditor @@ -410,7 +647,7 @@ public function edit(): ColumnEditor { return self::editor() ->setName($this->getObjectName()) - ->setType($this->_type) + ->setTypeName($this->_typeName) ->setLength($this->_length) ->setPrecision($this->_precision) ->setScale($this->_scale) diff --git a/core/vendor/doctrine/dbal/src/Schema/ColumnDiff.php b/core/vendor/doctrine/dbal/src/Schema/ColumnDiff.php index 6c86e92164..6de92a9438 100644 --- a/core/vendor/doctrine/dbal/src/Schema/ColumnDiff.php +++ b/core/vendor/doctrine/dbal/src/Schema/ColumnDiff.php @@ -54,7 +54,7 @@ public function hasNameChanged(): bool public function hasTypeChanged(): bool { - return $this->newColumn->getType()::class !== $this->oldColumn->getType()::class; + return $this->newColumn->getTypeName() !== $this->oldColumn->getTypeName(); } public function hasLengthChanged(): bool diff --git a/core/vendor/doctrine/dbal/src/Schema/ColumnEditor.php b/core/vendor/doctrine/dbal/src/Schema/ColumnEditor.php index 1b2cff2c39..4ed2e77524 100644 --- a/core/vendor/doctrine/dbal/src/Schema/ColumnEditor.php +++ b/core/vendor/doctrine/dbal/src/Schema/ColumnEditor.php @@ -9,12 +9,13 @@ use Doctrine\DBAL\Schema\Name\UnqualifiedName; use Doctrine\DBAL\Types\Exception\TypesException; use Doctrine\DBAL\Types\Type; +use Doctrine\Deprecations\Deprecation; final class ColumnEditor { private ?UnqualifiedName $name = null; - private ?Type $type = null; + private ?string $typeName = null; private ?int $length = null; @@ -84,17 +85,28 @@ public function setQuotedName(string $name): self return $this; } + /** + * @deprecated Use {@link setTypeName()} instead. + * + * @throws TypesException + */ public function setType(Type $type): self { - $this->type = $type; + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7490', + '%s is deprecated. Use ColumnEditor::setTypeName() instead.', + __METHOD__, + ); + + $this->typeName = Type::getTypeRegistry()->lookupName($type); return $this; } - /** @throws TypesException */ public function setTypeName(string $typeName): self { - $this->type = Type::getType($typeName); + $this->typeName = $typeName; return $this; } @@ -228,13 +240,14 @@ public function setColumnDefinition(?string $columnDefinition): self return $this; } + /** @throws TypesException */ public function create(): Column { if ($this->name === null) { throw InvalidColumnDefinition::nameNotSpecified(); } - if ($this->type === null) { + if ($this->typeName === null) { throw InvalidColumnDefinition::dataTypeNotSpecified($this->name); } @@ -266,7 +279,7 @@ public function create(): Column return new Column( $this->name->toString(), - $this->type, + $this->typeName, [ 'length' => $this->length, 'precision' => $this->precision, diff --git a/core/vendor/doctrine/dbal/src/Schema/DB2SchemaManager.php b/core/vendor/doctrine/dbal/src/Schema/DB2SchemaManager.php index 5f7b29358a..e0ff66e09e 100644 --- a/core/vendor/doctrine/dbal/src/Schema/DB2SchemaManager.php +++ b/core/vendor/doctrine/dbal/src/Schema/DB2SchemaManager.php @@ -6,7 +6,6 @@ use Doctrine\DBAL\Platforms\DB2Platform; use Doctrine\DBAL\Result; -use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Types; use function array_change_key_case; @@ -98,7 +97,7 @@ protected function _getPortableTableColumnDefinition(array $tableColumn): Column $options['precision'] = $precision; } - return new Column($tableColumn['colname'], Type::getType($type), $options); + return new Column($tableColumn['colname'], $type, $options); } /** diff --git a/core/vendor/doctrine/dbal/src/Schema/Exception/ImproperlyQualifiedName.php b/core/vendor/doctrine/dbal/src/Schema/Exception/ImproperlyQualifiedName.php new file mode 100644 index 0000000000..b43333b069 --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Schema/Exception/ImproperlyQualifiedName.php @@ -0,0 +1,25 @@ +toString())); + } + + public static function fromQualifiedName(OptionallyQualifiedName $name): self + { + return new self(sprintf('Schema uses unqualified names, but %s is qualified.', $name->toString())); + } +} diff --git a/core/vendor/doctrine/dbal/src/Schema/Exception/InvalidSchemaModification.php b/core/vendor/doctrine/dbal/src/Schema/Exception/InvalidSchemaModification.php new file mode 100644 index 0000000000..bfdf281e80 --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Schema/Exception/InvalidSchemaModification.php @@ -0,0 +1,54 @@ +toString())); + } + + public static function tableDoesNotExist(OptionallyQualifiedName $name): self + { + return new self(sprintf('Table %s does not exist in the schema.', $name->toString())); + } + + public static function sequenceAlreadyExists(OptionallyQualifiedName $name): self + { + return new self(sprintf('Sequence %s already exists in the schema.', $name->toString())); + } + + public static function sequenceDoesNotExist(OptionallyQualifiedName $name): self + { + return new self(sprintf('Sequence %s does not exist in the schema.', $name->toString())); + } + + public static function cannotChangeTableQualifier( + OptionallyQualifiedName $oldName, + OptionallyQualifiedName $newName, + ): self { + return new self(sprintf( + 'A table\'s namespace cannot be changed through modifyTable (attempted to move %s to %s). ' + . 'Drop and re-add the table to move it across namespaces.', + $oldName->toString(), + $newName->toString(), + )); + } +} diff --git a/core/vendor/doctrine/dbal/src/Schema/Exception/InvalidTableModification.php b/core/vendor/doctrine/dbal/src/Schema/Exception/InvalidTableModification.php index 0465ac4eff..7298964f33 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Exception/InvalidTableModification.php +++ b/core/vendor/doctrine/dbal/src/Schema/Exception/InvalidTableModification.php @@ -7,7 +7,6 @@ use Doctrine\DBAL\Schema\Collections\Exception\ObjectAlreadyExists; use Doctrine\DBAL\Schema\Collections\Exception\ObjectDoesNotExist; use Doctrine\DBAL\Schema\Name\OptionallyQualifiedName; -use Doctrine\DBAL\Schema\Name\UnqualifiedName; use Doctrine\DBAL\Schema\SchemaException; use LogicException; @@ -120,65 +119,8 @@ public static function foreignKeyConstraintDoesNotExist( ), previous: $previous); } - public static function indexedColumnDoesNotExist( - ?OptionallyQualifiedName $tableName, - UnqualifiedName $indexName, - UnqualifiedName $columnName, - ): self { - return new self(sprintf( - 'Column %s referenced by index %s does not exist on table %s.', - $columnName->toString(), - $indexName->toString(), - self::formatTableName($tableName), - )); - } - - public static function primaryKeyConstraintColumnDoesNotExist( - ?OptionallyQualifiedName $tableName, - ?UnqualifiedName $constraintName, - UnqualifiedName $columnName, - ): self { - return new self(sprintf( - 'Column %s referenced by primary key constraint %s does not exist on table %s.', - $columnName->toString(), - self::formatConstraintName($constraintName), - self::formatTableName($tableName), - )); - } - - public static function uniqueConstraintColumnDoesNotExist( - ?OptionallyQualifiedName $tableName, - ?UnqualifiedName $constraintName, - UnqualifiedName $columnName, - ): self { - return new self(sprintf( - 'Column %s referenced by unique constraint %s does not exist on table %s.', - $columnName->toString(), - self::formatConstraintName($constraintName), - self::formatTableName($tableName), - )); - } - - public static function foreignKeyConstraintReferencingColumnDoesNotExist( - ?OptionallyQualifiedName $tableName, - ?UnqualifiedName $constraintName, - UnqualifiedName $columnName, - ): self { - return new self(sprintf( - 'Referencing column %s of foreign key constraint %s does not exist on table %s.', - $columnName->toString(), - self::formatConstraintName($constraintName), - self::formatTableName($tableName), - )); - } - private static function formatTableName(?OptionallyQualifiedName $tableName): string { return $tableName === null ? '' : $tableName->toString(); } - - private static function formatConstraintName(?UnqualifiedName $constraintName): string - { - return $constraintName === null ? '' : $constraintName->toString(); - } } diff --git a/core/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraint.php b/core/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraint.php index dd042ba759..5212b49646 100644 --- a/core/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraint.php +++ b/core/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraint.php @@ -601,10 +601,8 @@ public function onDelete(): ?string private function parseReferencedTableName(string $referencedTableName): ?OptionallyQualifiedName { - $parser = Parsers::getOptionallyQualifiedNameParser(); - try { - return $parser->parse($referencedTableName); + return Parsers::parseOptionallyQualifiedName($referencedTableName); } catch (Throwable $e) { Deprecation::trigger( 'doctrine/dbal', @@ -624,11 +622,9 @@ private function parseReferencedTableName(string $referencedTableName): ?Optiona */ private function parseColumnNames(array $columnNames): array { - $parser = Parsers::getUnqualifiedNameParser(); - try { return array_map( - static fn (string $columnName) => $parser->parse($columnName), + static fn (string $columnName) => Parsers::parseUnqualifiedName($columnName), $columnNames, ); } catch (Throwable $e) { diff --git a/core/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraintEditor.php b/core/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraintEditor.php index d8378be61a..1835838208 100644 --- a/core/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraintEditor.php +++ b/core/vendor/doctrine/dbal/src/Schema/ForeignKeyConstraintEditor.php @@ -115,6 +115,18 @@ public function addReferencingColumnName(UnqualifiedName $columName): self return $this; } + /** @param non-empty-string $name */ + public function addUnquotedReferencingColumnName(string $name): self + { + return $this->addReferencingColumnName(UnqualifiedName::unquoted($name)); + } + + /** @param non-empty-string $name */ + public function addQuotedReferencingColumnName(string $name): self + { + return $this->addReferencingColumnName(UnqualifiedName::quoted($name)); + } + public function setReferencedTableName(OptionallyQualifiedName $referencedTableName): self { $this->referencedTableName = $referencedTableName; @@ -198,6 +210,18 @@ public function addReferencedColumnName(UnqualifiedName $columName): self return $this; } + /** @param non-empty-string $name */ + public function addUnquotedReferencedColumnName(string $name): self + { + return $this->addReferencedColumnName(UnqualifiedName::unquoted($name)); + } + + /** @param non-empty-string $name */ + public function addQuotedReferencedColumnName(string $name): self + { + return $this->addReferencedColumnName(UnqualifiedName::quoted($name)); + } + public function setMatchType(MatchType $matchType): self { $this->matchType = $matchType; diff --git a/core/vendor/doctrine/dbal/src/Schema/Index.php b/core/vendor/doctrine/dbal/src/Schema/Index.php index 777348fab9..e16957638e 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Index.php +++ b/core/vendor/doctrine/dbal/src/Schema/Index.php @@ -354,13 +354,11 @@ public function spansColumns(array $columnNames): bool for ($i = 0; $i < $numberOfColumns; $i++) { if ( - isset($columnNames[$i]) - && $this->trimQuotes(strtolower($columns[$i])) === $this->trimQuotes(strtolower($columnNames[$i])) + ! isset($columnNames[$i]) + || $this->trimQuotes(strtolower($columns[$i])) !== $this->trimQuotes(strtolower($columnNames[$i])) ) { - continue; + $sameColumns = false; } - - $sameColumns = false; } return $sameColumns; @@ -592,19 +590,17 @@ private function validateFlags(): void } if ( - $this->predicate === null - || (! $this->hasFlag('fulltext') - && ! $this->hasFlag('spatial') - && ! $this->hasFlag('clustered')) + $this->predicate !== null + && ($this->hasFlag('fulltext') + || $this->hasFlag('spatial') + || $this->hasFlag('clustered')) ) { - return; + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6886', + 'A fulltext, spatial or clustered index cannot be partial.', + ); } - - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/6886', - 'A fulltext, spatial or clustered index cannot be partial.', - ); } private function inferType(): ?IndexType @@ -651,11 +647,9 @@ private function parseColumns(bool $isPrimary, array $columnNames, array $length { $columns = []; - $parser = Parsers::getUnqualifiedNameParser(); - foreach ($columnNames as $columnName) { try { - $parsedName = $parser->parse($columnName); + $parsedName = Parsers::parseUnqualifiedName($columnName); } catch (Throwable $e) { Deprecation::trigger( 'doctrine/dbal', diff --git a/core/vendor/doctrine/dbal/src/Schema/IndexEditor.php b/core/vendor/doctrine/dbal/src/Schema/IndexEditor.php index eb9b2da565..d124056674 100644 --- a/core/vendor/doctrine/dbal/src/Schema/IndexEditor.php +++ b/core/vendor/doctrine/dbal/src/Schema/IndexEditor.php @@ -76,6 +76,24 @@ public function addColumn(IndexedColumn $column): self return $this; } + /** + * @param non-empty-string $name + * @param ?positive-int $length + */ + public function addUnquotedColumnName(string $name, ?int $length = null): self + { + return $this->addColumn(new IndexedColumn(UnqualifiedName::unquoted($name), $length)); + } + + /** + * @param non-empty-string $name + * @param ?positive-int $length + */ + public function addQuotedColumnName(string $name, ?int $length = null): self + { + return $this->addColumn(new IndexedColumn(UnqualifiedName::quoted($name), $length)); + } + public function setColumnNames(UnqualifiedName $firstColumnName, UnqualifiedName ...$otherColumnNames): self { $this->columns = array_map( @@ -139,8 +157,49 @@ public function create(): Index throw InvalidIndexDefinition::nameNotSet(); } + [$columnNames, $flags, $options] = $this->toIndexParameters($this->name); + + return new Index( + $this->name->toString(), + $columnNames, + $this->type === IndexType::UNIQUE, + false, + $flags, + $options, + ); + } + + /** + * Adds the index described by this editor to the given table, generating its name from the table when no name is + * set. + * + * @internal Used by {@link TableEditor} to add an editor-described index to a table. + */ + public function addToTable(Table $table): void + { + [$columnNames, $flags, $options] = $this->toIndexParameters($this->name ?? UnqualifiedName::unquoted('index')); + + $indexName = $this->name?->toString(); + + if ($this->type === IndexType::UNIQUE) { + $table->addUniqueIndex($columnNames, $indexName, $options); + + return; + } + + $table->addIndex($columnNames, $indexName, $flags, $options); + } + + /** + * Maps the editor's columns, flags, and options to the arguments the {@see Index} constructor and the + * {@see Table} index methods expect. + * + * @return array{non-empty-list, list, array} the column names, flags, and options + */ + private function toIndexParameters(UnqualifiedName $name): array + { if (count($this->columns) < 1) { - throw InvalidIndexDefinition::columnsNotSet($this->name); + throw InvalidIndexDefinition::columnsNotSet($name); } $columnNames = $lengths = $options = $flags = []; @@ -175,13 +234,6 @@ public function create(): Index $options['where'] = $this->predicate; } - return new Index( - $this->name->toString(), - $columnNames, - $this->type === IndexType::UNIQUE, - false, - $flags, - $options, - ); + return [$columnNames, $flags, $options]; } } diff --git a/core/vendor/doctrine/dbal/src/Schema/IndexRename.php b/core/vendor/doctrine/dbal/src/Schema/IndexRename.php new file mode 100644 index 0000000000..ec4264b1e4 --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Schema/IndexRename.php @@ -0,0 +1,28 @@ +oldName; + } + + public function getNewIndex(): Index + { + return $this->newIndex; + } +} diff --git a/core/vendor/doctrine/dbal/src/Schema/Introspection/IntrospectingSchemaProvider.php b/core/vendor/doctrine/dbal/src/Schema/Introspection/IntrospectingSchemaProvider.php index a46fe79e32..9f6bea722b 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Introspection/IntrospectingSchemaProvider.php +++ b/core/vendor/doctrine/dbal/src/Schema/Introspection/IntrospectingSchemaProvider.php @@ -14,8 +14,12 @@ use Doctrine\DBAL\Schema\Introspection\MetadataProcessor\IndexColumnMetadataProcessor; use Doctrine\DBAL\Schema\Introspection\MetadataProcessor\PrimaryKeyConstraintColumnMetadataProcessor; use Doctrine\DBAL\Schema\Introspection\MetadataProcessor\SequenceMetadataProcessor; +use Doctrine\DBAL\Schema\Introspection\MetadataProcessor\UniqueConstraintColumnMetadataProcessor; use Doctrine\DBAL\Schema\Introspection\MetadataProcessor\ViewMetadataProcessor; +use Doctrine\DBAL\Schema\Metadata\ForeignKeyConstraintColumnMetadataRow; +use Doctrine\DBAL\Schema\Metadata\IndexColumnMetadataRow; use Doctrine\DBAL\Schema\Metadata\MetadataProvider; +use Doctrine\DBAL\Schema\Metadata\UniqueConstraintColumnMetadataRow; use Doctrine\DBAL\Schema\Name\OptionallyQualifiedName; use Doctrine\DBAL\Schema\Name\UnqualifiedName; use Doctrine\DBAL\Schema\PrimaryKeyConstraint; @@ -23,9 +27,13 @@ use Doctrine\DBAL\Schema\SchemaProvider; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\TableConfiguration; +use Doctrine\DBAL\Schema\UniqueConstraint; +use Doctrine\DBAL\Schema\UniqueConstraintEditor; +use Doctrine\Deprecations\Deprecation; use function array_map; use function array_values; +use function method_exists; /** * Provides access to the database schema obtained by introspection. @@ -83,6 +91,7 @@ public function getAllTables(): array $tableColumnsByTable = $this->getColumnsForAllTables(); $indexesByTable = $this->getIndexesForAllTables(); $primaryKeyConstraintsByTable = $this->getPrimaryKeyConstraintsForAllTables(); + $uniqueConstraintsByTable = $this->getUniqueConstraintsForAllTables(); $foreignKeyConstraintsByTable = $this->getForeignKeyConstraintsForAllTables(); $tableOptionsByTable = $this->getOptionsForAllTables(); @@ -111,6 +120,12 @@ public function getAllTables(): array ); } + if (isset($uniqueConstraintsByTable[$schemaNameKey][$unqualifiedName])) { + $editor->setUniqueConstraints( + ...$uniqueConstraintsByTable[$schemaNameKey][$unqualifiedName], + ); + } + if (isset($foreignKeyConstraintsByTable[$schemaNameKey][$unqualifiedName])) { $editor->setForeignKeyConstraints( ...$foreignKeyConstraintsByTable[$schemaNameKey][$unqualifiedName], @@ -217,30 +232,14 @@ public function getIndexesForTable(?string $schemaName, string $tableName): arra */ private function getIndexesForAllTables(): array { - $editors = []; $processor = new IndexColumnMetadataProcessor(); - foreach ($this->metadataProvider->getIndexColumnsForAllTables() as $row) { - $schemaName = $row->getSchemaName() ?? self::NULL_SCHEMA_KEY; - $tableName = $row->getTableName(); - $indexName = $row->getIndexName(); - - if (! isset($editors[$schemaName][$tableName][$indexName])) { - $editors[$schemaName][$tableName][$indexName] = $processor->initializeEditor($row); - } - - $processor->applyRow($editors[$schemaName][$tableName][$indexName], $row); - } - - return array_map( - static fn (array $editors): array => array_map( - static fn (array $editors): array => array_map( - static fn (IndexEditor $editor): Index => $editor->create(), - array_values($editors), - ), - $editors, - ), - $editors, + return $this->groupByTable( + static fn (IndexColumnMetadataRow $row): string => $row->getIndexName(), + $processor->initializeEditor(...), + $processor->applyRow(...), + static fn (IndexEditor $editor): Index => $editor->create(), + $this->metadataProvider->getIndexColumnsForAllTables(), ); } @@ -292,6 +291,74 @@ private function getPrimaryKeyConstraintsForAllTables(): array ); } + /** {@inheritDoc} */ + public function getUniqueConstraintsForTable(?string $schemaName, string $tableName): array + { + if (! method_exists($this->metadataProvider, 'getUniqueConstraintColumnsForTable')) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7461', + 'Not implementing %s::getUniqueConstraintColumnsForTable() in %s is deprecated.', + MetadataProvider::class, + $this->metadataProvider::class, + ); + + return []; + } + + $editors = []; + $processor = new UniqueConstraintColumnMetadataProcessor(); + + foreach ($this->metadataProvider->getUniqueConstraintColumnsForTable($schemaName, $tableName) as $row) { + $id = $row->getId(); + + if (! isset($editors[$id])) { + $editors[$id] = $processor->initializeEditor($row); + } + + $processor->applyRow($editors[$id], $row); + } + + return array_map( + static fn (UniqueConstraintEditor $e): UniqueConstraint => $e->create(), + array_values($editors), + ); + } + + /** + * Returns the unique constraints, grouped by schema and table. + * + * If the underlying database does not support schemas, the schema key will be {@link NULL_SCHEMA_KEY}. + * + * @return array>> + * + * @throws Exception + */ + private function getUniqueConstraintsForAllTables(): array + { + if (! method_exists($this->metadataProvider, 'getUniqueConstraintColumnsForAllTables')) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7461', + 'Not implementing %s::getUniqueConstraintColumnsForAllTables() in %s is deprecated.', + MetadataProvider::class, + $this->metadataProvider::class, + ); + + return []; + } + + $processor = new UniqueConstraintColumnMetadataProcessor(); + + return $this->groupByTable( + static fn (UniqueConstraintColumnMetadataRow $row): int|string => $row->getId(), + $processor->initializeEditor(...), + $processor->applyRow(...), + static fn (UniqueConstraintEditor $editor): UniqueConstraint => $editor->create(), + $this->metadataProvider->getUniqueConstraintColumnsForAllTables(), + ); + } + /** {@inheritDoc} */ public function getForeignKeyConstraintsForTable(?string $schemaName, string $tableName): array { @@ -325,28 +392,59 @@ public function getForeignKeyConstraintsForTable(?string $schemaName, string $ta */ private function getForeignKeyConstraintsForAllTables(): array { - $editors = []; $processor = new ForeignKeyConstraintColumnMetadataProcessor($this->currentSchemaName); - foreach ($this->metadataProvider->getForeignKeyConstraintColumnsForAllTables() as $row) { + return $this->groupByTable( + static fn (ForeignKeyConstraintColumnMetadataRow $row): int|string => $row->getId(), + $processor->initializeEditor(...), + $processor->applyRow(...), + static fn (ForeignKeyConstraintEditor $editor): ForeignKeyConstraint => $editor->create(), + $this->metadataProvider->getForeignKeyConstraintColumnsForAllTables(), + ); + } + + /** + * Groups rows by schema and table, builds one editor per grouping key, and creates the objects. + * + * If the underlying database does not support schemas, the schema key will be {@link NULL_SCHEMA_KEY}. + * + * @param callable(R): (int|string) $getKey + * @param callable(R): E $initializeEditor + * @param callable(E, R): void $applyRow + * @param callable(E): T $create + * @param iterable $rows + * + * @return array>> + * + * @template R of ForeignKeyConstraintColumnMetadataRow|IndexColumnMetadataRow|UniqueConstraintColumnMetadataRow + * @template E of object + * @template T of object + */ + private function groupByTable( + callable $getKey, + callable $initializeEditor, + callable $applyRow, + callable $create, + iterable $rows, + ): array { + $editors = []; + + foreach ($rows as $row) { $schemaName = $row->getSchemaName() ?? self::NULL_SCHEMA_KEY; $tableName = $row->getTableName(); - $id = $row->getId(); + $key = $getKey($row); - if (! isset($editors[$schemaName][$tableName][$id])) { - $editors[$schemaName][$tableName][$id] = $processor->initializeEditor($row); + if (! isset($editors[$schemaName][$tableName][$key])) { + $editors[$schemaName][$tableName][$key] = $initializeEditor($row); } - $processor->applyRow($editors[$schemaName][$tableName][$id], $row); + $applyRow($editors[$schemaName][$tableName][$key], $row); } return array_map( - static fn (array $editors): array => array_map( - static fn (array $editors): array => array_map( - static fn (ForeignKeyConstraintEditor $editor): ForeignKeyConstraint => $editor->create(), - array_values($editors), - ), - $editors, + static fn (array $tables): array => array_map( + static fn (array $editors): array => array_map($create, array_values($editors)), + $tables, ), $editors, ); diff --git a/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/ForeignKeyConstraintColumnMetadataProcessor.php b/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/ForeignKeyConstraintColumnMetadataProcessor.php index 020bd39a05..8938510577 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/ForeignKeyConstraintColumnMetadataProcessor.php +++ b/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/ForeignKeyConstraintColumnMetadataProcessor.php @@ -61,11 +61,7 @@ public function initializeEditor(ForeignKeyConstraintColumnMetadataRow $row): Fo public function applyRow(ForeignKeyConstraintEditor $editor, ForeignKeyConstraintColumnMetadataRow $row): void { $editor - ->addReferencingColumnName( - UnqualifiedName::quoted($row->getReferencingColumnName()), - ) - ->addReferencedColumnName( - UnqualifiedName::quoted($row->getReferencedColumnName()), - ); + ->addQuotedReferencingColumnName($row->getReferencingColumnName()) + ->addQuotedReferencedColumnName($row->getReferencedColumnName()); } } diff --git a/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/IndexColumnMetadataProcessor.php b/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/IndexColumnMetadataProcessor.php index 215b539794..5103351e17 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/IndexColumnMetadataProcessor.php +++ b/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/IndexColumnMetadataProcessor.php @@ -5,7 +5,6 @@ namespace Doctrine\DBAL\Schema\Introspection\MetadataProcessor; use Doctrine\DBAL\Schema\Index; -use Doctrine\DBAL\Schema\Index\IndexedColumn; use Doctrine\DBAL\Schema\IndexEditor; use Doctrine\DBAL\Schema\Metadata\IndexColumnMetadataRow; use Doctrine\DBAL\Schema\Name\UnqualifiedName; @@ -30,11 +29,6 @@ public function initializeEditor(IndexColumnMetadataRow $row): IndexEditor public function applyRow(IndexEditor $editor, IndexColumnMetadataRow $row): void { - $editor->addColumn( - new IndexedColumn( - UnqualifiedName::quoted($row->getColumnName()), - $row->getColumnLength(), - ), - ); + $editor->addQuotedColumnName($row->getColumnName(), $row->getColumnLength()); } } diff --git a/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/PrimaryKeyConstraintColumnMetadataProcessor.php b/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/PrimaryKeyConstraintColumnMetadataProcessor.php index 027bf5a194..d0b3aa09c1 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/PrimaryKeyConstraintColumnMetadataProcessor.php +++ b/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/PrimaryKeyConstraintColumnMetadataProcessor.php @@ -5,7 +5,6 @@ namespace Doctrine\DBAL\Schema\Introspection\MetadataProcessor; use Doctrine\DBAL\Schema\Metadata\PrimaryKeyConstraintColumnRow; -use Doctrine\DBAL\Schema\Name\UnqualifiedName; use Doctrine\DBAL\Schema\PrimaryKeyConstraint; use Doctrine\DBAL\Schema\PrimaryKeyConstraintEditor; @@ -26,8 +25,6 @@ public function initializeEditor(PrimaryKeyConstraintColumnRow $row): PrimaryKey public function applyRow(PrimaryKeyConstraintEditor $editor, PrimaryKeyConstraintColumnRow $row): void { - $editor->addColumnName( - UnqualifiedName::quoted($row->getColumnName()), - ); + $editor->addQuotedColumnName($row->getColumnName()); } } diff --git a/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/UniqueConstraintColumnMetadataProcessor.php b/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/UniqueConstraintColumnMetadataProcessor.php new file mode 100644 index 0000000000..a6f8e4c1a3 --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Schema/Introspection/MetadataProcessor/UniqueConstraintColumnMetadataProcessor.php @@ -0,0 +1,34 @@ +getName(); + if ($name !== null) { + $editor->setQuotedName($name); + } + + return $editor; + } + + public function applyRow(UniqueConstraintEditor $editor, UniqueConstraintColumnMetadataRow $row): void + { + $editor->addQuotedColumnName($row->getColumnName()); + } +} diff --git a/core/vendor/doctrine/dbal/src/Schema/Metadata/MetadataProvider.php b/core/vendor/doctrine/dbal/src/Schema/Metadata/MetadataProvider.php index ccd2d071b0..331d751ba6 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Metadata/MetadataProvider.php +++ b/core/vendor/doctrine/dbal/src/Schema/Metadata/MetadataProvider.php @@ -13,6 +13,9 @@ * 1. Filter out internal or system schemas, tables, and other objects that are not relevant to the user. * 2. Remain stateless: if the underlying connection changes the current database and/or schema, the subsequent calls * to the methods of this interface should reflect that change. + * + * @method iterable getUniqueConstraintColumnsForAllTables() + * @method iterable getUniqueConstraintColumnsForTable(?non-empty-string $schemaName, non-empty-string $tableName) */ interface MetadataProvider { diff --git a/core/vendor/doctrine/dbal/src/Schema/Metadata/UniqueConstraintColumnMetadataRow.php b/core/vendor/doctrine/dbal/src/Schema/Metadata/UniqueConstraintColumnMetadataRow.php new file mode 100644 index 0000000000..ca659f6355 --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Schema/Metadata/UniqueConstraintColumnMetadataRow.php @@ -0,0 +1,74 @@ +null constraint name, so + * this must be set instead. + * @param ?non-empty-string $name + * @param non-empty-string $columnName + */ + public function __construct( + private ?string $schemaName, + private string $tableName, + int|string|null $id, + private ?string $name, + private string $columnName, + ) { + if ($id !== null) { + $this->id = $id; + } elseif ($name !== null) { + $this->id = $name; + } else { + throw new InvalidArgumentException( + 'Either the id or name must be set to a non-null value.', + ); + } + } + + /** @return ?non-empty-string */ + public function getSchemaName(): ?string + { + return $this->schemaName; + } + + /** @return non-empty-string */ + public function getTableName(): string + { + return $this->tableName; + } + + /** @return int|non-empty-string */ + public function getId(): int|string + { + return $this->id; + } + + /** @return ?non-empty-string */ + public function getName(): ?string + { + return $this->name; + } + + /** @return non-empty-string */ + public function getColumnName(): string + { + return $this->columnName; + } +} diff --git a/core/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php b/core/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php index 78359c8779..f6d7d69fed 100644 --- a/core/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php +++ b/core/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php @@ -17,7 +17,6 @@ use Doctrine\DBAL\Schema\DefaultExpression\CurrentDate; use Doctrine\DBAL\Schema\DefaultExpression\CurrentTime; use Doctrine\DBAL\Schema\DefaultExpression\CurrentTimestamp; -use Doctrine\DBAL\Types\Type; use function array_change_key_case; use function array_map; @@ -214,7 +213,7 @@ protected function _getPortableTableColumnDefinition(array $tableColumn): Column $options['comment'] = $tableColumn['comment']; } - $column = new Column($tableColumn['field'], Type::getType($type), $options); + $column = new Column($tableColumn['field'], $type, $options); $column->setPlatformOption('charset', $tableColumn['characterset']); $column->setPlatformOption('collation', $tableColumn['collation']); @@ -428,6 +427,7 @@ protected function selectIndexColumns(string $databaseName, ?string $tableName = FROM information_schema.STATISTICS WHERE %s ORDER BY TABLE_NAME, + INDEX_NAME, SEQ_IN_INDEX SQL, implode(' AND ', $conditions), diff --git a/core/vendor/doctrine/dbal/src/Schema/Name.php b/core/vendor/doctrine/dbal/src/Schema/Name.php index d5169775b8..33bfc7534f 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Name.php +++ b/core/vendor/doctrine/dbal/src/Schema/Name.php @@ -19,7 +19,9 @@ public function toSQL(AbstractPlatform $platform): string; /** * Returns the string representation of the name. * - * If passed to the corresponding parser, the name should be parsed back to an equivalent object. + * The representation is intended for display, such as in error messages, not for parsing back into a name: + * parsing does not always reproduce the original. If an unquoted part of the name contains whitespace, a dot, + * or a quote character (", `, [, ]), parsing it will return a different name or fail. */ public function toString(): string; } diff --git a/core/vendor/doctrine/dbal/src/Schema/Name/Parsers.php b/core/vendor/doctrine/dbal/src/Schema/Name/Parsers.php index 58611d1df5..03425d6dc4 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Name/Parsers.php +++ b/core/vendor/doctrine/dbal/src/Schema/Name/Parsers.php @@ -4,6 +4,7 @@ namespace Doctrine\DBAL\Schema\Name; +use Doctrine\DBAL\Schema\Name\Parser\Exception; use Doctrine\DBAL\Schema\Name\Parser\GenericNameParser; use Doctrine\DBAL\Schema\Name\Parser\OptionallyQualifiedNameParser; use Doctrine\DBAL\Schema\Name\Parser\UnqualifiedNameParser; @@ -31,11 +32,23 @@ public static function getUnqualifiedNameParser(): UnqualifiedNameParser return self::$unqualifiedNameParser ??= new UnqualifiedNameParser(self::getGenericNameParser()); } + /** @throws Exception */ + public static function parseUnqualifiedName(string $input): UnqualifiedName + { + return self::getUnqualifiedNameParser()->parse($input); + } + public static function getOptionallyQualifiedNameParser(): OptionallyQualifiedNameParser { return self::$optionallyQualifiedNameParser ??= new OptionallyQualifiedNameParser(self::getGenericNameParser()); } + /** @throws Exception */ + public static function parseOptionallyQualifiedName(string $input): OptionallyQualifiedName + { + return self::getOptionallyQualifiedNameParser()->parse($input); + } + public static function getGenericNameParser(): GenericNameParser { return self::$genericNameParser ??= new GenericNameParser(); diff --git a/core/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php b/core/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php index 47d87400f1..95dc23b41d 100644 --- a/core/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php +++ b/core/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php @@ -184,7 +184,7 @@ protected function _getPortableTableColumnDefinition(array $tableColumn): Column $options['comment'] = $tableColumn['comments']; } - return new Column($this->getQuotedIdentifierName($tableColumn['column_name']), Type::getType($type), $options); + return new Column($this->getQuotedIdentifierName($tableColumn['column_name']), $type, $options); } /** diff --git a/core/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php b/core/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php index 10072969f0..229d61b18c 100644 --- a/core/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php +++ b/core/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php @@ -5,6 +5,7 @@ namespace Doctrine\DBAL\Schema; use Doctrine\DBAL\Exception; +use Doctrine\DBAL\Platforms\PostgreSQL; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; use Doctrine\DBAL\Result; use Doctrine\DBAL\Types\JsonType; @@ -15,6 +16,8 @@ use function assert; use function count; use function explode; +use function func_get_arg; +use function func_num_args; use function implode; use function is_string; use function preg_match; @@ -33,6 +36,14 @@ */ class PostgreSQLSchemaManager extends AbstractSchemaManager { + public function createComparator(/* ComparatorConfig $config = new ComparatorConfig() */): Comparator + { + return new PostgreSQL\Comparator( + $this->platform, + func_num_args() > 0 ? func_get_arg(0) : new ComparatorConfig(), + ); + } + /** * {@inheritDoc} */ @@ -274,13 +285,13 @@ protected function _getPortableTableColumnDefinition(array $tableColumn): Column $options['comment'] = $tableColumn['comment']; } - $column = new Column($tableColumn['field'], Type::getType($type), $options); + $column = new Column($tableColumn['field'], $type, $options); if (! empty($tableColumn['collation'])) { $column->setPlatformOption('collation', $tableColumn['collation']); } - if ($column->getType() instanceof JsonType) { + if (Type::getType($column->getTypeName()) instanceof JsonType) { $column->setPlatformOption('jsonb', $jsonb); } diff --git a/core/vendor/doctrine/dbal/src/Schema/PrimaryKeyConstraintEditor.php b/core/vendor/doctrine/dbal/src/Schema/PrimaryKeyConstraintEditor.php index 9efc286093..457afecf14 100644 --- a/core/vendor/doctrine/dbal/src/Schema/PrimaryKeyConstraintEditor.php +++ b/core/vendor/doctrine/dbal/src/Schema/PrimaryKeyConstraintEditor.php @@ -97,6 +97,18 @@ public function addColumnName(UnqualifiedName $columName): self return $this; } + /** @param non-empty-string $name */ + public function addUnquotedColumnName(string $name): self + { + return $this->addColumnName(UnqualifiedName::unquoted($name)); + } + + /** @param non-empty-string $name */ + public function addQuotedColumnName(string $name): self + { + return $this->addColumnName(UnqualifiedName::quoted($name)); + } + public function setIsClustered(bool $isClustered): self { $this->isClustered = $isClustered; diff --git a/core/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php b/core/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php index 86c1c6585b..c561e4bce4 100644 --- a/core/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php +++ b/core/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php @@ -9,7 +9,6 @@ use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Result; use Doctrine\DBAL\Schema\DefaultExpression\CurrentTimestamp; -use Doctrine\DBAL\Types\Type; use function array_change_key_case; use function assert; @@ -132,7 +131,7 @@ protected function _getPortableTableColumnDefinition(array $tableColumn): Column $options['length'] = $length; } - $column = new Column($tableColumn['name'], Type::getType($type), $options); + $column = new Column($tableColumn['name'], $type, $options); if ($tableColumn['default'] !== null) { $default = $this->parseDefaultExpression($tableColumn['default']); diff --git a/core/vendor/doctrine/dbal/src/Schema/SQLiteSchemaManager.php b/core/vendor/doctrine/dbal/src/Schema/SQLiteSchemaManager.php index 7b23fe0e34..0baf26b0c3 100644 --- a/core/vendor/doctrine/dbal/src/Schema/SQLiteSchemaManager.php +++ b/core/vendor/doctrine/dbal/src/Schema/SQLiteSchemaManager.php @@ -127,7 +127,7 @@ protected function _getPortableTableColumnDefinition(array $tableColumn): Column 'scale' => $scale, ]; - $column = new Column($tableColumn['name'], Type::getType($type), $options); + $column = new Column($tableColumn['name'], $type, $options); if ($type === Types::STRING || $type === Types::TEXT) { $column->setPlatformOption('collation', $tableColumn['collation'] ?? 'BINARY'); @@ -256,6 +256,15 @@ private function parseTableCommentFromSQL(string $table, string $sql): ?string return $comment === '' ? null : $comment; } + private function parseWithoutRowidFromSQL(string $sql): bool + { + if (preg_match('/\)[^)]*$/s', $sql, $match) !== 1) { + return false; + } + + return preg_match('/\bWITHOUT\s+ROWID\b/i', $match[0]) === 1; + } + private function parseColumnCommentFromSQL(string $column, string $sql): string { $pattern = '{[\s(,]' . $this->buildIdentifierPattern($column) @@ -465,7 +474,7 @@ protected function fetchTableColumns(string $databaseName, ?string $tableName = $sqlByTable[$tableName] ??= $this->getCreateTableSQL($tableName); - if ($row['pk'] !== 0 && $row['pk'] !== '0' && $row['type'] === 'INTEGER') { + if ($row['pk'] !== 0 && $row['pk'] !== '0') { $pkColumnNamesByTable[$tableName][] = $row['name']; } } @@ -477,7 +486,7 @@ protected function fetchTableColumns(string $databaseName, ?string $tableName = $result[] = array_merge($row, [ 'autoincrement' => isset($pkColumnNamesByTable[$tableName]) - && $pkColumnNamesByTable[$tableName] === [$columnName], + && $pkColumnNamesByTable[$tableName] === [$columnName] && $row['type'] === 'INTEGER', 'collation' => $this->parseColumnCollationFromSQL($columnName, $tableSQL), 'comment' => $this->parseColumnCommentFromSQL($columnName, $tableSQL), ]); @@ -587,11 +596,17 @@ protected function fetchTableOptionsByTable(string $databaseName, ?string $table $tableOptions = []; foreach ($tables as $table) { - $comment = $this->parseTableCommentFromSQL($table, $this->getCreateTableSQL($table)); + $createSQL = $this->getCreateTableSQL($table); + + $comment = $this->parseTableCommentFromSQL($table, $createSQL); if ($comment !== null) { $tableOptions[$table]['comment'] = $comment; } + + if ($this->parseWithoutRowidFromSQL($createSQL)) { + $tableOptions[$table]['without_rowid'] = true; + } } /** @phpstan-ignore return.type */ diff --git a/core/vendor/doctrine/dbal/src/Schema/Schema.php b/core/vendor/doctrine/dbal/src/Schema/Schema.php index f92ee0f7d3..0d52b7526e 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Schema.php +++ b/core/vendor/doctrine/dbal/src/Schema/Schema.php @@ -79,6 +79,9 @@ class Schema extends AbstractAsset private bool $usesUnqualifiedNames = false; /** + * @internal since doctrine/dbal 4.5. Use {@link Schema::editor()} to instantiate an editor + * and {@link SchemaEditor::create()} to create a schema. + * * @param array $tables * @param array $sequences * @param array $namespaces @@ -388,9 +391,18 @@ public function createNamespace(string $name): self /** * Creates a new table. + * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see SchemaEditor::addTable()} instead. */ public function createTable(string $name): Table { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7373', + '%s is deprecated. Use Schema::edit() and SchemaEditor::addTable() instead.', + __METHOD__, + ); + $table = new Table($name, [], [], [], [], [], $this->_schemaConfig->toTableConfiguration()); $this->_addTable($table); @@ -404,10 +416,19 @@ public function createTable(string $name): Table /** * Renames a table. * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see SchemaEditor::renameTable()} instead. + * * @return $this */ public function renameTable(string $oldName, string $newName): self { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7373', + '%s is deprecated. Use Schema::edit() and SchemaEditor::renameTable() instead.', + __METHOD__, + ); + $table = $this->getTable($oldName); $identifier = new Identifier($newName); @@ -425,10 +446,19 @@ public function renameTable(string $oldName, string $newName): self /** * Drops a table from the schema. * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see SchemaEditor::dropTable()} instead. + * * @return $this */ public function dropTable(string $name): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7373', + '%s is deprecated. Use Schema::edit() and SchemaEditor::dropTable() instead.', + __METHOD__, + ); + $key = $this->getKeyFromName($name); if (! isset($this->_tables[$key])) { throw TableDoesNotExist::new($name); @@ -441,18 +471,38 @@ public function dropTable(string $name): self /** * Creates a new sequence. + * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see SchemaEditor::addSequence()} instead. */ public function createSequence(string $name, int $allocationSize = 1, int $initialValue = 1): Sequence { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7373', + '%s is deprecated. Use Schema::edit() and SchemaEditor::addSequence() instead.', + __METHOD__, + ); + $seq = new Sequence($name, $allocationSize, $initialValue); $this->_addSequence($seq); return $seq; } - /** @return $this */ + /** + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see SchemaEditor::dropSequence()} instead. + * + * @return $this + */ public function dropSequence(string $name): self { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7373', + '%s is deprecated. Use Schema::edit() and SchemaEditor::dropSequence() instead.', + __METHOD__, + ); + $key = $this->getKeyFromName($name); unset($this->_sequences[$key]); @@ -485,6 +535,25 @@ public function toDropSql(AbstractPlatform $platform): array return $builder->buildSQL($this); } + /** + * Instantiates a new schema editor. + */ + public static function editor(): SchemaEditor + { + return new SchemaEditor(); + } + + /** + * Instantiates a new schema editor seeded with this schema's tables, sequences, and configuration. + */ + public function edit(): SchemaEditor + { + return self::editor() + ->setDefaultNamespace($this->_schemaConfig->getName()) + ->setTables(...$this->getTables()) + ->setSequences(...$this->getSequences()); + } + /** * Cloning a Schema triggers a deep clone of all related assets. */ diff --git a/core/vendor/doctrine/dbal/src/Schema/SchemaEditor.php b/core/vendor/doctrine/dbal/src/Schema/SchemaEditor.php new file mode 100644 index 0000000000..8f923b44c4 --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Schema/SchemaEditor.php @@ -0,0 +1,311 @@ + */ + private array $tables = []; + + /** @var array */ + private array $sequences = []; + + /** @internal Use {@link Schema::editor()} or {@link Schema::edit()} to create an instance */ + public function __construct() + { + } + + /** @param ?non-empty-string $name */ + public function setDefaultNamespace(?string $name): self + { + if ($this->tables !== [] || $this->sequences !== []) { + throw InvalidSchemaModification::defaultNamespaceCanOnlyBeSetOnEmptyEditor(); + } + + $this->defaultNamespaceName = $name; + + return $this; + } + + public function setTables(Table ...$tables): self + { + $this->tables = []; + + foreach ($tables as $table) { + $this->addTable($table); + } + + return $this; + } + + public function addTable(Table $table): self + { + $name = $table->getObjectName(); + $key = $this->getKey($name); + + if (isset($this->tables[$key])) { + throw InvalidSchemaModification::tableAlreadyExists($name); + } + + $this->tables[$key] = $table; + + return $this; + } + + /** @param callable(TableEditor): void $modification */ + public function modifyTable(OptionallyQualifiedName $tableName, callable $modification): self + { + $key = $this->getKey($tableName); + + if (! isset($this->tables[$key])) { + throw InvalidSchemaModification::tableDoesNotExist($tableName); + } + + $editor = $this->tables[$key]->edit(); + $modification($editor); + $newTable = $editor->create(); + + $newName = $newTable->getObjectName(); + $oldResolved = $this->resolveName($tableName); + $newResolved = $this->resolveName($newName); + + if (! $this->qualifiersEqual($oldResolved->getQualifier(), $newResolved->getQualifier())) { + throw InvalidSchemaModification::cannotChangeTableQualifier($oldResolved, $newResolved); + } + + $newKey = $this->getKey($newName); + + if ($newKey === $key) { + $this->tables[$key] = $newTable; + + return $this; + } + + if (isset($this->tables[$newKey])) { + throw InvalidSchemaModification::tableAlreadyExists($newName); + } + + unset($this->tables[$key]); + $this->tables[$newKey] = $newTable; + + return $this; + } + + private function qualifiersEqual(?Identifier $a, ?Identifier $b): bool + { + if ($a === null || $b === null) { + return $a === $b; + } + + return strcasecmp($a->getValue(), $b->getValue()) === 0; + } + + /** + * @param non-empty-string $tableName + * @param callable(TableEditor): void $modification + * @param ?non-empty-string $qualifier + */ + public function modifyTableByUnquotedName( + string $tableName, + callable $modification, + ?string $qualifier = null, + ): self { + return $this->modifyTable(OptionallyQualifiedName::unquoted($tableName, $qualifier), $modification); + } + + public function renameTable(OptionallyQualifiedName $oldTableName, UnqualifiedName $newTableName): self + { + return $this->modifyTable( + $oldTableName, + static function (TableEditor $editor) use ($oldTableName, $newTableName): void { + $editor->setName( + new OptionallyQualifiedName($newTableName->getIdentifier(), $oldTableName->getQualifier()), + ); + }, + ); + } + + /** + * @param non-empty-string $oldTableName + * @param non-empty-string $newTableName + * @param ?non-empty-string $qualifier + */ + public function renameTableByUnquotedName( + string $oldTableName, + string $newTableName, + ?string $qualifier = null, + ): self { + return $this->renameTable( + OptionallyQualifiedName::unquoted($oldTableName, $qualifier), + UnqualifiedName::unquoted($newTableName), + ); + } + + public function dropTable(OptionallyQualifiedName $tableName): self + { + $key = $this->getKey($tableName); + + if (! isset($this->tables[$key])) { + throw InvalidSchemaModification::tableDoesNotExist($tableName); + } + + unset($this->tables[$key]); + + return $this; + } + + /** + * @param non-empty-string $tableName + * @param ?non-empty-string $qualifier + */ + public function dropTableByUnquotedName(string $tableName, ?string $qualifier = null): self + { + return $this->dropTable(OptionallyQualifiedName::unquoted($tableName, $qualifier)); + } + + public function setSequences(Sequence ...$sequences): self + { + $this->sequences = []; + + foreach ($sequences as $sequence) { + $this->addSequence($sequence); + } + + return $this; + } + + public function addSequence(Sequence $sequence): self + { + $name = $sequence->getObjectName(); + $key = $this->getKey($name); + + if (isset($this->sequences[$key])) { + throw InvalidSchemaModification::sequenceAlreadyExists($name); + } + + $this->sequences[$key] = $sequence; + + return $this; + } + + public function dropSequence(OptionallyQualifiedName $sequenceName): self + { + $key = $this->getKey($sequenceName); + + if (! isset($this->sequences[$key])) { + throw InvalidSchemaModification::sequenceDoesNotExist($sequenceName); + } + + unset($this->sequences[$key]); + + return $this; + } + + /** + * @param non-empty-string $sequenceName + * @param ?non-empty-string $qualifier + */ + public function dropSequenceByUnquotedName(string $sequenceName, ?string $qualifier = null): self + { + return $this->dropSequence(OptionallyQualifiedName::unquoted($sequenceName, $qualifier)); + } + + public function create(): Schema + { + $this->ensureUniformQualification(); + + $schemaConfig = new SchemaConfig(); + if ($this->defaultNamespaceName !== null) { + $schemaConfig->setName($this->defaultNamespaceName); + } + + return new Schema($this->tables, $this->sequences, $schemaConfig); + } + + private function getKey(OptionallyQualifiedName $name): string + { + return $this->buildKey($this->resolveName($name)); + } + + private function buildKey(OptionallyQualifiedName $resolved): string + { + $qualifier = $resolved->getQualifier(); + $unqualifiedName = $resolved->getUnqualifiedName()->getValue(); + + if ($qualifier === null) { + return strtolower($unqualifiedName); + } + + return strtolower($qualifier->getValue()) . "\0" . strtolower($unqualifiedName); + } + + /** + * Returns the given name qualified with the default namespace if one is configured and the name is unqualified; + * otherwise returns the name unchanged. Mirrors {@see Schema} resolution rules so that names added unqualified + * can be looked up by either form. + */ + private function resolveName(OptionallyQualifiedName $name): OptionallyQualifiedName + { + if ($name->getQualifier() !== null) { + return $name; + } + + if ($this->defaultNamespaceName === null) { + return $name; + } + + return new OptionallyQualifiedName( + $name->getUnqualifiedName(), + Identifier::quoted($this->defaultNamespaceName), + ); + } + + /** + * Throws if the editor's contents mix qualified and unqualified names after resolution against the default + * namespace. Tables and sequences are checked together — the schema is either fully qualified or fully unqualified. + */ + private function ensureUniformQualification(): void + { + $qualified = false; + $unqualified = false; + + foreach ($this->tables as $table) { + $this->checkQualification($table->getObjectName(), $qualified, $unqualified); + } + + foreach ($this->sequences as $sequence) { + $this->checkQualification($sequence->getObjectName(), $qualified, $unqualified); + } + } + + private function checkQualification(OptionallyQualifiedName $name, bool &$qualified, bool &$unqualified): void + { + if ($this->resolveName($name)->getQualifier() !== null) { + if ($unqualified) { + throw ImproperlyQualifiedName::fromQualifiedName($name); + } + + $qualified = true; + } else { + if ($qualified) { + throw ImproperlyQualifiedName::fromUnqualifiedName($name); + } + + $unqualified = true; + } + } +} diff --git a/core/vendor/doctrine/dbal/src/Schema/SchemaProvider.php b/core/vendor/doctrine/dbal/src/Schema/SchemaProvider.php index 0c50f5c6fd..fd55184c9a 100644 --- a/core/vendor/doctrine/dbal/src/Schema/SchemaProvider.php +++ b/core/vendor/doctrine/dbal/src/Schema/SchemaProvider.php @@ -104,6 +104,23 @@ public function getIndexesForTable(?string $schemaName, string $tableName): arra */ public function getPrimaryKeyConstraintForTable(?string $schemaName, string $tableName): ?PrimaryKeyConstraint; + /** + * Returns the unique constraints in the given table. + * + * If the current database platform supports schemas, the schema name must be specified. Otherwise, null must be + * passed as the schema name. + * + * Returns an empty value if the table doesn't exist or is not accessible to the connection. + * + * @param ?non-empty-string $schemaName + * @param non-empty-string $tableName + * + * @return list + * + * @throws Exception + */ + public function getUniqueConstraintsForTable(?string $schemaName, string $tableName): array; + /** * Returns the foreign key constraints in the given table. * diff --git a/core/vendor/doctrine/dbal/src/Schema/Table.php b/core/vendor/doctrine/dbal/src/Schema/Table.php index de0d3d6be8..1383d78570 100644 --- a/core/vendor/doctrine/dbal/src/Schema/Table.php +++ b/core/vendor/doctrine/dbal/src/Schema/Table.php @@ -47,7 +47,7 @@ class Table extends AbstractNamedObject protected array $_columns = []; /** @var array keys are new names, values are old names */ - protected array $renamedColumns = []; + protected array $renamedColumns; /** @var Index[] */ protected array $_indexes = []; @@ -85,11 +85,15 @@ class Table extends AbstractNamedObject private bool $failedToParsePrimaryKeyConstraint = false; /** + * @internal since doctrine/dbal 4.5. Use {@link Table::editor()} to instantiate an editor and + * {@link TableEditor::create()} to create a table. + * * @param array $columns * @param array $indexes * @param array $uniqueConstraints * @param array $fkConstraints * @param array $options + * @param array $renamedColumns */ public function __construct( string $name, @@ -100,6 +104,7 @@ public function __construct( array $options = [], ?TableConfiguration $configuration = null, ?PrimaryKeyConstraint $primaryKeyConstraint = null, + array $renamedColumns = [], ) { if ($name === '') { throw InvalidTableName::new($name); @@ -132,6 +137,8 @@ public function __construct( } $this->_options = array_merge($this->_options, $options); + + $this->renamedColumns = $renamedColumns; } protected function getNameParser(): OptionallyQualifiedNameParser @@ -195,8 +202,16 @@ public function setPrimaryKey(array $columnNames, ?string $indexName = null): se return $this; } + /** @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::addPrimaryKeyConstraint()} instead. */ public function addPrimaryKeyConstraint(PrimaryKeyConstraint $primaryKeyConstraint): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::addPrimaryKeyConstraint() instead.', + __METHOD__, + ); + $this->setPrimaryKey( array_map( static fn (UnqualifiedName $columnName): string => $columnName->toString(), @@ -218,6 +233,8 @@ public function addPrimaryKeyConstraint(PrimaryKeyConstraint $primaryKeyConstrai } /** + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::addUniqueConstraint()} instead. + * * @param non-empty-list $columnNames * @param array $flags * @param array $options @@ -228,6 +245,13 @@ public function addUniqueConstraint( array $flags = [], array $options = [], ): self { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::addUniqueConstraint() instead.', + __METHOD__, + ); + $indexName ??= $this->_generateIdentifierName( array_merge([$this->getName()], $columnNames), 'uniq', @@ -238,6 +262,8 @@ public function addUniqueConstraint( } /** + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::addIndex()} instead. + * * @param non-empty-list $columnNames * @param array $flags * @param array $options @@ -248,6 +274,13 @@ public function addIndex( array $flags = [], array $options = [], ): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::addIndex() instead.', + __METHOD__, + ); + $indexName ??= $this->_generateIdentifierName( array_merge([$this->getName()], $columnNames), 'idx', @@ -259,9 +292,19 @@ public function addIndex( /** * Drops the primary key from this table. + * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::dropPrimaryKeyConstraint()} + * instead. */ public function dropPrimaryKey(): void { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::dropPrimaryKeyConstraint() instead.', + __METHOD__, + ); + $this->primaryKeyConstraint = null; $this->failedToParsePrimaryKeyConstraint = false; @@ -275,9 +318,18 @@ public function dropPrimaryKey(): void /** * Drops an index from this table. + * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::dropIndex()} instead. */ public function dropIndex(string $name): void { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::dropIndex() instead.', + __METHOD__, + ); + $name = $this->normalizeIdentifier($name); if (! $this->hasIndex($name)) { @@ -288,11 +340,20 @@ public function dropIndex(string $name): void } /** + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::addIndex()} instead. + * * @param non-empty-list $columnNames * @param array $options */ public function addUniqueIndex(array $columnNames, ?string $indexName = null, array $options = []): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::addIndex() instead.', + __METHOD__, + ); + $indexName ??= $this->_generateIdentifierName( array_merge([$this->getName()], $columnNames), 'uniq', @@ -305,12 +366,21 @@ public function addUniqueIndex(array $columnNames, ?string $indexName = null, ar /** * Renames an index. * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::renameIndex()} instead. + * * @param string $oldName The name of the index to rename from. * @param string|null $newName The name of the index to rename to. If null is given, the index name * will be auto-generated. */ public function renameIndex(string $oldName, ?string $newName = null): self { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::renameIndex() instead.', + __METHOD__, + ); + if (! $this->hasIndex($oldName)) { throw IndexDoesNotExist::new($oldName, $this->_name); } @@ -380,13 +450,22 @@ public function columnsAreIndexed(array $columnNames): bool } /** + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::addColumn()} instead. + * * @param array $options * * @throws TypesException */ public function addColumn(string $name, string $typeName, array $options = []): Column { - $column = new Column($name, Type::getType($typeName), $options); + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::addColumn() instead.', + __METHOD__, + ); + + $column = new Column($name, $typeName, $options); $this->_addColumn($column); @@ -400,6 +479,8 @@ final public function getRenamedColumns(): array } /** + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::renameColumn()} instead. + * * @param non-empty-string $oldName * @param non-empty-string $newName * @@ -407,6 +488,13 @@ final public function getRenamedColumns(): array */ final public function renameColumn(string $oldName, string $newName): Column { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::renameColumn() instead.', + __METHOD__, + ); + $oldName = $this->normalizeIdentifier($oldName); $newName = $this->normalizeIdentifier($newName); @@ -442,9 +530,20 @@ final public function renameColumn(string $oldName, string $newName): Column return $column; } - /** @param array $options */ + /** + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::modifyColumn()} instead. + * + * @param array $options + */ public function modifyColumn(string $name, array $options): self { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::modifyColumn() instead.', + __METHOD__, + ); + $column = $this->getColumn($name); $column->setOptions($options); @@ -453,9 +552,18 @@ public function modifyColumn(string $name, array $options): self /** * Drops a Column from the Table. + * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::dropColumn()} instead. */ public function dropColumn(string $name): self { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::dropColumn() instead.', + __METHOD__, + ); + $name = $this->normalizeIdentifier($name); $foreignKeyConstraintNames = $this->getForeignKeyConstraintNamesByLocalColumnName($name); @@ -492,6 +600,8 @@ public function dropColumn(string $name): self * * Name is inferred from the local columns. * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::addForeignKeyConstraint()} instead. + * * @param non-empty-list $localColumnNames * @param non-empty-list $foreignColumnNames * @param array $options @@ -503,6 +613,13 @@ public function addForeignKeyConstraint( array $options = [], ?string $name = null, ): self { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::addForeignKeyConstraint() instead.', + __METHOD__, + ); + $name ??= $this->_generateIdentifierName( array_merge([$this->getName()], $localColumnNames), 'fk', @@ -526,8 +643,20 @@ public function addForeignKeyConstraint( return $this->_addForeignKeyConstraint($constraint); } + /** + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::setOptions()} instead. + * + * @return $this + */ public function addOption(string $name, mixed $value): self { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::setOptions() instead.', + __METHOD__, + ); + $this->_options[$name] = $value; return $this; @@ -575,9 +704,19 @@ public function removeForeignKey(string $name): void /** * Drops the foreign key constraint with the given name. + * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::dropForeignKeyConstraint()} + * instead. */ public function dropForeignKey(string $name): void { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::dropForeignKeyConstraint() instead.', + __METHOD__, + ); + $name = $this->normalizeIdentifier($name); if (! $this->hasForeignKey($name)) { @@ -629,9 +768,18 @@ public function removeUniqueConstraint(string $name): void /** * Drops the unique constraint with the given name. + * + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::dropUniqueConstraint()} instead. */ public function dropUniqueConstraint(string $name): void { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::dropUniqueConstraint() instead.', + __METHOD__, + ); + $name = $this->normalizeIdentifier($name); if (! $this->hasUniqueConstraint($name)) { @@ -984,8 +1132,20 @@ private function normalizeIdentifier(string $identifier): string return $this->trimQuotes(strtolower($identifier)); } + /** + * @deprecated since doctrine/dbal 4.5. Use {@see edit()} and {@see TableEditor::setComment()} instead. + * + * @return $this + */ public function setComment(string $comment): self { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7389', + '%s is deprecated. Use Table::edit() and TableEditor::setComment() instead.', + __METHOD__, + ); + // For keeping backward compatibility with MySQL in previous releases, table comments are stored as options. $this->addOption('comment', $comment); @@ -1097,18 +1257,16 @@ private function renameColumnInIndexes(string $oldName, string $newName): void } } - if (! $modified) { - continue; + if ($modified) { + $this->_indexes[$key] = new Index( + $index->getName(), + $columns, + $index->isUnique(), + $index->isPrimary(), + $index->getFlags(), + $index->getOptions(), + ); } - - $this->_indexes[$key] = new Index( - $index->getName(), - $columns, - $index->isUnique(), - $index->isPrimary(), - $index->getFlags(), - $index->getOptions(), - ); } } @@ -1130,17 +1288,15 @@ private function renameColumnInForeignKeyConstraints(string $oldName, string $ne } } - if (! $modified) { - continue; + if ($modified) { + $this->_fkConstraints[$key] = new ForeignKeyConstraint( + $localColumns, // @phpstan-ignore argument.type + $constraint->getForeignTableName(), + $constraint->getForeignColumns(), // @phpstan-ignore argument.type + $constraint->getName(), + $constraint->getOptions(), + ); } - - $this->_fkConstraints[$key] = new ForeignKeyConstraint( - $localColumns, // @phpstan-ignore argument.type - $constraint->getForeignTableName(), - $constraint->getForeignColumns(), // @phpstan-ignore argument.type - $constraint->getName(), - $constraint->getOptions(), - ); } } @@ -1162,16 +1318,14 @@ private function renameColumnInUniqueConstraints(string $oldName, string $newNam } } - if (! $modified) { - continue; + if ($modified) { + $this->uniqueConstraints[$key] = new UniqueConstraint( + $constraint->getName(), + $columns, // @phpstan-ignore argument.type + $constraint->getFlags(), + $constraint->getOptions(), + ); } - - $this->uniqueConstraints[$key] = new UniqueConstraint( - $constraint->getName(), - $columns, // @phpstan-ignore argument.type - $constraint->getFlags(), - $constraint->getOptions(), - ); } } diff --git a/core/vendor/doctrine/dbal/src/Schema/TableDiff.php b/core/vendor/doctrine/dbal/src/Schema/TableDiff.php index 966e39ad7c..210ae896da 100644 --- a/core/vendor/doctrine/dbal/src/Schema/TableDiff.php +++ b/core/vendor/doctrine/dbal/src/Schema/TableDiff.php @@ -69,17 +69,15 @@ public function __construct( } } - if (count($modifiedForeignKeys) === 0) { - return; + if (count($modifiedForeignKeys) !== 0) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6827', + 'Passing a non-empty $modifiedForeignKeys value to %s() is deprecated. Instead, pass dropped' + . ' constraints via $droppedForeignKeys and added constraints via $addedForeignKeys.', + __METHOD__, + ); } - - Deprecation::trigger( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/6827', - 'Passing a non-empty $modifiedForeignKeys value to %s() is deprecated. Instead, pass dropped' - . ' constraints via $droppedForeignKeys and added constraints via $addedForeignKeys.', - __METHOD__, - ); } public function getOldTable(): Table @@ -208,12 +206,36 @@ static function (Index $droppedIndex) use ($index): bool { ); } - /** @return array */ + /** + * @deprecated Use {@see getIndexRenames()} instead. + * + * @return array + */ public function getRenamedIndexes(): array { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/7368', + '%s() is deprecated, use getIndexRenames() instead.', + __METHOD__, + ); + return $this->renamedIndexes; } + /** @return list */ + public function getIndexRenames(): array + { + $renames = []; + + foreach ($this->renamedIndexes as $oldName => $newIndex) { + /** @phpstan-ignore argument.type */ + $renames[] = new IndexRename(UnqualifiedName::unquoted((string) $oldName), $newIndex); + } + + return $renames; + } + /** @return array */ public function getAddedForeignKeys(): array { diff --git a/core/vendor/doctrine/dbal/src/Schema/TableEditor.php b/core/vendor/doctrine/dbal/src/Schema/TableEditor.php index bc921a7b49..e678125622 100644 --- a/core/vendor/doctrine/dbal/src/Schema/TableEditor.php +++ b/core/vendor/doctrine/dbal/src/Schema/TableEditor.php @@ -14,6 +14,7 @@ use Doctrine\DBAL\Schema\Name\UnqualifiedName; use function strcasecmp; +use function strtolower; final class TableEditor { @@ -22,9 +23,15 @@ final class TableEditor /** @var UnqualifiedNamedObjectSet */ private readonly UnqualifiedNamedObjectSet $columns; + /** @var array keys are new names, values are old names */ + private array $renamedColumns = []; + /** @var UnqualifiedNamedObjectSet */ private UnqualifiedNamedObjectSet $indexes; + /** @var list */ + private array $indexEditors = []; + private ?PrimaryKeyConstraint $primaryKeyConstraint = null; /** @var OptionallyUnqualifiedNamedObjectSet */ @@ -140,6 +147,10 @@ public function modifyColumnByUnquotedName(string $columnName, callable $modific return $this->modifyColumn(UnqualifiedName::unquoted($columnName), $modification); } + /** + * Renames a column and records it in {@see Table::getRenamedColumns()} of the resulting table. The record spans + * only this edit: a table derived from the result does not inherit it. + */ public function renameColumn(UnqualifiedName $oldColumnName, UnqualifiedName $newColumnName): self { $this->modifyColumn($oldColumnName, static function (ColumnEditor $editor) use ($newColumnName): void { @@ -151,6 +162,19 @@ public function renameColumn(UnqualifiedName $oldColumnName, UnqualifiedName $ne $this->renameColumnInForeignKeyConstraints($oldColumnName, $newColumnName); $this->renameColumnInUniqueConstraints($oldColumnName, $newColumnName); + $oldKey = $this->getColumnKey($oldColumnName); + $newKey = $this->getColumnKey($newColumnName); + + // If a column is renamed multiple times, only the original and the last new name are kept. + if (isset($this->renamedColumns[$oldKey])) { + $oldKey = $this->renamedColumns[$oldKey]; + unset($this->renamedColumns[$this->getColumnKey($oldColumnName)]); + } + + if ($newKey !== $oldKey) { + $this->renamedColumns[$newKey] = $oldKey; + } + return $this; } @@ -170,15 +194,13 @@ private function renameColumnInIndexes(UnqualifiedName $oldColumnName, Unqualifi } } - if (! $modified) { - continue; + if ($modified) { + $this->indexes->modify($index->getObjectName(), static function (Index $index) use ($columns): Index { + return $index->edit() + ->setColumns(...$columns) + ->create(); + }); } - - $this->indexes->modify($index->getObjectName(), static function (Index $index) use ($columns): Index { - return $index->edit() - ->setColumns(...$columns) - ->create(); - }); } } @@ -202,13 +224,11 @@ private function renameColumnInPrimaryKeyConstraint( } } - if (! $modified) { - return; + if ($modified) { + $this->primaryKeyConstraint = $this->primaryKeyConstraint->edit() + ->setColumnNames(...$columnNames) + ->create(); } - - $this->primaryKeyConstraint = $this->primaryKeyConstraint->edit() - ->setColumnNames(...$columnNames) - ->create(); } private function renameColumnInUniqueConstraints( @@ -325,9 +345,11 @@ public function dropColumnByUnquotedName(string $columnName): self return $this->dropColumn(UnqualifiedName::unquoted($columnName)); } - public function setIndexes(Index ...$indexes): self + /** Replaces the indexes, accepting {@see Index} objects and editors alike, as {@see addIndex()}. */ + public function setIndexes(Index|IndexEditor ...$indexes): self { $this->indexes->clear(); + $this->indexEditors = []; foreach ($indexes as $index) { $this->addIndex($index); @@ -336,8 +358,18 @@ public function setIndexes(Index ...$indexes): self return $this; } - public function addIndex(Index $index): self + /** + * Adds an index. An {@see Index} is added as is; an {@see IndexEditor} without a name produces an index whose + * name is generated from this table and the indexed columns. + */ + public function addIndex(Index|IndexEditor $index): self { + if ($index instanceof IndexEditor) { + $this->indexEditors[] = $index; + + return $this; + } + try { $this->indexes->add($index); } catch (ObjectAlreadyExists $e) { @@ -507,6 +539,11 @@ private function namesEqual(UnqualifiedName $name1, UnqualifiedName $name2): boo return strcasecmp($name1->getIdentifier()->getValue(), $name2->getIdentifier()->getValue()) === 0; } + private function getColumnKey(UnqualifiedName $name): string + { + return strtolower($name->getIdentifier()->getValue()); + } + public function setComment(string $comment): self { $this->comment = $comment; @@ -545,7 +582,7 @@ public function create(): Table $options['comment'] = $this->comment; } - return new Table( + $table = new Table( $this->name->toString(), $this->columns->toList(), $this->indexes->toList(), @@ -554,6 +591,13 @@ public function create(): Table $options, $this->configuration, $this->primaryKeyConstraint, + $this->renamedColumns, ); + + foreach ($this->indexEditors as $indexEditor) { + $indexEditor->addToTable($table); + } + + return $table; } } diff --git a/core/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php b/core/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php index 6116e0b98c..eda576f372 100644 --- a/core/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php +++ b/core/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php @@ -322,10 +322,8 @@ protected function addColumn(string $column): void $this->columns[$column] = new Identifier($column); - $parser = Parsers::getUnqualifiedNameParser(); - try { - $this->columnNames[] = $parser->parse($column); + $this->columnNames[] = Parsers::parseUnqualifiedName($column); } catch (Throwable $e) { $this->failedToParseColumnNames = true; diff --git a/core/vendor/doctrine/dbal/src/Schema/UniqueConstraintEditor.php b/core/vendor/doctrine/dbal/src/Schema/UniqueConstraintEditor.php index d65ab2a73e..4bed45e4b8 100644 --- a/core/vendor/doctrine/dbal/src/Schema/UniqueConstraintEditor.php +++ b/core/vendor/doctrine/dbal/src/Schema/UniqueConstraintEditor.php @@ -88,6 +88,25 @@ public function setQuotedColumnNames( return $this; } + public function addColumnName(UnqualifiedName $columnName): self + { + $this->columnNames[] = $columnName; + + return $this; + } + + /** @param non-empty-string $name */ + public function addUnquotedColumnName(string $name): self + { + return $this->addColumnName(UnqualifiedName::unquoted($name)); + } + + /** @param non-empty-string $name */ + public function addQuotedColumnName(string $name): self + { + return $this->addColumnName(UnqualifiedName::quoted($name)); + } + public function setIsClustered(bool $isClustered): self { $this->isClustered = $isClustered; diff --git a/core/vendor/doctrine/dbal/src/Types/DateTimeUtcImmutableType.php b/core/vendor/doctrine/dbal/src/Types/DateTimeUtcImmutableType.php new file mode 100644 index 0000000000..3ae67f5442 --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Types/DateTimeUtcImmutableType.php @@ -0,0 +1,97 @@ +getDateTimeTypeDeclarationSQL($column); + } + + /** + * @param T $value + * + * @return (T is null ? null : string) + * + * @template T + */ + public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeImmutable) { + return $value->setTimezone(self::getUtc()) + ->format($platform->getDateTimeFormatString()); + } + + throw InvalidType::new( + $value, + static::class, + ['null', DateTimeImmutable::class], + ); + } + + /** + * @param T $value + * + * @return (T is null ? null : DateTimeImmutable) + * + * @template T + */ + public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?DateTimeImmutable + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = DateTimeImmutable::createFromFormat( + $platform->getDateTimeFormatString(), + $value, + self::getUtc(), + ); + + if ($dateTime !== false) { + return $dateTime; + } + + try { + return new DateTimeImmutable($value, self::getUtc()); + } catch (Throwable $e) { + throw InvalidFormat::new( + $value, + static::class, + $platform->getDateTimeFormatString(), + $e, + ); + } + } + + private static function getUtc(): DateTimeZone + { + return self::$utc ??= new DateTimeZone('UTC'); + } +} diff --git a/core/vendor/doctrine/dbal/src/Types/DateTimeUtcType.php b/core/vendor/doctrine/dbal/src/Types/DateTimeUtcType.php new file mode 100644 index 0000000000..d7bb5f1fc5 --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Types/DateTimeUtcType.php @@ -0,0 +1,97 @@ +getDateTimeTypeDeclarationSQL($column); + } + + /** + * @param T $value + * + * @return (T is null ? null : string) + * + * @template T + */ + public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTime) { + return (clone $value)->setTimezone(self::getUtc()) + ->format($platform->getDateTimeFormatString()); + } + + throw InvalidType::new( + $value, + static::class, + ['null', DateTime::class], + ); + } + + /** + * @param T $value + * + * @return (T is null ? null : DateTime) + * + * @template T + */ + public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?DateTime + { + if ($value === null || $value instanceof DateTime) { + return $value; + } + + $dateTime = DateTime::createFromFormat( + $platform->getDateTimeFormatString(), + $value, + self::getUtc(), + ); + + if ($dateTime !== false) { + return $dateTime; + } + + try { + return new DateTime($value, self::getUtc()); + } catch (Throwable $e) { + throw InvalidFormat::new( + $value, + static::class, + $platform->getDateTimeFormatString(), + $e, + ); + } + } + + private static function getUtc(): DateTimeZone + { + return self::$utc ??= new DateTimeZone('UTC'); + } +} diff --git a/core/vendor/doctrine/dbal/src/Types/FloatType.php b/core/vendor/doctrine/dbal/src/Types/FloatType.php index 40e11f9f53..282f9c5e9c 100644 --- a/core/vendor/doctrine/dbal/src/Types/FloatType.php +++ b/core/vendor/doctrine/dbal/src/Types/FloatType.php @@ -6,7 +6,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; -class FloatType extends Type +class FloatType extends Type implements PhpFloatMappingType { /** * {@inheritDoc} diff --git a/core/vendor/doctrine/dbal/src/Types/PhpFloatMappingType.php b/core/vendor/doctrine/dbal/src/Types/PhpFloatMappingType.php new file mode 100644 index 0000000000..0fe86e9bdd --- /dev/null +++ b/core/vendor/doctrine/dbal/src/Types/PhpFloatMappingType.php @@ -0,0 +1,14 @@ + AsciiStringType::class, - Types::BIGINT => BigIntType::class, - Types::BINARY => BinaryType::class, - Types::BLOB => BlobType::class, - Types::BOOLEAN => BooleanType::class, - Types::DATE_MUTABLE => DateType::class, - Types::DATE_IMMUTABLE => DateImmutableType::class, - Types::DATEINTERVAL => DateIntervalType::class, - Types::DATETIME_MUTABLE => DateTimeType::class, - Types::DATETIME_IMMUTABLE => DateTimeImmutableType::class, - Types::DATETIMETZ_MUTABLE => DateTimeTzType::class, - Types::DATETIMETZ_IMMUTABLE => DateTimeTzImmutableType::class, - Types::DECIMAL => DecimalType::class, - Types::NUMBER => NumberType::class, - Types::ENUM => EnumType::class, - Types::FLOAT => FloatType::class, - Types::GUID => GuidType::class, - Types::INTEGER => IntegerType::class, - Types::JSON => JsonType::class, - Types::JSON_OBJECT => JsonObjectType::class, - Types::JSONB => JsonbType::class, - Types::JSONB_OBJECT => JsonbObjectType::class, - Types::SIMPLE_ARRAY => SimpleArrayType::class, - Types::SMALLFLOAT => SmallFloatType::class, - Types::SMALLINT => SmallIntType::class, - Types::STRING => StringType::class, - Types::TEXT => TextType::class, - Types::TIME_MUTABLE => TimeType::class, - Types::TIME_IMMUTABLE => TimeImmutableType::class, + Types::ASCII_STRING => AsciiStringType::class, + Types::BIGINT => BigIntType::class, + Types::BINARY => BinaryType::class, + Types::BLOB => BlobType::class, + Types::BOOLEAN => BooleanType::class, + Types::DATE_MUTABLE => DateType::class, + Types::DATE_IMMUTABLE => DateImmutableType::class, + Types::DATEINTERVAL => DateIntervalType::class, + Types::DATETIME_MUTABLE => DateTimeType::class, + Types::DATETIME_IMMUTABLE => DateTimeImmutableType::class, + Types::DATETIME_UTC_MUTABLE => DateTimeUtcType::class, + Types::DATETIME_UTC_IMMUTABLE => DateTimeUtcImmutableType::class, + Types::DATETIMETZ_MUTABLE => DateTimeTzType::class, + Types::DATETIMETZ_IMMUTABLE => DateTimeTzImmutableType::class, + Types::DECIMAL => DecimalType::class, + Types::NUMBER => NumberType::class, + Types::ENUM => EnumType::class, + Types::FLOAT => FloatType::class, + Types::GUID => GuidType::class, + Types::INTEGER => IntegerType::class, + Types::JSON => JsonType::class, + Types::JSON_OBJECT => JsonObjectType::class, + Types::JSONB => JsonbType::class, + Types::JSONB_OBJECT => JsonbObjectType::class, + Types::SIMPLE_ARRAY => SimpleArrayType::class, + Types::SMALLFLOAT => SmallFloatType::class, + Types::SMALLINT => SmallIntType::class, + Types::STRING => StringType::class, + Types::TEXT => TextType::class, + Types::TIME_MUTABLE => TimeType::class, + Types::TIME_IMMUTABLE => TimeImmutableType::class, ]; private static ?TypeRegistry $typeRegistry = null; diff --git a/core/vendor/doctrine/dbal/src/Types/Types.php b/core/vendor/doctrine/dbal/src/Types/Types.php index 91a3e4d7d4..c70432b230 100644 --- a/core/vendor/doctrine/dbal/src/Types/Types.php +++ b/core/vendor/doctrine/dbal/src/Types/Types.php @@ -9,35 +9,40 @@ */ final class Types { - public const ASCII_STRING = 'ascii_string'; - public const BIGINT = 'bigint'; - public const BINARY = 'binary'; - public const BLOB = 'blob'; - public const BOOLEAN = 'boolean'; - public const DATE_MUTABLE = 'date'; - public const DATE_IMMUTABLE = 'date_immutable'; - public const DATEINTERVAL = 'dateinterval'; - public const DATETIME_MUTABLE = 'datetime'; - public const DATETIME_IMMUTABLE = 'datetime_immutable'; - public const DATETIMETZ_MUTABLE = 'datetimetz'; - public const DATETIMETZ_IMMUTABLE = 'datetimetz_immutable'; - public const DECIMAL = 'decimal'; - public const NUMBER = 'number'; - public const FLOAT = 'float'; - public const ENUM = 'enum'; - public const GUID = 'guid'; - public const INTEGER = 'integer'; - public const JSON = 'json'; - public const JSON_OBJECT = 'json_object'; - public const JSONB = 'jsonb'; - public const JSONB_OBJECT = 'jsonb_object'; - public const SIMPLE_ARRAY = 'simple_array'; - public const SMALLFLOAT = 'smallfloat'; - public const SMALLINT = 'smallint'; - public const STRING = 'string'; - public const TEXT = 'text'; - public const TIME_MUTABLE = 'time'; - public const TIME_IMMUTABLE = 'time_immutable'; + public const ASCII_STRING = 'ascii_string'; + public const BIGINT = 'bigint'; + public const BINARY = 'binary'; + public const BLOB = 'blob'; + public const BOOLEAN = 'boolean'; + public const DATE_MUTABLE = 'date'; + public const DATE_IMMUTABLE = 'date_immutable'; + public const DATEINTERVAL = 'dateinterval'; + public const DATETIME_MUTABLE = 'datetime'; + public const DATETIME_IMMUTABLE = 'datetime_immutable'; + public const DATETIME_UTC_MUTABLE = 'datetime_utc'; + public const DATETIME_UTC_IMMUTABLE = 'datetime_utc_immutable'; + public const DATETIMETZ_MUTABLE = 'datetimetz'; + public const DATETIMETZ_IMMUTABLE = 'datetimetz_immutable'; + public const DECIMAL = 'decimal'; + public const NUMBER = 'number'; + public const FLOAT = 'float'; + public const ENUM = 'enum'; + public const GUID = 'guid'; + public const INTEGER = 'integer'; + public const JSON = 'json'; + public const JSON_OBJECT = 'json_object'; + public const JSONB = 'jsonb'; + public const JSONB_OBJECT = 'jsonb_object'; + + /** @deprecated Use {@see Types::JSON} instead. */ + public const SIMPLE_ARRAY = 'simple_array'; + + public const SMALLFLOAT = 'smallfloat'; + public const SMALLINT = 'smallint'; + public const STRING = 'string'; + public const TEXT = 'text'; + public const TIME_MUTABLE = 'time'; + public const TIME_IMMUTABLE = 'time_immutable'; /** @codeCoverageIgnore */ private function __construct() diff --git a/core/vendor/doctrine/lexer/src/AbstractLexer.php b/core/vendor/doctrine/lexer/src/AbstractLexer.php index 260ace4780..de7c62d5cd 100644 --- a/core/vendor/doctrine/lexer/src/AbstractLexer.php +++ b/core/vendor/doctrine/lexer/src/AbstractLexer.php @@ -7,6 +7,7 @@ use ReflectionClass; use UnitEnum; +use function count; use function implode; use function preg_split; use function sprintf; @@ -112,13 +113,31 @@ public function resetPeek() /** * Resets the lexer position on the input to the given position. * - * @param int $position Position to place the lexical scanner. + * @param int $position Character offset into the input, as found in + * Token::$position. * * @return void */ public function resetPosition(int $position = 0) { - $this->position = $position; + $this->position = $this->findTokenIndexAtOrAfterOffset($position); + } + + /** + * Finds the index of the first token at or after the given offset. + * + * Token offsets are strictly increasing, so a linear scan suffices. + * Returns one past the end when there is no such token. + */ + private function findTokenIndexAtOrAfterOffset(int $offset): int + { + foreach ($this->tokens as $index => $token) { + if ($token->position >= $offset) { + return $index; + } + } + + return count($this->tokens); } /** diff --git a/core/vendor/illuminate/database/Connectors/PostgresConnector.php b/core/vendor/illuminate/database/Connectors/PostgresConnector.php index 31d2ff4732..dd77c7cd1a 100644 --- a/core/vendor/illuminate/database/Connectors/PostgresConnector.php +++ b/core/vendor/illuminate/database/Connectors/PostgresConnector.php @@ -91,7 +91,7 @@ protected function getDsn(array $config) $dsn .= ";application_name='".str_replace("'", "\'", $application_name)."'"; } - return $this->addSslOptions($dsn, $config); + return $this->addServerOptions($this->addSslOptions($dsn, $config), $config); } /** @@ -112,6 +112,30 @@ protected function addSslOptions($dsn, array $config) return $dsn; } + /** + * Add the server options to the DSN. + * + * @param string $dsn + * @param array $config + * @return string + */ + protected function addServerOptions($dsn, array $config) + { + if (empty($config['server_options'])) { + return $dsn; + } + + $options = []; + + foreach ($config['server_options'] as $name => $value) { + $options[] = '-c '.$name.'='.str_replace(['\\', ' '], ['\\\\', '\\ '], (string) $value); + } + + $options = str_replace(['\\', "'"], ['\\\\', "\\'"], implode(' ', $options)); + + return $dsn.";options='{$options}'"; + } + /** * Set the connection transaction isolation level. * diff --git a/core/vendor/illuminate/filesystem/FilesystemManager.php b/core/vendor/illuminate/filesystem/FilesystemManager.php index 57533ba4b9..61ea6031e4 100644 --- a/core/vendor/illuminate/filesystem/FilesystemManager.php +++ b/core/vendor/illuminate/filesystem/FilesystemManager.php @@ -2,6 +2,7 @@ namespace Illuminate\Filesystem; +use Aws\Credentials\CredentialProvider; use Aws\S3\S3Client; use Closure; use Illuminate\Contracts\Filesystem\Factory as FactoryContract; @@ -266,12 +267,32 @@ public function createS3Driver(array $config) * * @param array $config * @return array + * + * @throws \InvalidArgumentException */ protected function formatS3Config(array $config) { $config += ['version' => 'latest']; - if (! empty($config['key']) && ! empty($config['secret'])) { + $credentials = $config['credentials'] ?? null; + + $provider = is_array($credentials) ? ($credentials['provider'] ?? null) : $credentials; + + if (is_string($provider)) { + $options = is_array($credentials) ? Arr::except($credentials, ['provider']) : []; + + $provider = CredentialProvider::memoize(match ($provider) { + 'ecs' => CredentialProvider::ecsCredentials($options), + 'instance' => CredentialProvider::instanceProfile($options), + default => throw new InvalidArgumentException( + "Invalid credential provider [{$provider}]." + ), + }); + } + + if ($provider) { + $config['credentials'] = $provider; + } elseif (! empty($config['key']) && ! empty($config['secret'])) { $config['credentials'] = Arr::only($config, ['key', 'secret']); if (! empty($config['token'])) { diff --git a/core/vendor/illuminate/filesystem/LocalFilesystemAdapter.php b/core/vendor/illuminate/filesystem/LocalFilesystemAdapter.php index dc9aa2d6c8..e246c8b5b0 100644 --- a/core/vendor/illuminate/filesystem/LocalFilesystemAdapter.php +++ b/core/vendor/illuminate/filesystem/LocalFilesystemAdapter.php @@ -80,7 +80,7 @@ public function temporaryUrl($path, $expiration, array $options = []) return $url->to($url->temporarySignedRoute( 'storage.'.$this->disk, $expiration, - ['path' => strtr(rawurlencode($path), ['%2F' => '/'])], + ['path' => $path], absolute: false )); } @@ -111,7 +111,7 @@ public function temporaryUploadUrl($path, $expiration, array $options = []) 'url' => $url->to($url->temporarySignedRoute( 'storage.'.$this->disk.'.upload', $expiration, - ['path' => strtr(rawurlencode($path), ['%2F' => '/']), 'upload' => true], + ['path' => $path, 'upload' => true], absolute: false )), 'headers' => [], diff --git a/core/vendor/illuminate/queue/Worker.php b/core/vendor/illuminate/queue/Worker.php index 282e9c9669..6300b32a6d 100644 --- a/core/vendor/illuminate/queue/Worker.php +++ b/core/vendor/illuminate/queue/Worker.php @@ -106,6 +106,13 @@ class Worker */ protected static $popCallbacks = []; + /** + * The callback used to kill the worker process. + * + * @var (callable(int): mixed)|null + */ + protected static $killCallback; + /** * The custom exit code to be used when memory is exceeded. * @@ -113,6 +120,13 @@ class Worker */ public static $memoryExceededExitCode; + /** + * The custom exit code to be used when a job times out. + * + * @var int|null + */ + public static $timedOutExitCode; + /** * Indicates if the worker should check for the restart signal in the cache. * @@ -268,7 +282,7 @@ protected function registerTimeoutHandler($job, WorkerOptions $options) )); } - $this->kill(static::EXIT_ERROR, $options, WorkerStopReason::TimedOut); + $this->kill(static::$timedOutExitCode ?? static::EXIT_ERROR, $options, WorkerStopReason::TimedOut); }, true); pcntl_alarm( @@ -865,6 +879,10 @@ public function kill($status = 0, $options = null, $reason = null) { $this->events->dispatch(new WorkerStopping($status, $options, $reason)); + if (static::$killCallback) { + call_user_func(static::$killCallback, $status); + } + if (extension_loaded('posix')) { posix_kill(getmypid(), SIGKILL); } @@ -951,6 +969,17 @@ public static function popUsing($workerName, $callback) } } + /** + * Register a callback to be used to kill the worker process. + * + * @param (callable(int): mixed)|null $callback + * @return void + */ + public static function killUsing($callback) + { + static::$killCallback = $callback; + } + /** * Get the queue manager instance. * diff --git a/core/vendor/illuminate/routing/Route.php b/core/vendor/illuminate/routing/Route.php index 2d92ed2da8..fa448b5242 100644 --- a/core/vendor/illuminate/routing/Route.php +++ b/core/vendor/illuminate/routing/Route.php @@ -1322,9 +1322,17 @@ public static function getValidators() public function toSymfonyRoute() { return new SymfonyRoute( - preg_replace('/\{(\w+?)\?\}/', '{$1}', $this->uri()), $this->getOptionalParameterNames(), - $this->wheres, ['utf8' => true], - $this->getDomain() ?: '', [], $this->methods + preg_replace('/\{(\w+?)\?\}/', '{$1}', $this->uri()), + $this->getOptionalParameterNames(), + $this->wheres, + ['utf8' => true], + $this->getDomain() ?: '', + match (true) { + $this->httpOnly() => ['http'], + $this->secure() => ['https'], + default => [], + }, + $this->methods ); } diff --git a/core/vendor/illuminate/routing/RouteUrlGenerator.php b/core/vendor/illuminate/routing/RouteUrlGenerator.php index 245c4c0115..f4fc59bd50 100644 --- a/core/vendor/illuminate/routing/RouteUrlGenerator.php +++ b/core/vendor/illuminate/routing/RouteUrlGenerator.php @@ -7,6 +7,7 @@ use Illuminate\Routing\Exceptions\UrlGenerationException; use Illuminate\Support\Arr; use Illuminate\Support\Collection; +use Stringable; class RouteUrlGenerator { @@ -341,7 +342,7 @@ protected function replaceRouteParameters($path, array &$parameters) return (! isset($parameters[0]) && ! str_ends_with($match[0], '?}')) ? $match[0] - : Arr::pull($parameters, 0); + : $this->encodeParameter(Arr::pull($parameters, 0)); }, $path); return trim(preg_replace('/\{.*?\?\}/', '', $path), '/'); @@ -358,9 +359,9 @@ protected function replaceNamedParameters($path, &$parameters) { return preg_replace_callback('/\{(.*?)(\?)?\}/', function ($m) use (&$parameters) { if (isset($parameters[$m[1]]) && $parameters[$m[1]] !== '') { - return Arr::pull($parameters, $m[1]); + return $this->encodeParameter(Arr::pull($parameters, $m[1])); } elseif (isset($this->defaultParameters[$m[1]])) { - return $this->defaultParameters[$m[1]]; + return $this->encodeParameter($this->defaultParameters[$m[1]]); } elseif (isset($parameters[$m[1]])) { Arr::pull($parameters, $m[1]); } @@ -369,6 +370,19 @@ protected function replaceNamedParameters($path, &$parameters) }, $path); } + /** + * Encode a parameter value that is being substituted into a route URI. + * + * @param mixed $value + * @return mixed + */ + protected function encodeParameter($value) + { + return is_string($value) || $value instanceof Stringable + ? strtr((string) $value, ['%' => '%25', '?' => '%3F', '#' => '%23']) + : $value; + } + /** * Add a query string to the URI. * diff --git a/core/vendor/illuminate/support/Str.php b/core/vendor/illuminate/support/Str.php index 13cb50b73a..999bb633dc 100644 --- a/core/vendor/illuminate/support/Str.php +++ b/core/vendor/illuminate/support/Str.php @@ -1610,7 +1610,10 @@ public static function trim($value, $charlist = null) if ($charlist === null) { $trimDefaultCharacters = " \n\r\t\v\0"; - return preg_replace('~^[\s'.self::INVISIBLE_CHARACTERS.$trimDefaultCharacters.']+|[\s'.self::INVISIBLE_CHARACTERS.$trimDefaultCharacters.']+$~u', '', $value) ?? trim($value); + $whitespace = '[\s'.self::INVISIBLE_CHARACTERS.$trimDefaultCharacters.']'; + + // The trailing match may only begin at the first character of a whitespace run, keeping this linear... + return preg_replace('~^'.$whitespace.'+|'.$whitespace.'(?isUnsafePathSegment($locale) || + ($group !== '*' && $this->isUnsafePathSegment($group, allowSlashes: true))) { + return []; + } + if ($group === '*' && $namespace === '*') { return $this->loadJsonPaths($locale); } @@ -159,6 +164,23 @@ protected function loadJsonPaths($locale) }, []); } + /** + * Determine if the given value is unsafe to use as part of a translation file path. + * + * @param mixed $value + * @param bool $allowSlashes + * @return bool + */ + protected function isUnsafePathSegment($value, $allowSlashes = false) + { + return ! is_string($value) + || $value === '' + || str_contains($value, '..') + || str_contains($value, '\\') + || str_contains($value, "\0") + || (! $allowSlashes && str_contains($value, '/')); + } + /** * Add a new namespace to the loader. * diff --git a/core/vendor/illuminate/translation/Translator.php b/core/vendor/illuminate/translation/Translator.php index 055c2a23ca..dc29d20190 100644 --- a/core/vendor/illuminate/translation/Translator.php +++ b/core/vendor/illuminate/translation/Translator.php @@ -537,7 +537,7 @@ public function getLocale() */ public function setLocale($locale) { - if (Str::contains($locale, ['/', '\\'])) { + if (Str::contains($locale, ['/', '\\', '..', "\0"])) { throw new InvalidArgumentException('Invalid characters present in locale.'); } diff --git a/core/vendor/justinrainbow/json-schema/CHANGELOG.md b/core/vendor/justinrainbow/json-schema/CHANGELOG.md index 58b8b6340a..a62cb51673 100644 --- a/core/vendor/justinrainbow/json-schema/CHANGELOG.md +++ b/core/vendor/justinrainbow/json-schema/CHANGELOG.md @@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [6.13.1] - 2026-09-30 + +### Fixed +- Fix: Coerce quoted 0 and 1 to booleans ([#965](https://github.com/jsonrainbow/json-schema/pull/965)) +- Fix badge URL for Draft 2019-09 in README ([#964](https://github.com/jsonrainbow/json-schema/pull/964)) + + +## [6.13.0] - 2026-09-23 + +### Fixed +- fix: Reject percent signs that do not introduce a hex triplet in relative references ([#959](https://github.com/jsonrainbow/json-schema/pull/959)) +- Validate iri and iri-reference formats according to RFC 3987 ([#962](https://github.com/jsonrainbow/json-schema/pull/962)) +- Fix uri-template rejecting non-Latin literals on PCRE2 10.46 ([#961](https://github.com/jsonrainbow/json-schema/pull/961)) +- Validate uri-template format according to RFC 6570 ([#960](https://github.com/jsonrainbow/json-schema/pull/960)) +- fix: Address warning on PHPUnit process due to upstream changes ([#956](https://github.com/jsonrainbow/json-schema/pull/956)) +- Resolve nested schema ids against their enclosing base uri ([#947](https://github.com/jsonrainbow/json-schema/pull/947)) + +### Added +- Validate idn-email format ([#963](https://github.com/jsonrainbow/json-schema/pull/963)) + + ## [6.12.0] - 2026-09-04 ### Fixed diff --git a/core/vendor/justinrainbow/json-schema/README.md b/core/vendor/justinrainbow/json-schema/README.md index 88294bcab2..5f400b309b 100644 --- a/core/vendor/justinrainbow/json-schema/README.md +++ b/core/vendor/justinrainbow/json-schema/README.md @@ -16,8 +16,7 @@ of all existing Drafts. See [json-schema](http://json-schema.org/) for more deta ![Draft 4](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft4.json) ![Draft 6](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft6.json) ![Draft 7](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft7.json) -![Draft 2019-09](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fdraft2019-09.json) - +![Draft 2019-09](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft2019-09.json) ## Installation diff --git a/core/vendor/justinrainbow/json-schema/bin/run-test-case b/core/vendor/justinrainbow/json-schema/bin/run-test-case index 4575caa60e..86b6dc38f6 100644 --- a/core/vendor/justinrainbow/json-schema/bin/run-test-case +++ b/core/vendor/justinrainbow/json-schema/bin/run-test-case @@ -150,7 +150,7 @@ if ($testDesc !== null && $foundTest === null) { } // Determine check mode (mirrors JsonSchemaTestSuiteTest::getCheckModeForDraft) -$checkMode = in_array($draft, ['draft6', 'draft7'], true) +$checkMode = in_array($draft, ['draft6', 'draft7', 'draft2019-09'], true) ? Constraint::CHECK_MODE_NORMAL | Constraint::CHECK_MODE_STRICT : Constraint::CHECK_MODE_NORMAL; diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/ConstraintError.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/ConstraintError.php index 081e38ad74..0934292c35 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/ConstraintError.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/ConstraintError.php @@ -25,6 +25,7 @@ class ConstraintError extends Enum public const FORMAT_DATE = 'dateFormat'; public const FORMAT_DATE_TIME = 'dateTimeFormat'; public const FORMAT_DATE_UTC = 'dateUtcFormat'; + public const FORMAT_DURATION = 'durationFormat'; public const FORMAT_EMAIL = 'emailFormat'; public const FORMAT_HOSTNAME = 'styleHostName'; public const FORMAT_IP = 'ipFormat'; @@ -36,6 +37,7 @@ class ConstraintError extends Enum public const FORMAT_URI_TEMPLATE = 'uriTemplateFormat'; public const FORMAT_URL = 'urlFormat'; public const FORMAT_URL_REF = 'urlRefFormat'; + public const FORMAT_UUID = 'uuidFormat'; public const INVALID_SCHEMA = 'invalidSchema'; public const LENGTH_MAX = 'maxLength'; public const LENGTH_MIN = 'minLength'; @@ -87,6 +89,7 @@ public function getMessage() self::FORMAT_DATE => 'Invalid date %s, expected format YYYY-MM-DD', self::FORMAT_DATE_TIME => 'Invalid date-time %s, expected format YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DDThh:mm:ss+hh:mm', self::FORMAT_DATE_UTC => 'Invalid time %s, expected integer of milliseconds since Epoch', + self::FORMAT_DURATION => 'Invalid duration %s, expected ISO 8601 duration such as P1DT12H', self::FORMAT_EMAIL => 'Invalid email', self::FORMAT_HOSTNAME => 'Invalid hostname', self::FORMAT_IP => 'Invalid IP address', @@ -98,6 +101,7 @@ public function getMessage() self::FORMAT_URI_TEMPLATE => 'Invalid URI template format', self::FORMAT_URL => 'Invalid URL format', self::FORMAT_URL_REF => 'Invalid URL reference format', + self::FORMAT_UUID => 'Invalid UUID format', self::LENGTH_MAX => 'Must be at most %d characters long', self::INVALID_SCHEMA => 'Schema is not valid', self::LENGTH_MIN => 'Must be at least %d characters long', diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php index d8cc0e008a..d4e74c75fe 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft06/FormatConstraint.php @@ -214,10 +214,26 @@ private function validateRfc3339DateTime(string $value): bool return true; } + /** + * Validates a URI template according to the ABNF of RFC 6570 section 2. + */ private function validateUriTemplate(string $value): bool { + $pctEncoded = '%[0-9A-Fa-f]{2}'; + // Any Unicode character except CTL, SP, '"', '%', '<', '>', '\', '^', '`', '{', '|' and '}' (ucschar / iprivate). + // BMP and supplementary ranges are kept in separate classes, as PCRE2 10.46 fails to match some BMP code + // points when a single class holds too many ranges. + $literal = '(?:[\x21\x23\x24\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E\x{A0}-\x{D7FF}\x{E000}-\x{FDCF}\x{FDF0}-\x{FFEF}]' + . '|[\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}' + . '\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}' + . '\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}\x{F0000}-\x{FFFFD}' + . '\x{100000}-\x{10FFFD}])'; + $varchar = '(?:[A-Za-z0-9_]|' . $pctEncoded . ')'; + $varspec = $varchar . '(?:\.?' . $varchar . ')*(?::[1-9][0-9]{0,3}|\*)?'; + $expression = '\{[+#.\/;?&]?' . $varspec . '(?:,' . $varspec . ')*\}'; + return preg_match( - '/^(?:[^\{\}]*|\{[a-zA-Z0-9_:%\/\.~\-\+\*]+\})*$/', + '/^(?:' . $literal . '|' . $pctEncoded . '|' . $expression . ')*\z/u', $value ) === 1; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php index fd5474b65b..a79e891ff5 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft07/FormatConstraint.php @@ -101,6 +101,16 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n $this->addError(ConstraintError::FORMAT_URL(), $path, ['format' => $schema->format]); } break; + case 'iri': + if (!$this->validateIri($value, false)) { + $this->addError(ConstraintError::FORMAT_URL(), $path, ['format' => $schema->format]); + } + break; + case 'iri-reference': + if (!$this->validateIri($value, true)) { + $this->addError(ConstraintError::FORMAT_URL_REF(), $path, ['format' => $schema->format]); + } + break; case 'uri-template': if (!$this->validateUriTemplate($value)) { $this->addError(ConstraintError::FORMAT_URI_TEMPLATE(), $path, ['format' => $schema->format]); @@ -112,6 +122,11 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n $this->addError(ConstraintError::FORMAT_EMAIL(), $path, ['format' => $schema->format]); } break; + case 'idn-email': + if (!$this->validateInternationalizedEmail($value)) { + $this->addError(ConstraintError::FORMAT_EMAIL(), $path, ['format' => $schema->format]); + } + break; case 'host-name': case 'hostname': if (!$this->validateHostname($value)) { @@ -236,6 +251,37 @@ private function validateHostname(string $host): bool return preg_match($hostnameRegex, $host) === 1; } + /** + * Validates an internationalized e-mail address: a local part according to RFC 6531 section 3.3 and RFC 5321 + * section 4.1.2, and a domain that is a valid internationalized hostname. + */ + private function validateInternationalizedEmail(string $value): bool + { + $at = strrpos($value, '@'); + if ($at === false) { + return false; + } + + $localPart = substr($value, 0, $at); + $domain = substr($value, $at + 1); + + // atext extended with UTF8-non-ascii + $atext = '[A-Za-z0-9!#$%&\'*+\-\/=?^_`{|}~]|[^\x00-\x7F]'; + $dotString = '(?:' . $atext . ')++(?:\.(?:' . $atext . ')++)*+'; + $quotedString = '"(?:[\x20\x21\x23-\x5B\x5D-\x7E]|[^\x00-\x7F]|\\\\[\x20-\x7E])*+"'; + + if (strlen($localPart) > 64 || preg_match('/^(?:' . $dotString . '|' . $quotedString . ')\z/u', $localPart) !== 1) { + return false; + } + + // Unlike a hostname, the domain of an e-mail address can not be written in its absolute form + if (substr($domain, -1) === '.') { + return false; + } + + return $this->validateInternationalizedHostname($domain); + } + private function validateInternationalizedHostname(string $host): bool { if ($host === '') { @@ -349,10 +395,68 @@ private function validateRfc3339DateTime(string $value): bool return true; } + /** + * Validates an IRI or, when $allowRelative is set, an IRI reference according to the ABNF of RFC 3987 section 2.2. + */ + private function validateIri(string $value, bool $allowRelative): bool + { + // iunreserved and sub-delims; BMP and supplementary ranges are kept in separate classes, as PCRE2 10.46 fails + // to match some BMP code points when a single class holds too many ranges. + $bmp = 'A-Za-z0-9\-._~!$&\'()*+,;=\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}'; + $supplementary = '\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}' + . '\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}' + . '\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}'; + // Matches runs of characters possessively, keeping long values within the PCRE backtracking limits + $chars = static function (string $extraBmp, string $extraSupplementary = '') use ($bmp, $supplementary): string { + return '(?:[' . $bmp . $extraBmp . ']++|[' . $supplementary . $extraSupplementary . ']++|%[0-9A-Fa-f]{2})'; + }; + + $scheme = '[A-Za-z][A-Za-z0-9+\-.]*+'; + $ipvFuture = '[vV][0-9A-Fa-f]++\.[A-Za-z0-9\-._~!$&\'()*+,;=:]++'; + $iauthority = '(?:' . $chars(':') . '*+@)?(?:\[(?:(?[0-9A-Fa-f:.]++)|' . $ipvFuture . ')\]|' . $chars('') . '*+)(?::[0-9]*+)?'; + $ipathAbempty = '(?:\/' . $chars(':@') . '*+)*+'; + $ipathAbsolute = '\/(?:' . $chars(':@') . '++' . $ipathAbempty . ')?'; + $ipathRootless = $chars(':@') . '++' . $ipathAbempty; + $ipathNoScheme = $chars('@') . '++' . $ipathAbempty; + $iquery = '(?:\?' . $chars(':@\/?\x{E000}-\x{F8FF}', '\x{F0000}-\x{FFFFD}\x{100000}-\x{10FFFD}') . '*+)?'; + $ifragment = '(?:#' . $chars(':@\/?') . '*+)?'; + + $sharedPart = '(?:\/\/' . $iauthority . $ipathAbempty . '|' . $ipathAbsolute . '|)'; + $pattern = $allowRelative + ? '(?:(?:' . $scheme . ':)?' . $sharedPart . '|' . $scheme . ':' . $ipathRootless . '|' . $ipathNoScheme . ')' + : $scheme . ':(?:' . $sharedPart . '|' . $ipathRootless . ')'; + + if (preg_match('/^' . $pattern . $iquery . $ifragment . '\z/u', $value, $matches) !== 1) { + return false; + } + + if (isset($matches['ipLiteral']) && $matches['ipLiteral'] !== '') { + return filter_var($matches['ipLiteral'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false; + } + + return true; + } + + /** + * Validates a URI template according to the ABNF of RFC 6570 section 2. + */ private function validateUriTemplate(string $value): bool { + $pctEncoded = '%[0-9A-Fa-f]{2}'; + // Any Unicode character except CTL, SP, '"', '%', '<', '>', '\', '^', '`', '{', '|' and '}' (ucschar / iprivate). + // BMP and supplementary ranges are kept in separate classes, as PCRE2 10.46 fails to match some BMP code + // points when a single class holds too many ranges. + $literal = '(?:[\x21\x23\x24\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E\x{A0}-\x{D7FF}\x{E000}-\x{FDCF}\x{FDF0}-\x{FFEF}]' + . '|[\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}' + . '\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}' + . '\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}\x{F0000}-\x{FFFFD}' + . '\x{100000}-\x{10FFFD}])'; + $varchar = '(?:[A-Za-z0-9_]|' . $pctEncoded . ')'; + $varspec = $varchar . '(?:\.?' . $varchar . ')*(?::[1-9][0-9]{0,3}|\*)?'; + $expression = '\{[+#.\/;?&]?' . $varspec . '(?:,' . $varspec . ')*\}'; + return preg_match( - '/^(?:[^\{\}]*|\{[a-zA-Z0-9_:%\/\.~\-\+\*]+\})*$/', + '/^(?:' . $literal . '|' . $pctEncoded . '|' . $expression . ')*\z/u', $value ) === 1; } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php index 419f3cb2aa..75554c4183 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Drafts/Draft2019/FormatConstraint.php @@ -40,7 +40,11 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n } break; case 'time': - if (!$this->validateDateTime($value, 'H:i:sp') && !$this->validateDateTime($value, 'H:i:s.up')) { + if (!$this->validateDateTime($value, 'H:i:sP') + && !$this->validateDateTime($value, 'H:i:sp') + && !$this->validateDateTime($value, 'H:i:s.up') + && !$this->validateDateTime($value, 'H:i:s.uP') + ) { $this->addError(ConstraintError::FORMAT_TIME(), $path, ['time' => $value, 'format' => $schema->format]); } break; @@ -54,6 +58,11 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n $this->addError(ConstraintError::FORMAT_DATE_UTC(), $path, ['value' => $value, 'format' => $schema->format]); } break; + case 'duration': + if (!$this->validateDuration($value)) { + $this->addError(ConstraintError::FORMAT_DURATION(), $path, ['value' => $value, 'format' => $schema->format]); + } + break; case 'regex': if (!$this->validateRegex($value)) { $this->addError(ConstraintError::FORMAT_REGEX(), $path, ['value' => $value, 'format' => $schema->format]); @@ -97,17 +106,36 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n $this->addError(ConstraintError::FORMAT_URL(), $path, ['format' => $schema->format]); } break; + case 'iri': + if (!$this->validateIri($value, false)) { + $this->addError(ConstraintError::FORMAT_URL(), $path, ['format' => $schema->format]); + } + break; + case 'iri-reference': + if (!$this->validateIri($value, true)) { + $this->addError(ConstraintError::FORMAT_URL_REF(), $path, ['format' => $schema->format]); + } + break; case 'uri-template': if (!$this->validateUriTemplate($value)) { $this->addError(ConstraintError::FORMAT_URI_TEMPLATE(), $path, ['format' => $schema->format]); } break; - + case 'uuid': + if (!$this->validateUuid($value)) { + $this->addError(ConstraintError::FORMAT_UUID(), $path, ['format' => $schema->format]); + } + break; case 'email': if (filter_var($value, FILTER_VALIDATE_EMAIL, FILTER_NULL_ON_FAILURE | FILTER_FLAG_EMAIL_UNICODE) === null) { $this->addError(ConstraintError::FORMAT_EMAIL(), $path, ['format' => $schema->format]); } break; + case 'idn-email': + if (!$this->validateInternationalizedEmail($value)) { + $this->addError(ConstraintError::FORMAT_EMAIL(), $path, ['format' => $schema->format]); + } + break; case 'host-name': case 'hostname': if (!$this->validateHostname($value)) { @@ -132,9 +160,14 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n private function validateDateTime(string $datetime, string $format): bool { $datetime = strtoupper($datetime); // Cleanup for lowercase z + $isPhpLt80WithZulu = PHP_VERSION_ID < 80000 && substr($datetime, -1) === 'Z'; $isLeap = substr($datetime, 6, 2) === '60'; $input = $datetime; + // Correct for Zulu in PHP < 8.0 + if ($isPhpLt80WithZulu) { + $input = sprintf('%s+00:00', substr($input, 0, -1)); + } // Correct for leap second if ($isLeap) { $input = sprintf('%s59%s', substr($datetime, 0, 6), substr($datetime, 8)); @@ -158,11 +191,11 @@ private function validateDateTime(string $datetime, string $format): bool $expected = $dt->format($format); // Correct for trailing zeros on microseconds - if ($format === 'H:i:s.up') { + if ($format === 'H:i:s.up' || $format === 'H:i:s.uP') { $expected = sprintf( '%s%s', rtrim($dt->format('H:i:s.u'), '0'), - $dt->format('p') + $dt->format(substr($format, -1)) ); } // Correct back for leap seconds @@ -175,6 +208,10 @@ private function validateDateTime(string $datetime, string $format): bool $expected = sprintf('%s60%s', substr($expected, 0, 6), substr($expected, 8)); } + // Correct back for PHP > 8.0 and Zulu + if ($isPhpLt80WithZulu) { + $expected = sprintf('%sZ', substr($expected, 0, -6)); + } return $datetime === $expected; } @@ -223,6 +260,37 @@ private function validateHostname(string $host): bool return preg_match($hostnameRegex, $host) === 1; } + /** + * Validates an internationalized e-mail address: a local part according to RFC 6531 section 3.3 and RFC 5321 + * section 4.1.2, and a domain that is a valid internationalized hostname. + */ + private function validateInternationalizedEmail(string $value): bool + { + $at = strrpos($value, '@'); + if ($at === false) { + return false; + } + + $localPart = substr($value, 0, $at); + $domain = substr($value, $at + 1); + + // atext extended with UTF8-non-ascii + $atext = '[A-Za-z0-9!#$%&\'*+\-\/=?^_`{|}~]|[^\x00-\x7F]'; + $dotString = '(?:' . $atext . ')++(?:\.(?:' . $atext . ')++)*+'; + $quotedString = '"(?:[\x20\x21\x23-\x5B\x5D-\x7E]|[^\x00-\x7F]|\\\\[\x20-\x7E])*+"'; + + if (strlen($localPart) > 64 || preg_match('/^(?:' . $dotString . '|' . $quotedString . ')\z/u', $localPart) !== 1) { + return false; + } + + // Unlike a hostname, the domain of an e-mail address can not be written in its absolute form + if (substr($domain, -1) === '.') { + return false; + } + + return $this->validateInternationalizedHostname($domain); + } + private function validateInternationalizedHostname(string $host): bool { if ($host === '') { @@ -332,11 +400,85 @@ private function validateRfc3339DateTime(string $value): bool return true; } + /** + * Validates an IRI or, when $allowRelative is set, an IRI reference according to the ABNF of RFC 3987 section 2.2. + */ + private function validateIri(string $value, bool $allowRelative): bool + { + // iunreserved and sub-delims; BMP and supplementary ranges are kept in separate classes, as PCRE2 10.46 fails + // to match some BMP code points when a single class holds too many ranges. + $bmp = 'A-Za-z0-9\-._~!$&\'()*+,;=\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}'; + $supplementary = '\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}' + . '\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}' + . '\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}'; + // Matches runs of characters possessively, keeping long values within the PCRE backtracking limits + $chars = static function (string $extraBmp, string $extraSupplementary = '') use ($bmp, $supplementary): string { + return '(?:[' . $bmp . $extraBmp . ']++|[' . $supplementary . $extraSupplementary . ']++|%[0-9A-Fa-f]{2})'; + }; + + $scheme = '[A-Za-z][A-Za-z0-9+\-.]*+'; + $ipvFuture = '[vV][0-9A-Fa-f]++\.[A-Za-z0-9\-._~!$&\'()*+,;=:]++'; + $iauthority = '(?:' . $chars(':') . '*+@)?(?:\[(?:(?[0-9A-Fa-f:.]++)|' . $ipvFuture . ')\]|' . $chars('') . '*+)(?::[0-9]*+)?'; + $ipathAbempty = '(?:\/' . $chars(':@') . '*+)*+'; + $ipathAbsolute = '\/(?:' . $chars(':@') . '++' . $ipathAbempty . ')?'; + $ipathRootless = $chars(':@') . '++' . $ipathAbempty; + $ipathNoScheme = $chars('@') . '++' . $ipathAbempty; + $iquery = '(?:\?' . $chars(':@\/?\x{E000}-\x{F8FF}', '\x{F0000}-\x{FFFFD}\x{100000}-\x{10FFFD}') . '*+)?'; + $ifragment = '(?:#' . $chars(':@\/?') . '*+)?'; + + $sharedPart = '(?:\/\/' . $iauthority . $ipathAbempty . '|' . $ipathAbsolute . '|)'; + $pattern = $allowRelative + ? '(?:(?:' . $scheme . ':)?' . $sharedPart . '|' . $scheme . ':' . $ipathRootless . '|' . $ipathNoScheme . ')' + : $scheme . ':(?:' . $sharedPart . '|' . $ipathRootless . ')'; + + if (preg_match('/^' . $pattern . $iquery . $ifragment . '\z/u', $value, $matches) !== 1) { + return false; + } + + if (isset($matches['ipLiteral']) && $matches['ipLiteral'] !== '') { + return filter_var($matches['ipLiteral'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false; + } + + return true; + } + + /** + * Validates a URI template according to the ABNF of RFC 6570 section 2. + */ private function validateUriTemplate(string $value): bool { + $pctEncoded = '%[0-9A-Fa-f]{2}'; + // Any Unicode character except CTL, SP, '"', '%', '<', '>', '\', '^', '`', '{', '|' and '}' (ucschar / iprivate). + // BMP and supplementary ranges are kept in separate classes, as PCRE2 10.46 fails to match some BMP code + // points when a single class holds too many ranges. + $literal = '(?:[\x21\x23\x24\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E\x{A0}-\x{D7FF}\x{E000}-\x{FDCF}\x{FDF0}-\x{FFEF}]' + . '|[\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}' + . '\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}' + . '\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}\x{F0000}-\x{FFFFD}' + . '\x{100000}-\x{10FFFD}])'; + $varchar = '(?:[A-Za-z0-9_]|' . $pctEncoded . ')'; + $varspec = $varchar . '(?:\.?' . $varchar . ')*(?::[1-9][0-9]{0,3}|\*)?'; + $expression = '\{[+#.\/;?&]?' . $varspec . '(?:,' . $varspec . ')*\}'; + return preg_match( - '/^(?:[^\{\}]*|\{[a-zA-Z0-9_:%\/\.~\-\+\*]+\})*$/', + '/^(?:' . $literal . '|' . $pctEncoded . '|' . $expression . ')*\z/u', $value ) === 1; } + + private function validateUuid(string $value): bool + { + return preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iD', $value) === 1; + } + + /** + * Validates against the duration ABNF from RFC 3339 Appendix A. + */ + private function validateDuration(string $value): bool + { + $time = 'T(?:[0-9]+H(?:[0-9]+M(?:[0-9]+S)?)?|[0-9]+M(?:[0-9]+S)?|[0-9]+S)'; + $date = '(?:[0-9]+D|[0-9]+M(?:[0-9]+D)?|[0-9]+Y(?:[0-9]+M(?:[0-9]+D)?)?)'; + + return preg_match('/^P(?:' . $date . '(?:' . $time . ')?|' . $time . '|[0-9]+W)$/D', $value) === 1; + } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeConstraint.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeConstraint.php index fc1aa4eb81..f744dfa2a4 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeConstraint.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeConstraint.php @@ -248,10 +248,10 @@ protected function validateType(&$value, $type, $coerce = false) */ protected function toBoolean($value) { - if ($value === 1 || $value === 'true') { + if ($value === 1 || $value === '1' || $value === 'true') { return true; } - if (is_null($value) || $value === 0 || $value === 'false') { + if (is_null($value) || $value === 0 || $value === '0' || $value === 'false') { return false; } if ($this->getTypeCheck()->isArray($value) && count($value) === 1) { diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php index 75c0256f9c..e1e40b353e 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php @@ -6,7 +6,7 @@ class Rfc3339 { - private const REGEX = '/^(\d{4}-\d{2}-\d{2}[T ](0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):((?:[0-5][0-9]|60)))(\.\d+)?(Z|([+-](0[0-9]|1[0-9]|2[0-3]))(:)?([0-5][0-9]))$/'; + private const REGEX = '/^(\d{4}-\d{2}-\d{2}[T ](0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):((?:[0-5][0-9]|60)))(\.\d+)?(Z|([+-](0[0-9]|1[0-9]|2[0-3]))(:)?([0-5][0-9]))$/D'; /** * Try creating a DateTime instance diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php index 2c5832bf92..d6af2cb9d4 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php @@ -14,6 +14,19 @@ class SchemaStorage implements SchemaStorageInterface { public const INTERNAL_PROVIDED_SCHEMA_URI = 'internal://provided-schema/'; + /** + * Keywords whose value is a map of subschemas keyed by an arbitrary name, so a member + * named after a keyword is a schema rather than that keyword's value. + */ + private const SCHEMA_MAP_KEYWORDS = [ + 'properties', + 'patternProperties', + 'definitions', + '$defs', + 'dependencies', + 'dependentSchemas', + ]; + protected $uriRetriever; protected $uriResolver; protected $schemas = []; @@ -70,7 +83,16 @@ public function addSchema(string $id, $schema = null): void } } - $this->scanForSubschemas($schema, $id); + // an id on the document root changes the base uri for the whole document + $baseId = $id; + if (is_object($schema)) { + $rootId = $this->findSchemaIdInObject($schema); + if (is_string($rootId) && $rootId !== $id) { + $baseId = $this->uriResolver->resolve($rootId, $id); + } + } + + $this->scanMembersForSubschemas($schema, $baseId); // resolve references $this->expandRefs($schema, $id); @@ -103,7 +125,10 @@ private function expandRefs(&$schema, ?string $parentId = null, array $propertyS $parentProperty = array_slice($propertyStack, -1)[0] ?? ''; foreach ($schema as $propertyName => &$member) { - if ($parentProperty !== 'properties' && in_array($propertyName, ['enum', 'const'])) { + if ( + in_array($propertyName, ['enum', 'const'], true) + && !in_array($parentProperty, self::SCHEMA_MAP_KEYWORDS, true) + ) { // Enum and const don't allow $ref as a keyword, see https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/445 continue; } @@ -193,42 +218,68 @@ public function resolveRefSchema($refSchema, $resolveStack = []) } /** + * Walk the members of one container - a schema object, or an array such as allOf or a + * tuple items - handing each member to registerAndScanSubschema(). + * + * $parentProperty is the keyword the container itself sits under, which is what decides + * whether a member named 'enum' or 'const' is that keyword's value or a schema. + * * @param mixed $schema */ - private function scanForSubschemas($schema, string $parentId): void + private function scanMembersForSubschemas($schema, string $parentId, string $parentProperty = ''): void { if (!$schema instanceof \stdClass && !is_array($schema)) { return; } - foreach ($schema as $propertyName => $potentialSubSchema) { - if (!is_object($potentialSubSchema)) { - if (is_array($potentialSubSchema)) { - foreach ($potentialSubSchema as $potentialSubSchemaItem) { - $this->scanForSubschemas($potentialSubSchemaItem, $parentId); - } - } + foreach ($schema as $propertyName => $member) { + // Enum and const don't allow id as a keyword, see https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/471 + // Their values are skipped entirely, but a subschema may legitimately be named + // 'enum' or 'const', so the enclosing keyword decides which of the two this is. + if ( + in_array($propertyName, ['enum', 'const'], true) + && !in_array($parentProperty, self::SCHEMA_MAP_KEYWORDS, true) + ) { continue; } - $potentialSubSchemaId = $this->findSchemaIdInObject($potentialSubSchema); - if (is_string($potentialSubSchemaId) && property_exists($potentialSubSchema, 'type')) { - // Enum and const don't allow id as a keyword, see https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/471 - if (in_array($propertyName, ['enum', 'const'])) { - continue; + if (is_array($member)) { + foreach ($member as $item) { + $this->registerAndScanSubschema($item, $parentId, (string) $propertyName); } + continue; + } - // $id in unknow keywords is not valid - if (in_array($propertyName, [])) { - continue; - } + $this->registerAndScanSubschema($member, $parentId, (string) $propertyName); + } + } - // Found sub schema - $this->addSchema($this->uriResolver->resolve($potentialSubSchemaId, $parentId), $potentialSubSchema); - } + /** + * Handle a single member. An object declaring an id is registered under the base uri that + * id establishes, and everything below it is then scanned against that base uri. + * + * @param mixed $subSchema + */ + private function registerAndScanSubschema($subSchema, string $parentId, string $parentProperty): void + { + if (!is_object($subSchema)) { + $this->scanMembersForSubschemas($subSchema, $parentId, $parentProperty); + + return; + } + + $childId = $parentId; + $subSchemaId = $this->findSchemaIdInObject($subSchema); + if (is_string($subSchemaId)) { + // An id nested in the document changes the base uri for everything below it + $childId = $this->uriResolver->resolve($subSchemaId, $parentId); - $this->scanForSubschemas($potentialSubSchema, $parentId); + // Found sub schema. It is registered directly rather than through addSchema(), + // which would resolve the already resolved id against itself a second time. + $this->schemas[$childId] = $subSchema; } + + $this->scanMembersForSubschemas($subSchema, $childId, $parentProperty); } private function findSchemaIdInObject(object $schema): ?string diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Tool/Validator/RelativeReferenceValidator.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Tool/Validator/RelativeReferenceValidator.php index 79fede0d8b..2cf71bc49a 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Tool/Validator/RelativeReferenceValidator.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Tool/Validator/RelativeReferenceValidator.php @@ -44,6 +44,10 @@ public static function isValid(string $ref): bool return false; // Spaces are not allowed in URIs } + if (preg_match('/%(?![0-9A-Fa-f]{2})/', $ref)) { + return false; // A percent sign must introduce a two digit hexadecimal triplet + } + return true; } } diff --git a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php index 00a47e812e..581dbf1ff7 100644 --- a/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php +++ b/core/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php @@ -105,6 +105,11 @@ public function resolve($uri, $baseUri = null) } $baseComponents = $this->parse($baseUri); $basePath = $baseComponents['path']; + if ($path !== '' && $basePath === '' && $baseComponents['authority'] !== '') { + // RFC 3986 section 5.3: when the base uri has an authority but an empty path, + // the reference is merged onto '/' rather than being unresolvable. + $basePath = '/'; + } $baseComponents['path'] = self::combineRelativePathWithBasePath($path, $basePath); if (isset($components['fragment'])) { diff --git a/core/vendor/laravel/prompts/src/Prompt.php b/core/vendor/laravel/prompts/src/Prompt.php index 324d78996b..b16e17a374 100644 --- a/core/vendor/laravel/prompts/src/Prompt.php +++ b/core/vendor/laravel/prompts/src/Prompt.php @@ -445,4 +445,16 @@ public function __destruct() static::terminal()->restoreTty(); } + + /** + * Flush the global state of Prompts. + */ + public static function flushState(): void + { + static::$cancelUsing = null; + static::$validateUsing = null; + static::$revertUsing = null; + static::$shouldFallback = false; + static::$fallbacks = []; + } } diff --git a/core/vendor/laravel/prompts/src/Spinner.php b/core/vendor/laravel/prompts/src/Spinner.php index 8aa7173529..32bf14a9de 100644 --- a/core/vendor/laravel/prompts/src/Spinner.php +++ b/core/vendor/laravel/prompts/src/Spinner.php @@ -52,6 +52,7 @@ public function spin(Closure $callback): mixed } $originalAsync = pcntl_async_signals(true); + /** @var callable|int $originalSignalHandler */ $originalSignalHandler = pcntl_signal_get_handler(SIGINT); pcntl_signal(SIGINT, fn () => exit()); diff --git a/core/vendor/laravel/prompts/src/Task.php b/core/vendor/laravel/prompts/src/Task.php index deaa1eb09a..51633653be 100644 --- a/core/vendor/laravel/prompts/src/Task.php +++ b/core/vendor/laravel/prompts/src/Task.php @@ -114,6 +114,7 @@ public function run(Closure $callback): mixed } $originalAsync = pcntl_async_signals(true); + /** @var callable|int $originalSignalHandler */ $originalSignalHandler = pcntl_signal_get_handler(SIGINT); pcntl_signal(SIGINT, fn () => exit()); diff --git a/core/vendor/laravel/serializable-closure/src/Serializers/Native.php b/core/vendor/laravel/serializable-closure/src/Serializers/Native.php index 8c608c7e04..ac95d1176f 100644 --- a/core/vendor/laravel/serializable-closure/src/Serializers/Native.php +++ b/core/vendor/laravel/serializable-closure/src/Serializers/Native.php @@ -55,7 +55,7 @@ class Native implements Serializable /** * The closure's reference. * - * @var string + * @var string|int */ protected $reference; @@ -133,7 +133,9 @@ public function __serialize() } } - $this->reference = spl_object_hash($this->closure); + $this->reference = PHP_VERSION_ID >= 80600 + ? spl_object_id($this->closure) + : spl_object_hash($this->closure); $this->scope[$this->closure] = $this; @@ -265,7 +267,7 @@ public static function wrapClosures(&$data, $storage) $instance = $data; $reflection = new ReflectionObject($instance); - if (! $reflection->isUserDefined()) { + if (! $reflection->isUserDefined() || static::hasInternalAncestry($reflection)) { $storage[$instance] = $data; return; @@ -497,7 +499,7 @@ protected function mapByReference(&$data) $reflection = new ReflectionObject($data); - if (! $reflection->isUserDefined()) { + if (! $reflection->isUserDefined() || static::hasInternalAncestry($reflection)) { $this->scope[$instance] = $data; return; @@ -566,6 +568,32 @@ protected static function setPropertyValue(ReflectionProperty $property, object : $property->setValue($object, $value); } + /** + * Determine if the class inherits from a PHP internal class. + * + * Instances of such classes carry internal state that + * newInstanceWithoutConstructor() cannot rebuild (e.g. DateTime + * subclasses like Carbon), so they must be kept as-is instead of + * being reconstructed property by property. + * + * @param \ReflectionObject $reflection + * @return bool + */ + protected static function hasInternalAncestry(ReflectionObject $reflection): bool + { + $class = $reflection->getParentClass(); + + while ($class !== false) { + if ($class->isInternal()) { + return true; + } + + $class = $class->getParentClass(); + } + + return false; + } + /** * Determine is virtual property. * diff --git a/core/vendor/laravel/serializable-closure/src/Support/SelfReference.php b/core/vendor/laravel/serializable-closure/src/Support/SelfReference.php index 58319504ac..e97f06fb6e 100644 --- a/core/vendor/laravel/serializable-closure/src/Support/SelfReference.php +++ b/core/vendor/laravel/serializable-closure/src/Support/SelfReference.php @@ -7,14 +7,14 @@ class SelfReference /** * The unique hash representing the object. * - * @var string + * @var string|int */ public $hash; /** * Creates a new self reference instance. * - * @param string $hash + * @param string|int $hash * @return void */ public function __construct($hash) diff --git a/core/vendor/monolog/monolog/CHANGELOG.md b/core/vendor/monolog/monolog/CHANGELOG.md index a94f2ff28d..15a35665cb 100644 --- a/core/vendor/monolog/monolog/CHANGELOG.md +++ b/core/vendor/monolog/monolog/CHANGELOG.md @@ -1,3 +1,10 @@ +### 3.12.1 (2026-09-29) + + * Fixed `Logger` silently dropping every record for the rest of the process once the infinite loop guard aborted a nested logging cycle, which could hit long-running workers (#2072) + * Fixed `RedactingFormatter` letting secrets containing `&`, `<` or `>` through when wrapping an `HtmlFormatter` (#2069) + * Fixed `SocketHandler` throwing the writing timeout immediately when the first write made no progress, instead of waiting for the configured timeout (#2071) + * Fixed `RotatingFileHandler` computing the first rotation in the default timezone instead of the `$timezone` passed to the constructor (#2070) + ### 3.12.0 (2026-09-09) * Added support for reading the timestamp of new records from a PSR-20 clock, via a new `$clock` constructor param and `Logger::setClock()` (#2065) diff --git a/core/vendor/monolog/monolog/README.md b/core/vendor/monolog/monolog/README.md index 0564f96f0c..52cf8c7c40 100644 --- a/core/vendor/monolog/monolog/README.md +++ b/core/vendor/monolog/monolog/README.md @@ -1,4 +1,4 @@ -

Monolog

+

Monolog

# Monolog - Logging for PHP [![Continuous Integration](https://github.com/Seldaek/monolog/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/Seldaek/monolog/actions) diff --git a/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php b/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php index d97a66a1eb..65a311ae48 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php +++ b/core/vendor/monolog/monolog/src/Monolog/Formatter/RedactingFormatter.php @@ -173,13 +173,14 @@ private function collectSecrets(iterable $records): array return []; } - // a secret containing quotes/backslashes/newlines shows up escaped in json output, - // so both forms have to be looked for + // a secret shows up escaped in json output (quotes/backslashes/newlines) and in html output + // (& < >), so every spelling the wrapped formatter can produce has to be looked for $escapedSecrets = []; foreach ($secrets as $secret) { - $escaped = substr(Utils::jsonEncode($secret, null, true), 1, -1); - if ($escaped !== $secret && $escaped !== '') { - $escapedSecrets[] = $escaped; + foreach ([substr(Utils::jsonEncode($secret, null, true), 1, -1), htmlspecialchars($secret, ENT_NOQUOTES, 'UTF-8')] as $escaped) { + if ($escaped !== $secret && $escaped !== '') { + $escapedSecrets[] = $escaped; + } } } diff --git a/core/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/core/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php index bb0d2bbc82..ccdf219400 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +++ b/core/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php @@ -50,9 +50,9 @@ public function __construct(string $filename, int $maxFiles = 0, int|string|Leve { $this->filename = Utils::canonicalizePath($filename); $this->maxFiles = $maxFiles; + $this->timezone = $timezone; $this->setFilenameFormat($filenameFormat, $dateFormat); $this->nextRotation = $this->getNextRotation(); - $this->timezone = $timezone; parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission, $useLocking); } diff --git a/core/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/core/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php index 36d46bf9d3..4560d7637e 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +++ b/core/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php @@ -385,6 +385,7 @@ private function writeToSocket(string $data): void $length = \strlen($data); $sent = 0; $this->lastSentBytes = $sent; + $this->lastWritingAt = microtime(true); while ($this->isConnected() && $sent < $length) { if (0 === $sent) { $chunk = $this->fwrite($data); diff --git a/core/vendor/monolog/monolog/src/Monolog/Logger.php b/core/vendor/monolog/monolog/src/Monolog/Logger.php index 7565623539..177e145576 100644 --- a/core/vendor/monolog/monolog/src/Monolog/Logger.php +++ b/core/vendor/monolog/monolog/src/Monolog/Logger.php @@ -353,15 +353,15 @@ public function addRecord(int|Level $level, string $message, array $context = [] $logDepth = 0; } - if ($logDepth === 3) { - $this->warning('A possible infinite logging loop was detected and aborted. It appears some of your handler code is triggering logging, see the previous log record for a hint as to what may be the cause.'); + try { + if ($logDepth === 3) { + $this->warning('A possible infinite logging loop was detected and aborted. It appears some of your handler code is triggering logging, see the previous log record for a hint as to what may be the cause.'); - return false; - } elseif ($logDepth >= 5) { // log depth 4 is let through, so we can log the warning above - return false; - } + return false; + } elseif ($logDepth >= 5) { // log depth 4 is let through, so we can log the warning above + return false; + } - try { $recordInitialized = \count($this->processors) === 0; $record = new LogRecord( diff --git a/core/vendor/nesbot/carbon/composer.json b/core/vendor/nesbot/carbon/composer.json index 95b2abf223..8264dedbaa 100644 --- a/core/vendor/nesbot/carbon/composer.json +++ b/core/vendor/nesbot/carbon/composer.json @@ -53,7 +53,7 @@ "doctrine/orm": "^2.15.2 || ^3.0", "friendsofphp/php-cs-fixer": "^v3.87.1", "kylekatarnls/multi-tester": "^2.5.3", - "phpmd/phpmd": "^2.15.0", + "phpmd/phpmd": "^3.0@dev", "phpstan/extension-installer": "^1.4.3", "phpstan/phpstan": "^2.1.22", "phpunit/phpunit": "^10.5.53", @@ -107,8 +107,8 @@ "scripts": { "phpcs": "php-cs-fixer fix -v --diff --dry-run", "phpdoc": "php phpdoc.php", - "phpmd": "phpmd src text /phpmd.xml", - "phpmd-test": "phpmd tests text /tests/phpmd-test.xml", + "phpmd": "phpmd analyze src --format=text --ruleset=/phpmd.yml", + "phpmd-test": "phpmd analyze tests --format=text --ruleset=/tests/phpmd-test.yml", "phpstan": "phpstan analyse --configuration phpstan.neon --memory-limit 1024M", "phpunit": "phpunit", "style-check": [ diff --git a/core/vendor/nesbot/carbon/phpmd.yml b/core/vendor/nesbot/carbon/phpmd.yml new file mode 100644 index 0000000000..f7cd51defe --- /dev/null +++ b/core/vendor/nesbot/carbon/phpmd.yml @@ -0,0 +1,46 @@ +# PHPMD configuration, see https://phpmd.org/documentation/creating-a-ruleset.html +name: 'Mess detection rules for Carbon' +description: 'Mess detection rules for Carbon' +rules: + - ref: rulesets/codesize.xml + exclude: + - CyclomaticComplexity + - NPathComplexity + - ExcessiveMethodLength + - ExcessiveClassLength + - ExcessivePublicCount + - TooManyMethods + - TooManyPublicMethods + - ExcessiveClassComplexity + - ref: rulesets/cleancode.xml + exclude: + - BooleanArgumentFlag + - StaticAccess + - IfStatementAssignment + - UndefinedVariable + - ErrorControlOperator + - ref: rulesets/controversial.xml + - ref: rulesets/design.xml + exclude: + - EvalExpression + - CouplingBetweenObjects + - CountInLoopExpression + - DevelopmentCodeFragment + - ref: rulesets/design.xml/DevelopmentCodeFragment + properties: + ignore-namespaces: 'true' + - ref: rulesets/naming.xml + exclude: + - ShortVariable + - LongVariable + - ShortMethodName + - ref: rulesets/naming.xml/ShortVariable + properties: + exceptions: 'ci,id,to,tz' + - ref: rulesets/naming.xml/LongVariable + properties: + subtract-suffixes: 'Enabled,Function,Factory,Timezone,FloorEnd,DiffOptions,FromTestNow' + - ref: rulesets/naming.xml/ShortMethodName + properties: + exceptions: 'eq,gt,is,lt,ne,to,tz' + - ref: rulesets/unusedcode.xml diff --git a/core/vendor/nesbot/carbon/readme.md b/core/vendor/nesbot/carbon/readme.md index e0ddbb2ff4..b29a6a73e6 100644 --- a/core/vendor/nesbot/carbon/readme.md +++ b/core/vendor/nesbot/carbon/readme.md @@ -146,70 +146,56 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
+ - - - - - + + - + - - + + + + - - + + - + - + - - - + - + + - - - - - - - - - - - - -
Online Pokies in Australia Paysafecard Casino Australian Online PokiesTop 10 Online Casino Australia Eu Com luckygans-casino PayID Pokies SitesTransparencia en Casinos OnlineTop 10 Online Casino Australia Eu Com Online Kasyno Polisgaia-wines.gr parhaatuudetkasinot.com New Casino Bonuses
Fun88 East Villa FC
Fun88Fun88Fun88 Najlepsi Bukmacherzy WNB Casino Bewertung casino en ligne avec Girandières JBOJBOPlinko GameJBOTransparencia en Casinos Onlinegaia-wines.gr Top Rating casino Casino ohne oasisReal Money Pokies
Real Money Pokies TideliftGuidebook.BetWinnerPlinko Game Casinos ohne OASIS Paysafecard Casino Sportsbook Reviews OnlineGuidebook.BetWinner Casino-portugal.pt Buitenlandse Online CasinoСтавки на спорт Favbet ProbukmacherСтавки на спорт Favbet Онлайн казино casino.uaInterac-casino.com - Canadainkedin
inkedinbest non Gamstop casinosOnline Casino Zonder RegistratieInterac-casino.com - Canada freispace bestecasinozondercruksiDealeCasinosbest non Gamstop casinosOnline Casino Zonder Registratie Run Weekly New Casino Sites UK (2025) Help Direct TopKasynoOnline PLInsta Finsta - DownloaderlolajackCasinomithandyrechnung
ssddanbrown
diff --git a/core/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/core/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php index 7a43fdbf43..85f912d459 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +++ b/core/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php @@ -2571,9 +2571,12 @@ public static function getDateIntervalSpec( $seconds = $withNegatives ? $interval->s : abs($interval->s); if ($microseconds && $interval->f !== 0.0) { - $seconds = $withNegatives - ? number_format($seconds + $interval->f, 6, '.', '') - : \sprintf('%d.%06d', $seconds, abs($interval->f) * 1000000); + $seconds = number_format( + $seconds + ($withNegatives ? $interval->f : abs($interval->f)), + 6, + '.', + '', + ); } $time = array_filter([ diff --git a/core/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/core/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php index 47e93293c5..101019d828 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php +++ b/core/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php @@ -428,8 +428,8 @@ public static function createFromISO8601String(string $iso, ?int $options = null } public static function monthly( - DateTimeInterface|string|int|null $start = null, - DateTimeInterface|string|int|null $end = null, + DateTimeInterface|string|int|float|null $start = null, + DateTimeInterface|string|int|float|null $end = null, ?int $recurrences = null, ?int $anchorDay = null, OverflowMode $mode = OverflowMode::AnchorDay, @@ -445,8 +445,8 @@ public static function monthly( } public static function quarterly( - DateTimeInterface|string|int|null $start = null, - DateTimeInterface|string|int|null $end = null, + DateTimeInterface|string|int|float|null $start = null, + DateTimeInterface|string|int|float|null $end = null, ?int $recurrences = null, ?int $anchorDay = null, OverflowMode $mode = OverflowMode::AnchorDay, @@ -471,8 +471,8 @@ static function (CarbonInterface $date, bool $negated) use ($interval): CarbonIn } public static function yearly( - DateTimeInterface|string|int|null $start = null, - DateTimeInterface|string|int|null $end = null, + DateTimeInterface|string|int|float|null $start = null, + DateTimeInterface|string|int|float|null $end = null, ?int $recurrences = null, ?int $anchorDay = null, OverflowMode $mode = OverflowMode::AnchorDay, @@ -484,10 +484,10 @@ public static function yearly( $start, match ($mode) { OverflowMode::AnchorDay => CarbonInterval::yearWithAnchorDay( - $anchorDay ?? $start->day, + $anchorDay ?? (int) $start->format('d'), ), OverflowMode::NoOverflow => CarbonInterval::yearNoOverflow(), - OverflowMode::Overflow => CarbonInterval::month(), + OverflowMode::Overflow => CarbonInterval::year(), }, $end ?? $recurrences, ))->setOptions($options ?? self::IMMUTABLE); @@ -567,8 +567,8 @@ protected static function addMissingParts(string $source, string $target): strin } private static function getStartAndEndForCyclePeriod( - DateTimeInterface|string|int|null $start = null, - DateTimeInterface|string|int|null $end = null, + DateTimeInterface|string|int|float|null $start = null, + DateTimeInterface|string|int|float|null $end = null, ?int $recurrences = null, ?int $anchorDay = null, OverflowMode $mode = OverflowMode::AnchorDay, @@ -585,7 +585,7 @@ private static function getStartAndEndForCyclePeriod( ); } - if (\is_int($start)) { + if (\is_int($start) || \is_float($start)) { $start = CarbonImmutable::createFromTimestamp($start); } elseif (\is_string($start)) { $start = CarbonImmutable::parse($start); @@ -593,7 +593,7 @@ private static function getStartAndEndForCyclePeriod( $start ??= CarbonImmutable::now(); - if (\is_int($end)) { + if (\is_int($end) || \is_float($end)) { $end = CarbonImmutable::createFromTimestamp($end); } @@ -607,7 +607,7 @@ private static function getMonthInterval( ): CarbonInterval { return match ($mode) { OverflowMode::AnchorDay => CarbonInterval::monthWithAnchorDay( - $anchorDay ?? $start->day, + $anchorDay ?? (int) $start->format('d'), ), OverflowMode::NoOverflow => CarbonInterval::monthNoOverflow(), OverflowMode::Overflow => CarbonInterval::month(), diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php index deae06a191..ef4b01a86f 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php @@ -14,7 +14,7 @@ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', - 'L' => 'D/M/yy', + 'L' => 'D/M/YY', 'LL' => 'D MMM YYYY', 'LLL' => 'D [de] MMMM [de] YYYY h:mm a', 'LLLL' => 'dddd, D [de] MMMM [de] YYYY h:mm a', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php index 657f2c5bb5..fcbb1595e7 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php @@ -11,7 +11,7 @@ return array_replace_recursive(require __DIR__.'/fo.php', [ 'formats' => [ - 'L' => 'DD.MM.yy', + 'L' => 'DD.MM.YY', 'LL' => 'DD.MM.YYYY', 'LLL' => 'D. MMMM YYYY, HH:mm', 'LLLL' => 'dddd, D. MMMM YYYY, HH:mm', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php index 0147a596ac..017df98b2b 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php @@ -12,15 +12,16 @@ /* * Authors: * - Pablo Saratxaga pablo@mandrakesoft.com + * - Kamthorn Krairaksa */ return [ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'DD. MM. YY', - 'LL' => 'DD di MMMM dal YYYY', - 'LLL' => 'DD di MMM HH:mm', - 'LLLL' => 'DD di MMMM dal YYYY HH:mm', + 'LL' => 'DD [di] MMMM [dal] YYYY', + 'LLL' => 'DD [di] MMM HH:mm', + 'LLLL' => 'DD [di] MMMM [dal] YYYY HH:mm', ], 'months' => ['zenâr', 'fevrâr', 'març', 'avrîl', 'mai', 'jugn', 'lui', 'avost', 'setembar', 'otubar', 'novembar', 'dicembar'], 'months_short' => ['zen', 'fev', 'mar', 'avr', 'mai', 'jug', 'lui', 'avo', 'set', 'otu', 'nov', 'dic'], diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php index 7763a4587a..9b7fae02ed 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php @@ -12,6 +12,7 @@ /* * Authors: * - DarkoDevelop + * - Kamthorn Krairaksa */ return array_replace_recursive(require __DIR__.'/hr.php', [ 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], @@ -24,7 +25,7 @@ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', - 'L' => 'D. M. yy.', + 'L' => 'D. M. YY.', 'LL' => 'D. MMM YYYY.', 'LLL' => 'D. MMMM YYYY. HH:mm', 'LLLL' => 'dddd, D. MMMM YYYY. HH:mm', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php index ef837a2d78..b8833fc48d 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php @@ -13,7 +13,7 @@ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', - 'L' => 'D/MM/yy', + 'L' => 'D/MM/YY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY, h:mm a', 'LLLL' => 'dd MMMM YYYY, h:mm a', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php index 77cb83d281..0fe71b9796 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php @@ -13,7 +13,7 @@ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', - 'L' => 'D/MM/yy', + 'L' => 'D/MM/YY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY, h:mm a', 'LLLL' => 'dddd, D MMMM YYYY, h:mm a', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php index f68d00e3e7..9fc21fa79a 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php @@ -13,7 +13,7 @@ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', - 'L' => 'yy/M/d', + 'L' => 'YY/M/D', 'LL' => 'YYYY MMM D', 'LLL' => 'YYYY MMMM D, h:mm a', 'LLLL' => 'YYYY MMMM D, dddd, h:mm a', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php index 007d23993e..413e6a45c2 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php @@ -20,9 +20,9 @@ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', - 'L' => 'DD/MM/yy', + 'L' => 'DD/MM/YY', 'LL' => 'D MMM, YYYY', - 'LLL' => '[lyɛ]̌ʼ d [na] MMMM, YYYY HH:mm', - 'LLLL' => 'dddd , [lyɛ]̌ʼ d [na] MMMM, YYYY HH:mm', + 'LLL' => '[lyɛ]̌ʼ D [na] MMMM, YYYY HH:mm', + 'LLLL' => 'dddd , [lyɛ]̌ʼ D [na] MMMM, YYYY HH:mm', ], ]); diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php index 7adff5c32e..02e5a33ac8 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php @@ -13,7 +13,7 @@ 'formats' => [ 'LT' => 'h:mm a', 'LTS' => 'h:mm:ss a', - 'L' => 'D/M/yy', + 'L' => 'D/M/YY', 'LL' => 'D MMM YYYY', 'LLL' => 'D MMMM YYYY, h:mm a', 'LLLL' => 'dddd, D MMMM YYYY, h:mm a', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/ps.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/ps.php index a928b28e37..c4a438a274 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/ps.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/ps.php @@ -13,6 +13,7 @@ * Authors: * - Muhammad Nasir Rahimi * - Nassim Nasibullah (spinzar) + * - Kamthorn Krairaksa */ return [ 'year' => ':count کال|:count کاله', @@ -47,7 +48,7 @@ 'formats' => [ 'LT' => 'H:mm', 'LTS' => 'H:mm:ss', - 'L' => 'YYYY/M/d', + 'L' => 'YYYY/M/D', 'LL' => 'YYYY MMM D', 'LLL' => 'د YYYY د MMMM D H:mm', 'LLLL' => 'dddd د YYYY د MMMM D H:mm', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/seh.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/seh.php index 31b5aadeaa..9d39bcad35 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/seh.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/seh.php @@ -20,8 +20,8 @@ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', 'L' => 'D/M/YYYY', - 'LL' => 'd [de] MMM [de] YYYY', - 'LLL' => 'd [de] MMMM [de] YYYY HH:mm', - 'LLLL' => 'dddd, d [de] MMMM [de] YYYY HH:mm', + 'LL' => 'D [de] MMM [de] YYYY', + 'LLL' => 'D [de] MMMM [de] YYYY HH:mm', + 'LLLL' => 'dddd, D [de] MMMM [de] YYYY HH:mm', ], ]); diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php index 4b29a45c71..5ebab88ea5 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php @@ -23,7 +23,7 @@ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', - 'L' => 'D.M.yy.', + 'L' => 'D.M.YY.', 'LL' => 'DD.MM.YYYY.', 'LLL' => 'DD. MMMM YYYY. HH:mm', 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php index 95b2770db4..f337348477 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php @@ -23,7 +23,7 @@ 'formats' => [ 'LT' => 'HH:mm', 'LTS' => 'HH:mm:ss', - 'L' => 'D.M.yy.', + 'L' => 'D.M.YY.', 'LL' => 'DD.MM.YYYY.', 'LLL' => 'DD. MMMM YYYY. HH:mm', 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php index a6cd8b517b..5d05b5ad11 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php @@ -13,7 +13,7 @@ 'formats' => [ 'LT' => 'a h:mm', 'LTS' => 'a h:mm:ss', - 'L' => 'D/M/yy', + 'L' => 'D/M/YY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM, YYYY, a h:mm', 'LLLL' => 'dddd, D MMMM, YYYY, a h:mm', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php index 7dbedeee8b..c7ce38f152 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php @@ -13,7 +13,7 @@ 'formats' => [ 'LT' => 'a h:mm', 'LTS' => 'a h:mm:ss', - 'L' => 'D/M/yy', + 'L' => 'D/M/YY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM, YYYY, a h:mm', 'LLLL' => 'dddd, D MMMM, YYYY, a h:mm', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/th.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/th.php index 78980d5c2f..8ddfe678d2 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/th.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/th.php @@ -19,6 +19,7 @@ * - RO'KAISAKKON * - Andreas Möller * - nithisa + * - Kamthorn Krairaksa */ return [ 'year' => ':count ปี', @@ -70,4 +71,5 @@ 'weekdays_short' => ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'], 'weekdays_min' => ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], 'list' => [', ', ' และ '], + 'alt_numbers' => ['๐๐', '๐๑', '๐๒', '๐๓', '๐๔', '๐๕', '๐๖', '๐๗', '๐๘', '๐๙', '๑๐', '๑๑', '๑๒', '๑๓', '๑๔', '๑๕', '๑๖', '๑๗', '๑๘', '๑๙', '๒๐', '๒๑', '๒๒', '๒๓', '๒๔', '๒๕', '๒๖', '๒๗', '๒๘', '๒๙', '๓๐', '๓๑', '๓๒', '๓๓', '๓๔', '๓๕', '๓๖', '๓๗', '๓๘', '๓๙', '๔๐', '๔๑', '๔๒', '๔๓', '๔๔', '๔๕', '๔๖', '๔๗', '๔๘', '๔๙', '๕๐', '๕๑', '๕๒', '๕๓', '๕๔', '๕๕', '๕๖', '๕๗', '๕๘', '๕๙', '๖๐', '๖๑', '๖๒', '๖๓', '๖๔', '๖๕', '๖๖', '๖๗', '๖๘', '๖๙', '๗๐', '๗๑', '๗๒', '๗๓', '๗๔', '๗๕', '๗๖', '๗๗', '๗๘', '๗๙', '๘๐', '๘๑', '๘๒', '๘๓', '๘๔', '๘๕', '๘๖', '๘๗', '๘๘', '๘๙', '๙๐', '๙๑', '๙๒', '๙๓', '๙๔', '๙๕', '๙๖', '๙๗', '๙๘', '๙๙'], ]; diff --git a/core/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php b/core/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php index 89e9971814..8c6999e2cd 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php @@ -11,7 +11,7 @@ return array_replace_recursive(require __DIR__.'/uz.php', [ 'formats' => [ - 'L' => 'DD/MM/yy', + 'L' => 'DD/MM/YY', 'LL' => 'D MMM, YYYY', 'LLL' => 'D MMMM, YYYY HH:mm', 'LLLL' => 'dddd, DD MMMM, YYYY HH:mm', diff --git a/core/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/core/vendor/nesbot/carbon/src/Carbon/Traits/Date.php index 27d5041688..6380aacb04 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Traits/Date.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Traits/Date.php @@ -2257,6 +2257,8 @@ public function isoFormat(string $format, ?string $originalFormat = null): strin $inEscaped = false; $formats = null; $units = null; + $macroIndex = -1; + $macroDepth = 0; for ($i = 0; $i < $length; $i++) { $char = mb_substr($format, $i, 1); @@ -2287,7 +2289,10 @@ public function isoFormat(string $format, ?string $originalFormat = null): strin $input = mb_substr($format, $i); - if (preg_match('/^(LTS|LT|l{1,4}|L{1,4})/', $input, $match)) { + // Like moment.js, allow up to 5 nested macro expansions at the same position + $macroDepth = $i === $macroIndex ? $macroDepth + 1 : 0; + + if ($macroDepth < 5 && preg_match('/^(LTS|LT|l{1,4}|L{1,4})/', $input, $match)) { if ($formats === null) { $formats = $this->getIsoFormats(); } @@ -2298,10 +2303,14 @@ public function isoFormat(string $format, ?string $originalFormat = null): strin static fn ($code) => mb_substr($code[0], 1), $formats[strtoupper($code)] ?? '', ); - $rest = mb_substr($format, $i + mb_strlen($code)); - $format = mb_substr($format, 0, $i).$sequence.$rest; + $format = mb_substr($format, 0, $i).$sequence.mb_substr($format, $i + mb_strlen($code)); $length = mb_strlen($format); - $input = $sequence.$rest; + $macroIndex = $i; + // Read the expanded sequence again from its first character, + // it may start with literal text, an escape or another macro + $i--; + + continue; } if (preg_match('/^'.CarbonInterface::ISO_FORMAT_REGEXP.'/', $input, $match)) { diff --git a/core/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/core/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php index b4ee67e8c3..2a4d8fb9e4 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php @@ -557,12 +557,12 @@ public static function executeWithLocale(string $locale, callable $func): mixed public static function localeHasShortUnits(string $locale): bool { return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return ($newLocale && (($y = static::translateWith($translator, 'y')) !== 'y' && $y !== static::translateWith($translator, 'year'))) || ( - ($y = static::translateWith($translator, 'd')) !== 'd' && - $y !== static::translateWith($translator, 'day') + return ($newLocale && (($year = static::translateWith($translator, 'y')) !== 'y' && $year !== static::translateWith($translator, 'year'))) || ( + ($year = static::translateWith($translator, 'd')) !== 'd' && + $year !== static::translateWith($translator, 'day') ) || ( - ($y = static::translateWith($translator, 'h')) !== 'h' && - $y !== static::translateWith($translator, 'hour') + ($year = static::translateWith($translator, 'h')) !== 'h' && + $year !== static::translateWith($translator, 'hour') ); }); } diff --git a/core/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/core/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php index 4239c66892..407d12ab3d 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php @@ -70,6 +70,38 @@ public function roundUnit( $precision *= $factor; + // How many of each unit make up the next one up. Only the steps with a + // fixed size are listed: a month holds a varying number of days, so a + // day precision is never carried into a month. + $unitsPerNextUnit = [ + // @call roundUnit + 'microsecond' => [static::MICROSECONDS_PER_SECOND, 'second'], + // @call roundUnit + 'second' => [static::SECONDS_PER_MINUTE, 'minute'], + // @call roundUnit + 'minute' => [static::MINUTES_PER_HOUR, 'hour'], + // @call roundUnit + 'hour' => [static::HOURS_PER_DAY, 'day'], + // @call roundUnit + 'month' => [static::MONTHS_PER_YEAR, 'year'], + ]; + + // A numeric precision counts units of $normalizedUnit, and that unit has + // a range it cannot leave, so a precision spanning the next unit up has + // to be re-targeted there, the same way "week" becomes "day" above. + if (\is_int($precision) || \is_float($precision)) { + while (isset($unitsPerNextUnit[$normalizedUnit])) { + [$span, $nextUnit] = $unitsPerNextUnit[$normalizedUnit]; + + if ($precision < $span) { + break; + } + + $precision /= $span; + $normalizedUnit = $nextUnit; + } + } + if (!isset($ranges[$normalizedUnit])) { throw new UnknownUnitException($unit); } diff --git a/core/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php b/core/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php index dab448decd..12d7a830ce 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php @@ -14,6 +14,7 @@ namespace Carbon\Traits; use DateTimeZone; +use ReturnTypeWillChange; /** * Trait Timestamp. @@ -25,7 +26,7 @@ trait Timestamp * * Timestamp input can be given as int, float or a string containing one or more numbers. */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public static function createFromTimestamp( float|int|string $timestamp, DateTimeZone|string|int|null $timezone = null, diff --git a/core/vendor/nesbot/carbon/src/Carbon/Traits/Units.php b/core/vendor/nesbot/carbon/src/Carbon/Traits/Units.php index c61921c26e..1786b220df 100644 --- a/core/vendor/nesbot/carbon/src/Carbon/Traits/Units.php +++ b/core/vendor/nesbot/carbon/src/Carbon/Traits/Units.php @@ -333,11 +333,28 @@ public function addUnit( } if ($unit === 'weekday') { + $absoluteValue = abs($value); + $sign = $value < 0 ? -1 : 1; + $intAbsoluteValue = (int) $absoluteValue; + $remaining = ((float) $absoluteValue - (float) $intAbsoluteValue); + + if ($remaining !== 0.0) { + if ($intAbsoluteValue !== 0) { + $date = $date->addUnit($unit, $sign * $intAbsoluteValue); + } + + $date = $date->addDays($sign * $remaining); + + while ($date->isWeekend()) { + $date = $date->addDays($sign); + } + + return $date; + } + $weekendDays = $this->transmitFactory(static::getWeekendDays(...)); if ($weekendDays !== [static::SATURDAY, static::SUNDAY]) { - $absoluteValue = abs($value); - $sign = $value / max(1, $absoluteValue); $weekDaysCount = static::DAYS_PER_WEEK - min(static::DAYS_PER_WEEK - 1, \count(array_unique($weekendDays))); $weeks = floor($absoluteValue / $weekDaysCount); diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/airpods-l.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/airpods-l.svg new file mode 100644 index 0000000000..d3439aeac8 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/airpods-l.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/airpods-r.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/airpods-r.svg new file mode 100644 index 0000000000..79042b3e09 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/airpods-r.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-chinese.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-chinese.svg new file mode 100644 index 0000000000..15de37e499 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-chinese.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-devanagari.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-devanagari.svg new file mode 100644 index 0000000000..eb1a0afe97 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-devanagari.svg @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-ethiopic.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-ethiopic.svg new file mode 100644 index 0000000000..d8c0adad30 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-ethiopic.svg @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-georgian.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-georgian.svg new file mode 100644 index 0000000000..7b87c9978c --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-georgian.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-japanese.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-japanese.svg new file mode 100644 index 0000000000..a1c913c6be --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/alphabet-japanese.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/blob-dashed.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/blob-dashed.svg new file mode 100644 index 0000000000..8eee36285b --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/blob-dashed.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/brand-instagram.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/brand-instagram.svg index f3bef0f684..f38bf90bc9 100644 --- a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/brand-instagram.svg +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/brand-instagram.svg @@ -11,7 +11,7 @@ class="icon icon-tabler icons-tabler-outline icon-tabler-brand-instagram" > - - - + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/cash-coin.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/cash-coin.svg new file mode 100644 index 0000000000..e8bfd26306 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/cash-coin.svg @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-heart.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-heart.svg new file mode 100644 index 0000000000..ee01bc48ca --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-heart.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-pause.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-pause.svg new file mode 100644 index 0000000000..2c0fb6626c --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-pause.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-play.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-play.svg new file mode 100644 index 0000000000..935c612aed --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-play.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-stop.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-stop.svg new file mode 100644 index 0000000000..fea8d2fcf2 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/circle-stop.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/duplicate.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/duplicate.svg new file mode 100644 index 0000000000..95294b3a6c --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/duplicate.svg @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/edit-bulk.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/edit-bulk.svg new file mode 100644 index 0000000000..689e74af4a --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/edit-bulk.svg @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/file-lock.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/file-lock.svg new file mode 100644 index 0000000000..613fdbf611 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/file-lock.svg @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-ai.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-ai.svg new file mode 100644 index 0000000000..1afc5a10ef --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-ai.svg @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-lock.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-lock.svg new file mode 100644 index 0000000000..592ee4f8a2 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-lock.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-sparkle.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-sparkle.svg new file mode 100644 index 0000000000..aa53146c80 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-sparkle.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-stats.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-stats.svg new file mode 100644 index 0000000000..e39802d10f --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-stats.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-user.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-user.svg new file mode 100644 index 0000000000..0e25ea0df4 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/folder-user.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-branch-check.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-branch-check.svg new file mode 100644 index 0000000000..9cc7b476c1 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-branch-check.svg @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-branch-x.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-branch-x.svg new file mode 100644 index 0000000000..e0f6a653fe --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-branch-x.svg @@ -0,0 +1,21 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-merge-queue.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-merge-queue.svg new file mode 100644 index 0000000000..00de8bb11a --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-merge-queue.svg @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-pull-request-locked.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-pull-request-locked.svg new file mode 100644 index 0000000000..ee5c1dd1a5 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-pull-request-locked.svg @@ -0,0 +1,21 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-pull-request-unlisted.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-pull-request-unlisted.svg new file mode 100644 index 0000000000..c37f439716 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/git-pull-request-unlisted.svg @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/gpu-2.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/gpu-2.svg new file mode 100644 index 0000000000..aa073ebd4a --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/gpu-2.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/gpu.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/gpu.svg new file mode 100644 index 0000000000..800d4133d5 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/gpu.svg @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/lens-concave.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/lens-concave.svg new file mode 100644 index 0000000000..aa12ee3134 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/lens-concave.svg @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/lens-convex.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/lens-convex.svg new file mode 100644 index 0000000000..7ebb64da46 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/lens-convex.svg @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/map-pinned.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/map-pinned.svg new file mode 100644 index 0000000000..84389ce7bc --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/map-pinned.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/memory.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/memory.svg new file mode 100644 index 0000000000..fadbad7e9c --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/memory.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-2-ai.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-2-ai.svg new file mode 100644 index 0000000000..741c06111d --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-2-ai.svg @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-2-sparkle.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-2-sparkle.svg new file mode 100644 index 0000000000..ca892b4655 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-2-sparkle.svg @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-ai.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-ai.svg new file mode 100644 index 0000000000..9f4e41be3d --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-ai.svg @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-sparkle.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-sparkle.svg new file mode 100644 index 0000000000..e14981e397 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/message-sparkle.svg @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/model-ai.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/model-ai.svg new file mode 100644 index 0000000000..194c2b8fd4 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/model-ai.svg @@ -0,0 +1,21 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbit-vertical.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbit-vertical.svg new file mode 100644 index 0000000000..1e9e6adcc5 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbit-vertical.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbit.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbit.svg new file mode 100644 index 0000000000..7a81d0bbac --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbit.svg @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbits.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbits.svg new file mode 100644 index 0000000000..ab12109b24 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/orbits.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/pencil-ai.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/pencil-ai.svg new file mode 100644 index 0000000000..6571e27d02 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/pencil-ai.svg @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/reduce-motion.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/reduce-motion.svg new file mode 100644 index 0000000000..c601c87e6e --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/reduce-motion.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/reference-image.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/reference-image.svg new file mode 100644 index 0000000000..0cde9c32a9 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/reference-image.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/secret-phrases.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/secret-phrases.svg new file mode 100644 index 0000000000..5de9908c2a --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/secret-phrases.svg @@ -0,0 +1,21 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed-top-solid.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed-top-solid.svg new file mode 100644 index 0000000000..a8bae74d32 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed-top-solid.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed-x.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed-x.svg new file mode 100644 index 0000000000..7b4dcf6d26 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed-x.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed.svg index f68ecdc39d..58ee3783be 100644 --- a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed.svg +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/square-dashed.svg @@ -11,5 +11,16 @@ class="icon icon-tabler icons-tabler-outline icon-tabler-square-dashed" > - + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-check.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-check.svg new file mode 100644 index 0000000000..82f89af799 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-check.svg @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-minus.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-minus.svg new file mode 100644 index 0000000000..ea877fbfb6 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-minus.svg @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-plus.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-plus.svg new file mode 100644 index 0000000000..d1f2232b46 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-plus.svg @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-x.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-x.svg new file mode 100644 index 0000000000..432a566434 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/stack-x.svg @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/sticker-smile.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/sticker-smile.svg new file mode 100644 index 0000000000..f93bab5b2c --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/sticker-smile.svg @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/table-dashed.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/table-dashed.svg index ad46441f4c..6af6018201 100644 --- a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/table-dashed.svg +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/table-dashed.svg @@ -11,7 +11,22 @@ class="icon icon-tabler icons-tabler-outline icon-tabler-table-dashed" > - - - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/triangle-dashed.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/triangle-dashed.svg new file mode 100644 index 0000000000..babca344e5 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/triangle-dashed.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/voice-2.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/voice-2.svg new file mode 100644 index 0000000000..0a347cc6d9 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/voice-2.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/voice.svg b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/voice.svg new file mode 100644 index 0000000000..b66719efb4 --- /dev/null +++ b/core/vendor/secondnetwork/blade-tabler-icons/resources/svg/voice.svg @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/core/vendor/seld/phar-utils/src/Linter.php b/core/vendor/seld/phar-utils/src/Linter.php index 935d04e841..7c5420c497 100644 --- a/core/vendor/seld/phar-utils/src/Linter.php +++ b/core/vendor/seld/phar-utils/src/Linter.php @@ -18,6 +18,8 @@ class Linter * * @param string $path Phar file path * @param list $excludedPaths Paths which should be skipped by the linter + * + * @return void */ public static function lint($path, array $excludedPaths = array()) { diff --git a/core/vendor/seld/phar-utils/src/Timestamps.php b/core/vendor/seld/phar-utils/src/Timestamps.php index 80be9c0939..76098860a3 100644 --- a/core/vendor/seld/phar-utils/src/Timestamps.php +++ b/core/vendor/seld/phar-utils/src/Timestamps.php @@ -29,6 +29,8 @@ public function __construct($file) * The PHAR signature can then be produced in a reproducible manner. * * @param int|\DateTimeInterface|string $timestamp Date string or DateTime or unix timestamp to use + * + * @return void */ public function updateTimestamps($timestamp = null) { @@ -98,6 +100,8 @@ public function updateTimestamps($timestamp = null) * * @param string $path * @param int $signatureAlgo One of Phar::MD5, Phar::SHA1, Phar::SHA256 or Phar::SHA512 + * @phpstan-param \Phar::MD5|\Phar::SHA1|\Phar::SHA256|\Phar::SHA512 $signatureAlgo + * * @return bool */ public function save($path, $signatureAlgo) @@ -129,6 +133,11 @@ public function save($path, $signatureAlgo) return file_put_contents($path, $this->contents); } + /** + * @param int $pos + * @param int $bytes + * @return int + */ private function readUint($pos, $bytes) { $res = unpack('V', substr($this->contents, $pos, $bytes)); diff --git a/core/vendor/simplepie/simplepie/CHANGELOG.md b/core/vendor/simplepie/simplepie/CHANGELOG.md deleted file mode 100644 index 4d51eeccae..0000000000 --- a/core/vendor/simplepie/simplepie/CHANGELOG.md +++ /dev/null @@ -1,356 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased](https://github.com/simplepie/simplepie/compare/1.9.0...master) - -Nothing yet. - -## [1.9.0](https://github.com/simplepie/simplepie/compare/1.8.1...1.9.0) - 2025-09-12 - -### Added - -- New method `SimplePie\SimplePie::set_http_client()` for providing PSR-18 HTTP client and PSR-17 factories (by @Art4 in [#777](https://github.com/simplepie/simplepie/pull/777)) -- New method `SimplePie\Locator::set_http_client()` for providing PSR-18 HTTP client and PSR-17 factories (by @Art4 in [#777](https://github.com/simplepie/simplepie/pull/777)) -- New method `SimplePie\Sanitize::set_http_client()` for providing PSR-18 HTTP client and PSR-17 factories (by @Art4 in [#777](https://github.com/simplepie/simplepie/pull/777)) - -### Changed - -- Use `idn_to_ascii` function instead of `idna_convert` library (requires `intl` extension or a [polyfill](https://github.com/symfony/polyfill-intl-idn)) (by @jtojnar in [#785](https://github.com/simplepie/simplepie/pull/785)) -- Improve precision of type annotations and increased the PHPStan checks to level 8 (by @jtojnar in [#837](https://github.com/simplepie/simplepie/pull/837)) -- Use native `gzdecode` function instead of internal PHP implementation (by @jtojnar in [#882](https://github.com/simplepie/simplepie/pull/882)) -- `SimplePie\SimplePie::set_curl_options([CURLOPT_HTTPHEADER => …])` will no longer prevent the following headers defined by SimplePie from being sent: `Accept`, `if-modified-since`, `if-none-match` and `X-FORWARDED-FOR`. (by @Alkarex in [#912](https://github.com/simplepie/simplepie/pull/912)) - -### Fixed - -- Do not crash when `Content-Type` header is missing (by @Art4 in [#774](https://github.com/simplepie/simplepie/pull/774)) -- Correct `SimplePie\File::$permanent_url` when multiple redirects are chained (by @jtojnar in [#812](https://github.com/simplepie/simplepie/pull/812)) -- Improve PHP 8.4 compatibility (by @jrfnl in [#880](https://github.com/simplepie/simplepie/pull/880), [#881](https://github.com/simplepie/simplepie/pull/881), @jtojnar in [#837](https://github.com/simplepie/simplepie/pull/837), @Girgias in [#851](https://github.com/simplepie/simplepie/pull/851)) -- Fix regression from 1.8.0 in cache invalidation (by @Alkarex in [#883](https://github.com/simplepie/simplepie/pull/883)) -- `SimplePie\SimplePie::strip_htmltags()` correctly propagates `$encode` argument to `Sanitize` (by @jtojnar in [#894](https://github.com/simplepie/simplepie/pull/894)) -- Stop `SimplePie\File` from mangling UTF-16 and UTF-32 encoded feeds (by @Alkarex in [#916](https://github.com/simplepie/simplepie/pull/916) and [#917](https://github.com/simplepie/simplepie/pull/917)) - -### Removed - -- Third-party `idna_convert` library is no longer part of the repository (by @jtojnar in [#785](https://github.com/simplepie/simplepie/pull/785)) - -### Deprecated - -- Most public properties on `SimplePie\File` are deprecated in favour of new methods. (by @jtojnar in [26e0d18d67c24fa2611cdd4f27d1d7158ef9a913](https://github.com/simplepie/simplepie/commit/26e0d18d67c24fa2611cdd4f27d1d7158ef9a913)) - - `SimplePie\File::$url` is deprecated, use `SimplePie\File::get_final_requested_uri()` instead - - `SimplePie\File::$useragent` is deprecated, pass the user agent in constructor instead - - `SimplePie\File::$body` is deprecated, use `SimplePie\File::get_body_content()` instead - - `SimplePie\File::$headers` is deprecated, use `SimplePie\File::get_headers()` instead - - `SimplePie\File::$status_code` is deprecated, use `SimplePie\File::get_status_code()` instead - - `SimplePie\File::$method` is deprecated, no replacement: backend is implementation detail which you should not care about; to see if the file was retrieved over HTTP, check the protocol of `SimplePie\File::get_final_requested_uri()`. - - `SimplePie\File::$permanent_url` is deprecated, use `SimplePie\File::get_permanent_uri()` instead - -- The following `SimplePie\Misc` methods are deprecated without replacement: - - `SimplePie\Misc::element_implode()` is deprecated - - `SimplePie\Misc::parse_str()` is deprecated - - `SimplePie\Misc::percent_encoding_normalization()` is deprecated - - `SimplePie\Misc::strip_comments()` is deprecated - - `SimplePie\Misc::uncomment_rfc822()` is deprecated - - If you need any of them, consider copying the function to your codebase. (by @jtojnar in [#899](https://github.com/simplepie/simplepie/pull/899)) -- The method `SimplePie\SimplePie::set_file()` is deprecated, use `SimplePie\SimplePie::set_http_client()` or `SimplePie\SimplePie::set_raw_data()` instead (by @Art4 in [#777](https://github.com/simplepie/simplepie/pull/777)) -- The method `SimplePie\Sanitize::pass_file_data()` is deprecated, use `SimplePie\Sanitize::set_http_client()` instead (by @Art4 in [#774](https://github.com/simplepie/simplepie/pull/774)) -- Passing multiple URLs to `SimplePie\SimplePie::set_feed_url()` is deprecated. You can create separate `SimplePie` instance per feed and then use `SimplePie::merge_items()` to get a single list of items. ([#795](https://github.com/simplepie/simplepie/pull/795)) -- The `SimplePie\Gzdecode` class is deprecated. You can use native [`gzdecode`](https://www.php.net/manual/en/function.gzdecode.php) function (by @jtojnar in [#882](https://github.com/simplepie/simplepie/pull/882)) - -## [1.8.1](https://github.com/simplepie/simplepie/compare/1.8.0...1.8.1) - 2024-10-01 - -### Changed - -- Disable Composer lockfile (by @jrfnl in [#887](https://github.com/simplepie/simplepie/pull/887), backported in [#895](https://github.com/simplepie/simplepie/pull/895)) - -### Fixed - -- Fixes for PHP 8.4 deprecations (by @Girgias, @jrfnl and @jtojnar, backported in [#875](https://github.com/simplepie/simplepie/pull/875)) -- Fix locator with website missing `Content-Type` header (by @jtojnar in [#891](https://github.com/simplepie/simplepie/pull/891)) -- Fix `encode` argument of `SimplePie::strip_htmltags()` @jtojnar in [#894](https://github.com/simplepie/simplepie/pull/894), backported in [#898](https://github.com/simplepie/simplepie/pull/898) -- Reverted `strict_types` only on the `one-dot-eight` branch (by @jtojnar in [#842](https://github.com/simplepie/simplepie/pull/842)) - -## [1.8.0](https://github.com/simplepie/simplepie/compare/1.7.0...1.8.0) - 2023-01-20 - -### Added - -- New method `SimplePie\SimplePie::set_cache()` for providing a PSR-16 cache implementation (by @Art4 in [#742](https://github.com/simplepie/simplepie/pull/742)) -- New method `SimplePie\SimplePie::set_cache_namefilter()` for customize the cache key in [#762](https://github.com/simplepie/simplepie/pull/762) -- New class `SimplePie\Cache\CallableNameFilter` to provide a `callable` to customize the cache key in [#762](https://github.com/simplepie/simplepie/pull/762) -- New interface `SimplePie\RegistryAware` to inject the `Registry` instance into classes created by `Registry` (by @Art4 in [#760](https://github.com/simplepie/simplepie/pull/760)) -- update PHP versions in GH Actions workflows (by @jrfnl in [#767](https://github.com/simplepie/simplepie/pull/767)) -- Registry: Allow using class-strings instead of magic strings (by @jtojnar and @Art4 in [#766](https://github.com/simplepie/simplepie/pull/766)) - -### Changed - -- Clarify branching strategy (by @Art4 in [#751](https://github.com/simplepie/simplepie/pull/751)) -- Use native `array_replace_recursive()` (by @Alkarex in [#749](https://github.com/simplepie/simplepie/pull/749)) -- PHP 7.2 or newer is now required (by @Art4 in [#743](https://github.com/simplepie/simplepie/pull/743)) -- `SimplePie\Parse\Date::date_w3cdtf()`: Clean up regex structure (by @jtojnar in [#765](https://github.com/simplepie/simplepie/pull/765)) -- Declare `strict_types=1` in every file (by @Art4 in [#763](https://github.com/simplepie/simplepie/pull/763)) - -### Fixed - -- Item::get_date(): fix return type on unparsable date (by @jtojnar in [#753](https://github.com/simplepie/simplepie/pull/753)) -- Fix error handling for PHP 8.1 (by @cedric-anne in [#747](https://github.com/simplepie/simplepie/pull/747)) -- The method `SimplePie\SimplePie::get_image_height()` returns the pixel number as `int` instead of `float` (by @Art4 in [#763](https://github.com/simplepie/simplepie/pull/763)) -- The method `SimplePie\SimplePie::get_image_width()` returns the pixel number as `int` instead of `float` (by @Art4 in [#763](https://github.com/simplepie/simplepie/pull/763)) -- No URL Decode for enclosure links (by @Alkarex in [#768](https://github.com/simplepie/simplepie/pull/768)) -- Sanitize thumbnail URL (by @Alkarex in [#770](https://github.com/simplepie/simplepie/pull/770)) -- Fix case of multiple RSS2.0 enclosures (by @Alkarex in [#769](https://github.com/simplepie/simplepie/pull/769)) -- Fix broken phpdoc references (by @jtojnar in [#771](https://github.com/simplepie/simplepie/pull/771)) - -### Deprecated - -- The method `SimplePie\Misc::array_merge_recursive()` is deprecated, use native `array_replace_recursive()` instead -- The method `SimplePie\SimplePie::set_cache_name_function()` is deprecated, use `SimplePie\SimplePie::set_cache_namefilter()` instead -- The method `SimplePie\SimplePie::set_cache_location()` is deprecated, use `SimplePie\SimplePie::set_cache()` instead -- The method `SimplePie\SimplePie::force_cache_fallback()` is deprecated, expired cache will not be used anymore -- The class `SimplePie\Cache` is deprecated, use implementation of `SimplePie\SimplePie::set_cache()` instead -- The class `SimplePie\Cache\DB` is deprecated, use implementation of `Psr\SimpleCache\CacheInterface` instead -- The class `SimplePie\Cache\File` is deprecated, use implementation of `Psr\SimpleCache\CacheInterface` instead -- The class `SimplePie\Cache\Memcache` is deprecated, use implementation of `Psr\SimpleCache\CacheInterface` instead -- The class `SimplePie\Cache\Memcached` is deprecated, use implementation of `Psr\SimpleCache\CacheInterface` instead -- The class `SimplePie\Cache\MySQL` is deprecated, use implementation of `Psr\SimpleCache\CacheInterface` instead -- The class `SimplePie\Cache\Redis` is deprecated, use implementation of `Psr\SimpleCache\CacheInterface` instead -- The interface `SimplePie\Cache\Base` is deprecated, use interface `Psr\SimpleCache\CacheInterface` instead - -### Removed - -- ROADMAP.md removed (by @Art4 in [#748](https://github.com/simplepie/simplepie/pull/748)) -- remove check for E_USER_DEPRECATED definition (by @Art4 in [#750](https://github.com/simplepie/simplepie/pull/750)) -- remove broken BC code in Registry (by @Art4 in [#764](https://github.com/simplepie/simplepie/pull/764)) - -## [1.7.0](https://github.com/simplepie/simplepie/compare/1.6.0...1.7.0) - 2022-09-30 - -### Added - -- New class `SimplePie\SimplePie` as a replacement for class `SimplePie` -- New method `SimplePie\Misc::get_default_useragent()` as a replacement for constant `SIMPLEPIE_USERAGENT` - -### Changed - -- Do not use magic values for state machine state (by @jtojnar in [#735](https://github.com/simplepie/simplepie/pull/735)) -- Use PSR-4 classes in Registry (by @Art4 in [#736](https://github.com/simplepie/simplepie/pull/736)) -- GH Actions: run tests against PHP 8.2 (by @jrfnl in [#739](https://github.com/simplepie/simplepie/pull/739)) -- Change code style to PSR-12 (by @Art4 in [#738](https://github.com/simplepie/simplepie/pull/738)) - -### Fixed - -- Fix status_code type (by @Alkarex in [#728](https://github.com/simplepie/simplepie/pull/728)) -- Fix parsing of HTTP Links (by @Alkarex in [#729](https://github.com/simplepie/simplepie/pull/729)) -- Fix using the best base link for an item content (by @Alkarex in [#744](https://github.com/simplepie/simplepie/pull/744)) -- Fix .editorconfig regression (by @Alkarex in [#745](https://github.com/simplepie/simplepie/pull/745)) - -### Deprecated - -- The class `SimplePie` is deprecated, use class `SimplePie\SimplePie` instead -- The use of PSR-0 classes (all classes without namespaces in the `library` directory) is deprecated, use PSR-4 classes (see `src` directory) instead -- The constant `SIMPLEPIE_BUILD` is deprecated, use `SimplePie\Misc::get_build()` instead -- The constant `SIMPLEPIE_USERAGENT` is deprecated, use `SimplePie\Misc::get_default_useragent()` instead -- All global constants are deprecated, use the constants from the class `SimplePie\SimplePie` instead (e.g. replace `SIMPLEPIE_VERSION` with `SimplePie\SimplePie::VERSION`) - -## [1.6.0](https://github.com/simplepie/simplepie/compare/1.5.8...1.6.0) - 2022-04-21 - -### Added - -- New methods `SimplePie::rename_attributes()` and `SimplePie_Sanitize::rename_attributes()` allow renaming attributes (by @math-GH in [#717](https://github.com/simplepie/simplepie/pull/717)) -- Add audio, video @src elements/attribute for URL resolution (by @rdalverny in [#716](https://github.com/simplepie/simplepie/pull/716)) -- Added new namespaced aliases and PSR-4 support for every class (by @Art4 in [#711](https://github.com/simplepie/simplepie/pull/711)) -- Add .editorconfig (by @Alkarex in [#724](https://github.com/simplepie/simplepie/pull/724)) -- Upload compiled file as release asset (by @Art4 in [#725](https://github.com/simplepie/simplepie/pull/725)) - -### Changed - -- GH Actions: version update for ramsey/composer-install (by @jrfnl in [#713](https://github.com/simplepie/simplepie/pull/713)) - -### Fixed - -- Bugfix in MySQL cache (by @Art4 in [#720](https://github.com/simplepie/simplepie/pull/720)) -- Re-enable xml:base for all supported RSS formats (by @Alkarex in [#723](https://github.com/simplepie/simplepie/pull/723)) - -## [1.5.8](https://github.com/simplepie/simplepie/compare/1.5.7...1.5.8) - 2021-12-24 - -### Changed - -- Update CHANGELOG.md, follow keepachangelog format (by @Art4 in [#709](https://github.com/simplepie/simplepie/pull/709)) - -### Fixed - -- Fix a small typo in the error() function Docblock (by @audrasjb in [#712](https://github.com/simplepie/simplepie/pull/712)) -- Fix/708 version bump for constant `SIMPLEPIE_VERSION` for 1.5.8 release (by @faisal-alvi in [#710](https://github.com/simplepie/simplepie/pull/710)) - -## [1.5.7](https://github.com/simplepie/simplepie/compare/1.5.6...1.5.7) - 2021-12-19 - -* Fix PHP8 crash due to insufficient isset test (by @Alkarex in [#670](https://github.com/simplepie/simplepie/pull/670)) -* gitignore tests (by @Alkarex in [#671](https://github.com/simplepie/simplepie/pull/671)) -* Reduce memory when parsing large feeds (by @Alkarex in [#672](https://github.com/simplepie/simplepie/pull/672)) -* PHP8 catch ValueError for loadHTML() (by @Alkarex in [#673](https://github.com/simplepie/simplepie/pull/673)) -* Provide access to HTTP status code (by @Alkarex in [#674](https://github.com/simplepie/simplepie/pull/674)) -* Fix wrong type hint (by @Alkarex in [#678](https://github.com/simplepie/simplepie/pull/678)) -* Force HTTPS for selected domains (by @Alkarex in [#676](https://github.com/simplepie/simplepie/pull/676)) -* Prevent cache pollution (by @Alkarex in [#675](https://github.com/simplepie/simplepie/pull/675)) -* Fix typo in comment (by @Alkarex in [#680](https://github.com/simplepie/simplepie/pull/680)) -* Remove HTTP credentials in HTTP Referer (by @Alkarex in [#681](https://github.com/simplepie/simplepie/pull/681)) -* CI: switch to GH Actions (by @jrfnl in [#688](https://github.com/simplepie/simplepie/pull/688)) -* PHP 8.1: fix "passing null to non-nullable" deprecation notice (by @jrfnl in [#689](https://github.com/simplepie/simplepie/pull/689)) -* Tests: PHPUnit cross-version compatibility (by @jrfnl in [#690](https://github.com/simplepie/simplepie/pull/690)) -* Tests: use strict assertions (by @jrfnl in [#692](https://github.com/simplepie/simplepie/pull/692)) -* CacheTest: handle different exceptions PHP cross-version (by @jrfnl in [#691](https://github.com/simplepie/simplepie/pull/691)) -* GH Actions: don't allow builds to fail on PHP 8.0 or 8.1 (by @jrfnl in [#693](https://github.com/simplepie/simplepie/pull/693)) -* Tests: use the correct parameter order (by @jrfnl in [#694](https://github.com/simplepie/simplepie/pull/694)) -* PHPUnit: update configuration (by @jrfnl in [#696](https://github.com/simplepie/simplepie/pull/696)) -* fix: better deal with proxy returning proxy headers (in response to cURL's Proxy-Connection header) (by @shunf4 in [#698](https://github.com/simplepie/simplepie/pull/698)) -* Handle multiple Link headers (by @voegelas in [#700](https://github.com/simplepie/simplepie/pull/700)) -* PHP 8.2: explicitly declare properties (by @jrfnl in [#705](https://github.com/simplepie/simplepie/pull/705)) -* New Contributor: @shunf4 made their first contribution in [#698](https://github.com/simplepie/simplepie/pull/698) -* New Contributor: @voegelas made their first contribution in [#700](https://github.com/simplepie/simplepie/pull/700) - -## [1.5.6](https://github.com/simplepie/simplepie/compare/1.5.5...1.5.6) - 2020-10-14 - -* PHP 8.0: prevent ValueError for invalid encoding [#657](https://github.com/simplepie/simplepie/pull/657) -* Travis: test against more recent PHP versions [#653](https://github.com/simplepie/simplepie/pull/653) -* PHP 8.0: handle removal of get_magic_quotes_gpc() [#654](https://github.com/simplepie/simplepie/pull/654) -* PHP 7.4/8.0: curly brace array access deprecated & removed [#655](https://github.com/simplepie/simplepie/pull/655) -* PHP 8.0: required parameters are no longer allowed after optional parameters [#656](https://github.com/simplepie/simplepie/pull/656) -* Fix permanent_url for HTTP 301 [#660](https://github.com/simplepie/simplepie/pull/660) -* Fix typo in MIME type in Content_Type_Sniffer [#661](https://github.com/simplepie/simplepie/pull/661) - -## [1.5.5](https://github.com/simplepie/simplepie/compare/1.5.4...1.5.5) - 2020-05-01 - -* Ensure that feeds retrieved with `force_feed` do not share the same cache as those retrieved without. [#643](https://github.com/simplepie/simplepie/pull/643) -* Removed references to removed PHP directives and some PHP < 5.6 checks. [#645](https://github.com/simplepie/simplepie/pull/645) -* Corrected incorrect alumni name. [#638](https://github.com/simplepie/simplepie/pull/638) - -## [1.5.4](https://github.com/simplepie/simplepie/compare/1.5.3...1.5.4) - 2019-12-17 - -* PHP 5.6 or newer is now required. [#625](https://github.com/simplepie/simplepie/pull/625) -* Fixed invalid docblock parameter types [#633](https://github.com/simplepie/simplepie/pull/633) -* Added support for German short forms for weekdays and months. [#632](https://github.com/simplepie/simplepie/pull/632) -* PHP 7.4 support: Fixed instances of accessing array offset on null type values. [#628](https://github.com/simplepie/simplepie/pull/628) -* Return an effective feed URL when asking for non-permanent `subscribe_url`. [#627](https://github.com/simplepie/simplepie/pull/627) - -## [1.5.3](https://github.com/simplepie/simplepie/compare/1.5.2...1.5.3) - 2019-09-22 - -* Replaced `pow()` call with `**` operator (micro performance optimization). [#622](https://github.com/simplepie/simplepie/pull/622) -* Match links containing `feed` in the Locator class. [#621](https://github.com/simplepie/simplepie/pull/621) -* PHP 7.4 support: Ensure the proper argument order for `implode()` calls. [#617](https://github.com/simplepie/simplepie/pull/617) -* Added support for Russian dates. [#607](https://github.com/simplepie/simplepie/pull/607) -* Preemptively changed `is_writeable()` calls to `is_writable()` in case the former is deprecated in PHP. [#604](https://github.com/simplepie/simplepie/pull/604) - -## [1.5.2](https://github.com/simplepie/simplepie/compare/1.5.1...1.5.2) - 2018-08-02 - -* Added support for PHPUnit 6. [#565](https://github.com/simplepie/simplepie/pull/565) -* Added PHP module requirements to Composer. [#590](https://github.com/simplepie/simplepie/pull/590) -* Added support for Redis password and database. [#589](https://github.com/simplepie/simplepie/pull/589) -* Changed the spelling of `writeable` to `writable` within inline documentation. [#586](https://github.com/simplepie/simplepie/pull/586) -* Fixed various issues in the test suite and Travis. [#576](https://github.com/simplepie/simplepie/pull/576) -* Removed ambiguous tests failing on `usort()` in PHP 7. [#578](https://github.com/simplepie/simplepie/pull/578) -* Simplified logic for some function returns. [#573](https://github.com/simplepie/simplepie/pull/573) -* Fixed inline documentation for return value types for accuracy. [#570](https://github.com/simplepie/simplepie/pull/570) -* Fixed Travis to run `composer install`. [#567](https://github.com/simplepie/simplepie/pull/567) -* Removed unnecessary `else`s when a value has already been returned. [#566](https://github.com/simplepie/simplepie/pull/566) -* Fixed a bug where URL fragments are included when `SimplePie_File` normalizes URLs when really old versions of cURL are used. [#564](https://github.com/simplepie/simplepie/pull/564) -* Updated `SimplePie_Locator` to respect cURL options specified. [#561](https://github.com/simplepie/simplepie/pull/561) - -## [1.5.1](https://github.com/simplepie/simplepie/compare/1.5...1.5.1) - 2017-11-17 - -* Fixed photos so they are not added if the URL is empty. [#530](https://github.com/simplepie/simplepie/pull/530) -* Fixed issues with retrieving feeds from behind a proxy. [#512](https://github.com/simplepie/simplepie/pull/512)/[#548](https://github.com/simplepie/simplepie/pull/548) -* Updated favicon URL in `get_favicon()`. [#525](https://github.com/simplepie/simplepie/pull/525) -* Fixed inline documentation typo. [#540](https://github.com/simplepie/simplepie/pull/540) -* Removed extra closing `` tag. [#537](https://github.com/simplepie/simplepie/pull/537) -* Removed and updated feed URLs in the demo. [#535](https://github.com/simplepie/simplepie/pull/535) -* Improvements to microformat feed parsing. [#533](https://github.com/simplepie/simplepie/pull/533) -* Switched from regex to xpath for microformats discovery. [#536](https://github.com/simplepie/simplepie/pull/536) -* Update the registry if the Sanitize class has been changed. [#532](https://github.com/simplepie/simplepie/pull/532) -* Changed the sanitization type for author and category back to text from HTML. [#531](https://github.com/simplepie/simplepie/pull/531) - -## [1.5](https://github.com/simplepie/simplepie/compare/1.4.3...1.5) - 2017-04-17 - -* Introduced `SimplePie_Category->get_type()` for retrieving category type. [#492](https://github.com/simplepie/simplepie/pull/492) -* Added `$enable_exceptions` to the class property declarations for `SimplePie` class. [#504](https://github.com/simplepie/simplepie/pull/504) -* Titles are now parsed for ATOM10 enclosure links. [#507](https://github.com/simplepie/simplepie/pull/507) -* `$item->get_id()` can now be forced to return the supplied ID instead of generating a new one. [#509](https://github.com/simplepie/simplepie/pull/509) - -## [1.4.3](https://github.com/simplepie/simplepie/compare/1.4.2...1.4.3) - 2016-11-26 - -* Removed support for PHP 5.2. [#469](https://github.com/simplepie/simplepie/pull/469) -* Added support for the PHP `UConverter` class. [#485](https://github.com/simplepie/simplepie/pull/485) -* PHP 7.1 Support: Fixed PHP error when trying to use a non-numeric value in `round()`. [#458](https://github.com/simplepie/simplepie/pull/458) -* PHP 7 Support: Fixed deprecated message for old style constructors. [#489](https://github.com/simplepie/simplepie/pull/489) -* Fixed the error message shown when a feed has an empty body. [#487](https://github.com/simplepie/simplepie/pull/487) -* Added an error message when the XML or PCRE PHP extensions are missing. [#468](https://github.com/simplepie/simplepie/pull/468) -* Check the result of sanitize before returning in `get_content()` and `get_description()`. [#494](https://github.com/simplepie/simplepie/pull/494) -* Use `saveHTML()` to fix issues with non UTF-8 characters. [#470](https://github.com/simplepie/simplepie/pull/470) -* Stop passing compressed data through `trim()`. [#455](https://github.com/simplepie/simplepie/pull/455) -* Refactored the UTF-8 conversion error message. [#467](https://github.com/simplepie/simplepie/pull/467) -* Updated the readme file. [#486](https://github.com/simplepie/simplepie/pull/486) -* Added command line support for compayibility test. [#481](https://github.com/simplepie/simplepie/pull/481) -* Added PHP 7.1 to the testing matrix. [#462](https://github.com/simplepie/simplepie/pull/462) -* Use the latest HHVM version in testing (3.15.2). [#480](https://github.com/simplepie/simplepie/pull/480) -* Added PHPUnit as a `dev-dependency` in Composer. [#463](https://github.com/simplepie/simplepie/pull/463) -* Added `mf2/mf2` as a suggestion in Composer for use with microformats. [#491](https://github.com/simplepie/simplepie/pull/491) -* Fixed misspelled occurrences of "separated". [#459](https://github.com/simplepie/simplepie/pull/459) -* Improvements to the compatibility test and error messages. [#488](https://github.com/simplepie/simplepie/pull/488) - -## [1.4.2](https://github.com/simplepie/simplepie/compare/1.4.1...1.4.2) - 2016-06-14 - -* Fixed a bug with IRI parsing. -* More cleanly separates discovery of microformats and parsing when php-mf2 is not present. - -## [1.4.1](https://github.com/simplepie/simplepie/compare/1.4.0...1.4.1) - 2016-06-02 - -* Fixed inconsistent hash results in `SimplePie_Item->get_id()`. -* Leading and trailing whitespace is now trimmed from XML feed content to prevent errors. [#445](https://github.com/simplepie/simplepie/pull/445) -* Improved support for microformat feeds. - -## [1.4.0](https://github.com/simplepie/simplepie/compare/1.4-beta...1.4.0) - 2016-04-25 - -* Dropped support for PHP 5.2. [#348](https://github.com/simplepie/simplepie/pull/348) -* Serialized data is now used for hashing in `SimplePie_Item->get_id()`. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added support for PHP 5.5 and 5.6. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added the `add_attributes()` method to `SimplePie`. [#394](https://github.com/simplepie/simplepie/pull/394) -* Added the `force_cache_fallback()` method to `SimplePie` to allow an expired cache to be used when a feed is unavailable. [#389](https://github.com/simplepie/simplepie/pull/389) -* Added Memcached. [#386](https://github.com/simplepie/simplepie/pull/386) -* Added `set_curl_options()` method to `SimplePie` to allow custom options. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added Redis Caching. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added the CEST timezone. [#380](https://github.com/simplepie/simplepie/pull/380) -* Added support for HTTP 301 Moved Permanently. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added support for `application/x-rss+xml` in `SimplePie_Locator`. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added photo de-duping in microformats. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added decoding for special characters in MAYBE_HTML. [#400](https://github.com/simplepie/simplepie/pull/400) -* Added `SimplePie_Exception` for internally reporting errors. Also, use this to show an error when trying to load the class instead of causing a failure. [#241](https://github.com/simplepie/simplepie/pull/241) -* Added sanitization of the `` and `` tags. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added support for media thumbnails through `SimplePie_Item->get_thumbnail()`. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added the `feed_url` to a returned error message. [#348](https://github.com/simplepie/simplepie/pull/348) -* Added cache purging after a specified period of time when using MySQL cache. [#329](https://github.com/simplepie/simplepie/pull/329) -* Added backwards compatibility for removed `subscribe_*()` and `enable_xml_dump()` methods. [#348](https://github.com/simplepie/simplepie/pull/348) -* Re-added the deprecated `get/set_favicon()` methods for backwards compatibility. -* Charsets are now compared without case sensitivity to avoid duplicates. [#352](https://github.com/simplepie/simplepie/pull/352) -* Fixed encoding of ampersands in `SimplePie->subscribe_url()`. [#348](https://github.com/simplepie/simplepie/pull/348) -* The feed URL is now updated based on the URL returned by cURL. [#348](https://github.com/simplepie/simplepie/pull/348) -* Explicitly use UTF-8 in `SimplePie_Misc->get_element()` and `Simple_ie_Misc->element_implode()`. [#348](https://github.com/simplepie/simplepie/pull/348) -* Improved support, feed and authorship discovery, and parsing for microformats. [#348](https://github.com/simplepie/simplepie/pull/348) -* `rss:pubDate` is now used over `atom:updated` when determining the posting date. [#288](https://github.com/simplepie/simplepie/pull/288) -* Simplified the use of `mtime()` and `touch()`. [#403](https://github.com/simplepie/simplepie/pull/403) -* All items are now forced to have a timestamp. [#348](https://github.com/simplepie/simplepie/pull/348) -* Fixed typo in the date parser that incorrectly identified September as month 8. [#348](https://github.com/simplepie/simplepie/pull/348) -* Fixed backwards compatibility with cache subclasses. [#243](https://github.com/simplepie/simplepie/pull/243) -* Fixed a bug where the updated date was not fetched correctly. [#239](https://github.com/simplepie/simplepie/pull/239) -* Fixed the datatype for `items.data` to be more appropriate in when using MySQL cache. [#302](https://github.com/simplepie/simplepie/pull/302) -* Fixed cURL not failing when the server returns an error. [#425](https://github.com/simplepie/simplepie/pull/425) -* Fixed an error caused when trying to instantiate a `SimplePie_File` object with a bad URI. [#272](https://github.com/simplepie/simplepie/pull/272) -* Fixed a PHP notice that occurs when a date starts with `(`. [#348](https://github.com/simplepie/simplepie/pull/348) -* Fixed uninitialized string offeset PHP notices. [#353](https://github.com/simplepie/simplepie/pull/353) -* Fixed call to non-existent property in Memcache. [#311](https://github.com/simplepie/simplepie/pull/311) -* Fixed a bug where MySQL statements were not being passed through `prepare()`. [#348](https://github.com/simplepie/simplepie/pull/348) -* Fixed an instance where an error message in `SimplePie` was not being triggered correctly. [#348](https://github.com/simplepie/simplepie/pull/348) -* Fixed a bug with Russian feeds. [#348](https://github.com/simplepie/simplepie/pull/348) -* Fixed an issue with memory leaks. [#287](https://github.com/simplepie/simplepie/pull/287) -* Fixed use of `DOMElement` as array. [#315](https://github.com/simplepie/simplepie/pull/315) -* Improved the error message when a feed cannot be found. [#348](https://github.com/simplepie/simplepie/pull/348) diff --git a/core/vendor/simplepie/simplepie/LICENSES/BSD-3-Clause.txt b/core/vendor/simplepie/simplepie/LICENSES/BSD-3-Clause.txt deleted file mode 100644 index d8550c98ab..0000000000 --- a/core/vendor/simplepie/simplepie/LICENSES/BSD-3-Clause.txt +++ /dev/null @@ -1,11 +0,0 @@ -Copyright (c) 2004-2023, Ryan Parman and Sam Sneddon. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/core/vendor/simplepie/simplepie/LICENSES/MIT.txt b/core/vendor/simplepie/simplepie/LICENSES/MIT.txt deleted file mode 100644 index 89de354795..0000000000 --- a/core/vendor/simplepie/simplepie/LICENSES/MIT.txt +++ /dev/null @@ -1,17 +0,0 @@ -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/core/vendor/simplepie/simplepie/README.markdown b/core/vendor/simplepie/simplepie/README.markdown deleted file mode 100644 index 00df1ac05b..0000000000 --- a/core/vendor/simplepie/simplepie/README.markdown +++ /dev/null @@ -1,153 +0,0 @@ -SimplePie -========= - -SimplePie is a very fast and easy-to-use class, written in PHP, that puts the -'simple' back into 'really simple syndication'. Flexible enough to suit -beginners and veterans alike, SimplePie is focused on [speed, ease of use, -compatibility and standards compliance][what_is]. - -[what_is]: http://simplepie.org/wiki/faq/what_is_simplepie - - -Requirements ------------- -* PHP 7.2+ (Required since SimplePie 1.8.0) -* libxml2 (certain 2.7.x releases are too buggy for words, and will crash) -* One of iconv, mbstring or intl extensions -* Optionally, intl extension, [symfony/polyfill-intl-idn](https://github.com/symfony/polyfill-intl-idn) or cURL extension built with IDN support to support IDNs -* cURL or fsockopen() -* PCRE support - -PSR-18: HTTP Client support --------------- - -Since SimplePie 1.9.0 you can use a [PSR-18](https://www.php-fig.org/psr/psr-18/) HTTP client like [Guzzle](https://guzzlephp.org) -or [every other implementation](https://packagist.org/providers/psr/http-client-implementation). -Please note that you would also need [PSR-17](https://www.php-fig.org/psr/psr-17/) implementations of `RequestFactoryInterface` and an `UriFactoryInterface` implementation. - -```php -$simplepie = new \SimplePie\SimplePie(); -$simplepie->set_http_client( - new \GuzzleHttp\Client(), - new \GuzzleHttp\Psr7\HttpFactory(), - new \GuzzleHttp\Psr7\HttpFactory(), -); -``` - -PSR-16: Caching support --------------- - -Since SimplePie 1.8.0 you can use the [PSR-16](https://www.php-fig.org/psr/psr-16/) cache from -[Symfony](https://symfony.com/doc/current/components/cache.html) -or [every other implementation](https://packagist.org/providers/psr/simple-cache-implementation). - -```php -$simplepie = new \SimplePie\SimplePie(); -$simplepie->set_cache( - new \Symfony\Component\Cache\Psr16Cache( - new \Symfony\Component\Cache\Adapter\FilesystemAdapter() - ), -); -``` - -What comes in the package? --------------------------- -1. `src/` - SimplePie classes for use with the autoloader -2. `autoloader.php` - The SimplePie Autoloader if you want to use the separate - file version. -3. `README.markdown` - This document. -4. `LICENSES/BSD-3-Clause.txt` - A copy of the BSD license. -5. `compatibility_test/` - The SimplePie compatibility test that checks your - server for required settings. -6. `demo/` - A basic feed reader demo that shows off some of SimplePie's more - noticeable features. -7. `build/` - Scripts related to generating pieces of SimplePie -8. `test/` - SimplePie's unit test suite. - -### Where's `simplepie.inc`? -Since SimplePie 1.3, we've split the classes into separate files to make it easier -to maintain and use. - -If you'd like a single monolithic file, see the assets in the -[releases](https://github.com/simplepie/simplepie/releases), or you can -run `php build/compile.php` to generate `SimplePie.compiled.php` yourself. - -To start the demo ------------------ -1. Upload this package to your webserver. -2. Make sure that the cache folder inside of the demo folder is server-writable. -3. Navigate your browser to the demo folder. - - -Need support? -------------- -For further setup and install documentation, function references, etc., visit -[the wiki][wiki]. If you're using the latest version off GitHub, you can also -check out the [API documentation][]. - -If you can't find an answer to your question in the documentation, head on over -to one of our [support channels][]. For bug reports and feature requests, visit -the [issue tracker][]. - -[API documentation]: http://dev.simplepie.org/api/ -[wiki]: http://simplepie.org/wiki/ -[support channels]: http://simplepie.org/support/ -[issue tracker]: http://github.com/simplepie/simplepie/issues - - -Project status --------------- -SimplePie is currently maintained by Malcolm Blaney. - -As an open source project, SimplePie is maintained on a somewhat sporadic basis. -This means that feature requests may not be fulfilled straight away, as time has -to be prioritized. - -If you'd like to contribute to SimplePie, the best way to get started is to fork -the project on GitHub and send pull requests for patches. When doing so, please -be aware of our [coding standards](http://simplepie.org/wiki/misc/coding_standards). - -The main development for the next minor release happens in `master` branch. -Please create your pull requests primarily against this branch. - -We do not actively provide bug fixes or security fixes for older versions. Nevertheless, -you are welcome to create backport PRs if you still need support for older PHP versions. -Please open your PR against the appropriate branch. - -| branch | requires | -|----------------------------------------------------------------------------|-------------| -| [master](https://github.com/simplepie/simplepie/tree/master) | PHP 7.2.0+ | -| [one-dot-seven](https://github.com/simplepie/simplepie/tree/one-dot-seven) | PHP 5.6.0+ | -| [one-dot-three](https://github.com/simplepie/simplepie/tree/one-dot-three) | PHP 5.2.0+ | - - -Authors and contributors ------------------------- -### Current -* [Malcolm Blaney][] (Maintainer, support) - -### Alumni -* [Ryan McCue][] (developer, support) -* [Ryan Parman][] (Creator, developer, evangelism, support) -* [Sam Sneddon][] (Lead developer) -* [Michael Shipley][] (Submitter of patches, support) -* [Steve Minutillo][] (Submitter of patches) - -[Malcolm Blaney]: https://mblaney.xyz -[Ryan McCue]: http://ryanmccue.info -[Ryan Parman]: http://ryanparman.com -[Sam Sneddon]: https://gsnedders.com -[Michael Shipley]: http://michaelpshipley.com -[Steve Minutillo]: http://minutillo.com/steve/ - - -### Contributors -For a complete list of contributors: - -1. Pull down the latest SimplePie code -2. In the `simplepie` directory, run `git shortlog -ns` - - -License -------- -[New BSD license](http://www.opensource.org/licenses/BSD-3-Clause) diff --git a/core/vendor/simplepie/simplepie/autoloader.php b/core/vendor/simplepie/simplepie/autoloader.php deleted file mode 100644 index 4356b456f9..0000000000 --- a/core/vendor/simplepie/simplepie/autoloader.php +++ /dev/null @@ -1,86 +0,0 @@ -path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'library'; - } - - /** - * Autoloader - * - * @param string $class The name of the class to attempt to load. - */ - public function autoload($class) - { - // Only load the class if it starts with "SimplePie" - if (strpos($class, 'SimplePie') !== 0) - { - return; - } - - $filename = $this->path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; - include $filename; - } -} diff --git a/core/vendor/simplepie/simplepie/composer.json b/core/vendor/simplepie/simplepie/composer.json deleted file mode 100644 index e35a812118..0000000000 --- a/core/vendor/simplepie/simplepie/composer.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "simplepie/simplepie", - "description": "A simple Atom/RSS parsing library for PHP", - "type": "library", - "keywords": ["rss", "atom", "feeds"], - "homepage": "http://simplepie.org/", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Ryan Parman", - "homepage": "http://ryanparman.com/", - "role": "Creator, alumnus developer" - }, - { - "name": "Sam Sneddon", - "homepage": "https://gsnedders.com/", - "role": "Alumnus developer" - }, - { - "name": "Ryan McCue", - "email": "me@ryanmccue.info", - "homepage": "http://ryanmccue.info/", - "role": "Developer" - } - ], - "require": { - "php": ">=7.2.0", - "ext-pcre": "*", - "ext-xml": "*", - "ext-xmlreader": "*" - }, - "require-dev": { - "donatj/mock-webserver": "^2.7", - "friendsofphp/php-cs-fixer": "^2.19 || ^3.8", - "mf2/mf2": "^0.5.0", - "phpstan/phpstan": "~1.12.2", - "phpunit/phpunit": "^8 || ^9 || ^10", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/simple-cache": "^1 || ^2 || ^3" - }, - "suggest": { - "ext-curl": "", - "ext-iconv": "", - "ext-intl": "", - "ext-mbstring": "", - "mf2/mf2": "Microformat module that allows for parsing HTML for microformats" - }, - "autoload": { - "psr-4": { - "SimplePie\\": "src" - }, - "psr-0": { - "SimplePie": "library" - } - }, - "autoload-dev": { - "psr-4": { - "SimplePieUtils\\": "utils/", - "SimplePie\\Tests\\Fixtures\\": "tests/Fixtures", - "SimplePie\\Tests\\Unit\\": "tests/Unit" - } - }, - "config": { - "lock": false, - "sort-packages": true - }, - "scripts": { - "coverage": "phpunit --coverage-html=.phpunit.cache/code-coverage", - "cs": "php-cs-fixer fix --verbose --dry-run --diff", - "fix": "php-cs-fixer fix --verbose --diff", - "phpstan": "phpstan analyze --memory-limit 512M", - "test": "phpunit" - } -} diff --git a/core/vendor/simplepie/simplepie/db.sql b/core/vendor/simplepie/simplepie/db.sql deleted file mode 100644 index 8793829404..0000000000 --- a/core/vendor/simplepie/simplepie/db.sql +++ /dev/null @@ -1,40 +0,0 @@ -/* SQLite */ -CREATE TABLE cache_data ( - id TEXT NOT NULL, - items SMALLINT NOT NULL DEFAULT 0, - data BLOB NOT NULL, - mtime INTEGER UNSIGNED NOT NULL -); -CREATE UNIQUE INDEX id ON cache_data(id); - -CREATE TABLE items ( - feed_id TEXT NOT NULL, - id TEXT NOT NULL, - data TEXT NOT NULL, - posted INTEGER UNSIGNED NOT NULL -); -CREATE INDEX feed_id ON items(feed_id); - - -/* MySQL */ ---- Don't paste this to create tables, since SimplePie will create ---- tables by its own. -CREATE TABLE `cache_data` ( - `id` TEXT CHARACTER SET utf8 NOT NULL, - `items` SMALLINT NOT NULL DEFAULT 0, - `data` BLOB NOT NULL, - `mtime` INT UNSIGNED NOT NULL, - UNIQUE ( - `id`(125) - ) -); - -CREATE TABLE `items` ( - `feed_id` TEXT CHARACTER SET utf8 NOT NULL, - `id` TEXT CHARACTER SET utf8 NOT NULL, - `data` MEDIUMBLOB NOT NULL, - `posted` INT UNSIGNED NOT NULL, - INDEX `feed_id` ( - `feed_id`(125) - ) -); \ No newline at end of file diff --git a/core/vendor/simplepie/simplepie/library/SimplePie.php b/core/vendor/simplepie/simplepie/library/SimplePie.php deleted file mode 100644 index 25d1ad146d..0000000000 --- a/core/vendor/simplepie/simplepie/library/SimplePie.php +++ /dev/null @@ -1,450 +0,0 @@ -data = $data; - } - - /** - * Parse the input data - * - * @access public - * @return string Output data - */ - public function parse() - { - while (($position = strpos($this->data, '&', $this->position)) !== false) { - $this->position = $position; - $this->consume(); - $this->entity(); - $this->consumed = ''; - } - return $this->data; - } - - /** - * Consume the next byte - * - * @access private - * @return string|false The next byte, or false, if there is no more data - */ - public function consume() - { - if (isset($this->data[$this->position])) { - $this->consumed .= $this->data[$this->position]; - return $this->data[$this->position++]; - } - - return false; - } - - /** - * Consume a range of characters - * - * @access private - * @param string $chars Characters to consume - * @return string|false A series of characters that match the range, or false - */ - public function consume_range(string $chars) - { - if ($len = strspn($this->data, $chars, $this->position)) { - $data = substr($this->data, $this->position, $len); - $this->consumed .= $data; - $this->position += $len; - return $data; - } - - return false; - } - - /** - * Unconsume one byte - * - * @access private - * @return void - */ - public function unconsume() - { - $this->consumed = substr($this->consumed, 0, -1); - $this->position--; - } - - /** - * Decode an entity - * - * @access private - * @return void - */ - public function entity() - { - switch ($this->consume()) { - case "\x09": - case "\x0A": - case "\x0B": - case "\x0C": - case "\x20": - case "\x3C": - case "\x26": - case false: - break; - - case "\x23": - switch ($this->consume()) { - case "\x78": - case "\x58": - $range = '0123456789ABCDEFabcdef'; - $hex = true; - break; - - default: - $range = '0123456789'; - $hex = false; - $this->unconsume(); - break; - } - - if ($codepoint = $this->consume_range($range)) { - static $windows_1252_specials = [0x0D => "\x0A", 0x80 => "\xE2\x82\xAC", 0x81 => "\xEF\xBF\xBD", 0x82 => "\xE2\x80\x9A", 0x83 => "\xC6\x92", 0x84 => "\xE2\x80\x9E", 0x85 => "\xE2\x80\xA6", 0x86 => "\xE2\x80\xA0", 0x87 => "\xE2\x80\xA1", 0x88 => "\xCB\x86", 0x89 => "\xE2\x80\xB0", 0x8A => "\xC5\xA0", 0x8B => "\xE2\x80\xB9", 0x8C => "\xC5\x92", 0x8D => "\xEF\xBF\xBD", 0x8E => "\xC5\xBD", 0x8F => "\xEF\xBF\xBD", 0x90 => "\xEF\xBF\xBD", 0x91 => "\xE2\x80\x98", 0x92 => "\xE2\x80\x99", 0x93 => "\xE2\x80\x9C", 0x94 => "\xE2\x80\x9D", 0x95 => "\xE2\x80\xA2", 0x96 => "\xE2\x80\x93", 0x97 => "\xE2\x80\x94", 0x98 => "\xCB\x9C", 0x99 => "\xE2\x84\xA2", 0x9A => "\xC5\xA1", 0x9B => "\xE2\x80\xBA", 0x9C => "\xC5\x93", 0x9D => "\xEF\xBF\xBD", 0x9E => "\xC5\xBE", 0x9F => "\xC5\xB8"]; - - if ($hex) { - // Cap to PHP_INT_MAX to ensure consistent behaviour if $codepoint is so large - // it cannot fit into int – just casting float to int might return junk (e.g. a negative number). - // If it is so large, `Misc::codepoint_to_utf8` will just return a replacement character. - $codepoint = (int) min(hexdec($codepoint), \PHP_INT_MAX); - } else { - // Casting string to int caps at PHP_INT_MAX automatically. - $codepoint = (int) $codepoint; - } - - if (isset($windows_1252_specials[$codepoint])) { - $replacement = $windows_1252_specials[$codepoint]; - } else { - $replacement = SimplePie_Misc::codepoint_to_utf8($codepoint); - } - - if (!in_array($this->consume(), [';', false], true)) { - $this->unconsume(); - } - - $consumed_length = strlen($this->consumed); - $this->data = substr_replace($this->data, $replacement, $this->position - $consumed_length, $consumed_length); - $this->position += strlen($replacement) - $consumed_length; - } - break; - - default: - static $entities = [ - 'Aacute' => "\xC3\x81", - 'aacute' => "\xC3\xA1", - 'Aacute;' => "\xC3\x81", - 'aacute;' => "\xC3\xA1", - 'Acirc' => "\xC3\x82", - 'acirc' => "\xC3\xA2", - 'Acirc;' => "\xC3\x82", - 'acirc;' => "\xC3\xA2", - 'acute' => "\xC2\xB4", - 'acute;' => "\xC2\xB4", - 'AElig' => "\xC3\x86", - 'aelig' => "\xC3\xA6", - 'AElig;' => "\xC3\x86", - 'aelig;' => "\xC3\xA6", - 'Agrave' => "\xC3\x80", - 'agrave' => "\xC3\xA0", - 'Agrave;' => "\xC3\x80", - 'agrave;' => "\xC3\xA0", - 'alefsym;' => "\xE2\x84\xB5", - 'Alpha;' => "\xCE\x91", - 'alpha;' => "\xCE\xB1", - 'AMP' => "\x26", - 'amp' => "\x26", - 'AMP;' => "\x26", - 'amp;' => "\x26", - 'and;' => "\xE2\x88\xA7", - 'ang;' => "\xE2\x88\xA0", - 'apos;' => "\x27", - 'Aring' => "\xC3\x85", - 'aring' => "\xC3\xA5", - 'Aring;' => "\xC3\x85", - 'aring;' => "\xC3\xA5", - 'asymp;' => "\xE2\x89\x88", - 'Atilde' => "\xC3\x83", - 'atilde' => "\xC3\xA3", - 'Atilde;' => "\xC3\x83", - 'atilde;' => "\xC3\xA3", - 'Auml' => "\xC3\x84", - 'auml' => "\xC3\xA4", - 'Auml;' => "\xC3\x84", - 'auml;' => "\xC3\xA4", - 'bdquo;' => "\xE2\x80\x9E", - 'Beta;' => "\xCE\x92", - 'beta;' => "\xCE\xB2", - 'brvbar' => "\xC2\xA6", - 'brvbar;' => "\xC2\xA6", - 'bull;' => "\xE2\x80\xA2", - 'cap;' => "\xE2\x88\xA9", - 'Ccedil' => "\xC3\x87", - 'ccedil' => "\xC3\xA7", - 'Ccedil;' => "\xC3\x87", - 'ccedil;' => "\xC3\xA7", - 'cedil' => "\xC2\xB8", - 'cedil;' => "\xC2\xB8", - 'cent' => "\xC2\xA2", - 'cent;' => "\xC2\xA2", - 'Chi;' => "\xCE\xA7", - 'chi;' => "\xCF\x87", - 'circ;' => "\xCB\x86", - 'clubs;' => "\xE2\x99\xA3", - 'cong;' => "\xE2\x89\x85", - 'COPY' => "\xC2\xA9", - 'copy' => "\xC2\xA9", - 'COPY;' => "\xC2\xA9", - 'copy;' => "\xC2\xA9", - 'crarr;' => "\xE2\x86\xB5", - 'cup;' => "\xE2\x88\xAA", - 'curren' => "\xC2\xA4", - 'curren;' => "\xC2\xA4", - 'Dagger;' => "\xE2\x80\xA1", - 'dagger;' => "\xE2\x80\xA0", - 'dArr;' => "\xE2\x87\x93", - 'darr;' => "\xE2\x86\x93", - 'deg' => "\xC2\xB0", - 'deg;' => "\xC2\xB0", - 'Delta;' => "\xCE\x94", - 'delta;' => "\xCE\xB4", - 'diams;' => "\xE2\x99\xA6", - 'divide' => "\xC3\xB7", - 'divide;' => "\xC3\xB7", - 'Eacute' => "\xC3\x89", - 'eacute' => "\xC3\xA9", - 'Eacute;' => "\xC3\x89", - 'eacute;' => "\xC3\xA9", - 'Ecirc' => "\xC3\x8A", - 'ecirc' => "\xC3\xAA", - 'Ecirc;' => "\xC3\x8A", - 'ecirc;' => "\xC3\xAA", - 'Egrave' => "\xC3\x88", - 'egrave' => "\xC3\xA8", - 'Egrave;' => "\xC3\x88", - 'egrave;' => "\xC3\xA8", - 'empty;' => "\xE2\x88\x85", - 'emsp;' => "\xE2\x80\x83", - 'ensp;' => "\xE2\x80\x82", - 'Epsilon;' => "\xCE\x95", - 'epsilon;' => "\xCE\xB5", - 'equiv;' => "\xE2\x89\xA1", - 'Eta;' => "\xCE\x97", - 'eta;' => "\xCE\xB7", - 'ETH' => "\xC3\x90", - 'eth' => "\xC3\xB0", - 'ETH;' => "\xC3\x90", - 'eth;' => "\xC3\xB0", - 'Euml' => "\xC3\x8B", - 'euml' => "\xC3\xAB", - 'Euml;' => "\xC3\x8B", - 'euml;' => "\xC3\xAB", - 'euro;' => "\xE2\x82\xAC", - 'exist;' => "\xE2\x88\x83", - 'fnof;' => "\xC6\x92", - 'forall;' => "\xE2\x88\x80", - 'frac12' => "\xC2\xBD", - 'frac12;' => "\xC2\xBD", - 'frac14' => "\xC2\xBC", - 'frac14;' => "\xC2\xBC", - 'frac34' => "\xC2\xBE", - 'frac34;' => "\xC2\xBE", - 'frasl;' => "\xE2\x81\x84", - 'Gamma;' => "\xCE\x93", - 'gamma;' => "\xCE\xB3", - 'ge;' => "\xE2\x89\xA5", - 'GT' => "\x3E", - 'gt' => "\x3E", - 'GT;' => "\x3E", - 'gt;' => "\x3E", - 'hArr;' => "\xE2\x87\x94", - 'harr;' => "\xE2\x86\x94", - 'hearts;' => "\xE2\x99\xA5", - 'hellip;' => "\xE2\x80\xA6", - 'Iacute' => "\xC3\x8D", - 'iacute' => "\xC3\xAD", - 'Iacute;' => "\xC3\x8D", - 'iacute;' => "\xC3\xAD", - 'Icirc' => "\xC3\x8E", - 'icirc' => "\xC3\xAE", - 'Icirc;' => "\xC3\x8E", - 'icirc;' => "\xC3\xAE", - 'iexcl' => "\xC2\xA1", - 'iexcl;' => "\xC2\xA1", - 'Igrave' => "\xC3\x8C", - 'igrave' => "\xC3\xAC", - 'Igrave;' => "\xC3\x8C", - 'igrave;' => "\xC3\xAC", - 'image;' => "\xE2\x84\x91", - 'infin;' => "\xE2\x88\x9E", - 'int;' => "\xE2\x88\xAB", - 'Iota;' => "\xCE\x99", - 'iota;' => "\xCE\xB9", - 'iquest' => "\xC2\xBF", - 'iquest;' => "\xC2\xBF", - 'isin;' => "\xE2\x88\x88", - 'Iuml' => "\xC3\x8F", - 'iuml' => "\xC3\xAF", - 'Iuml;' => "\xC3\x8F", - 'iuml;' => "\xC3\xAF", - 'Kappa;' => "\xCE\x9A", - 'kappa;' => "\xCE\xBA", - 'Lambda;' => "\xCE\x9B", - 'lambda;' => "\xCE\xBB", - 'lang;' => "\xE3\x80\x88", - 'laquo' => "\xC2\xAB", - 'laquo;' => "\xC2\xAB", - 'lArr;' => "\xE2\x87\x90", - 'larr;' => "\xE2\x86\x90", - 'lceil;' => "\xE2\x8C\x88", - 'ldquo;' => "\xE2\x80\x9C", - 'le;' => "\xE2\x89\xA4", - 'lfloor;' => "\xE2\x8C\x8A", - 'lowast;' => "\xE2\x88\x97", - 'loz;' => "\xE2\x97\x8A", - 'lrm;' => "\xE2\x80\x8E", - 'lsaquo;' => "\xE2\x80\xB9", - 'lsquo;' => "\xE2\x80\x98", - 'LT' => "\x3C", - 'lt' => "\x3C", - 'LT;' => "\x3C", - 'lt;' => "\x3C", - 'macr' => "\xC2\xAF", - 'macr;' => "\xC2\xAF", - 'mdash;' => "\xE2\x80\x94", - 'micro' => "\xC2\xB5", - 'micro;' => "\xC2\xB5", - 'middot' => "\xC2\xB7", - 'middot;' => "\xC2\xB7", - 'minus;' => "\xE2\x88\x92", - 'Mu;' => "\xCE\x9C", - 'mu;' => "\xCE\xBC", - 'nabla;' => "\xE2\x88\x87", - 'nbsp' => "\xC2\xA0", - 'nbsp;' => "\xC2\xA0", - 'ndash;' => "\xE2\x80\x93", - 'ne;' => "\xE2\x89\xA0", - 'ni;' => "\xE2\x88\x8B", - 'not' => "\xC2\xAC", - 'not;' => "\xC2\xAC", - 'notin;' => "\xE2\x88\x89", - 'nsub;' => "\xE2\x8A\x84", - 'Ntilde' => "\xC3\x91", - 'ntilde' => "\xC3\xB1", - 'Ntilde;' => "\xC3\x91", - 'ntilde;' => "\xC3\xB1", - 'Nu;' => "\xCE\x9D", - 'nu;' => "\xCE\xBD", - 'Oacute' => "\xC3\x93", - 'oacute' => "\xC3\xB3", - 'Oacute;' => "\xC3\x93", - 'oacute;' => "\xC3\xB3", - 'Ocirc' => "\xC3\x94", - 'ocirc' => "\xC3\xB4", - 'Ocirc;' => "\xC3\x94", - 'ocirc;' => "\xC3\xB4", - 'OElig;' => "\xC5\x92", - 'oelig;' => "\xC5\x93", - 'Ograve' => "\xC3\x92", - 'ograve' => "\xC3\xB2", - 'Ograve;' => "\xC3\x92", - 'ograve;' => "\xC3\xB2", - 'oline;' => "\xE2\x80\xBE", - 'Omega;' => "\xCE\xA9", - 'omega;' => "\xCF\x89", - 'Omicron;' => "\xCE\x9F", - 'omicron;' => "\xCE\xBF", - 'oplus;' => "\xE2\x8A\x95", - 'or;' => "\xE2\x88\xA8", - 'ordf' => "\xC2\xAA", - 'ordf;' => "\xC2\xAA", - 'ordm' => "\xC2\xBA", - 'ordm;' => "\xC2\xBA", - 'Oslash' => "\xC3\x98", - 'oslash' => "\xC3\xB8", - 'Oslash;' => "\xC3\x98", - 'oslash;' => "\xC3\xB8", - 'Otilde' => "\xC3\x95", - 'otilde' => "\xC3\xB5", - 'Otilde;' => "\xC3\x95", - 'otilde;' => "\xC3\xB5", - 'otimes;' => "\xE2\x8A\x97", - 'Ouml' => "\xC3\x96", - 'ouml' => "\xC3\xB6", - 'Ouml;' => "\xC3\x96", - 'ouml;' => "\xC3\xB6", - 'para' => "\xC2\xB6", - 'para;' => "\xC2\xB6", - 'part;' => "\xE2\x88\x82", - 'permil;' => "\xE2\x80\xB0", - 'perp;' => "\xE2\x8A\xA5", - 'Phi;' => "\xCE\xA6", - 'phi;' => "\xCF\x86", - 'Pi;' => "\xCE\xA0", - 'pi;' => "\xCF\x80", - 'piv;' => "\xCF\x96", - 'plusmn' => "\xC2\xB1", - 'plusmn;' => "\xC2\xB1", - 'pound' => "\xC2\xA3", - 'pound;' => "\xC2\xA3", - 'Prime;' => "\xE2\x80\xB3", - 'prime;' => "\xE2\x80\xB2", - 'prod;' => "\xE2\x88\x8F", - 'prop;' => "\xE2\x88\x9D", - 'Psi;' => "\xCE\xA8", - 'psi;' => "\xCF\x88", - 'QUOT' => "\x22", - 'quot' => "\x22", - 'QUOT;' => "\x22", - 'quot;' => "\x22", - 'radic;' => "\xE2\x88\x9A", - 'rang;' => "\xE3\x80\x89", - 'raquo' => "\xC2\xBB", - 'raquo;' => "\xC2\xBB", - 'rArr;' => "\xE2\x87\x92", - 'rarr;' => "\xE2\x86\x92", - 'rceil;' => "\xE2\x8C\x89", - 'rdquo;' => "\xE2\x80\x9D", - 'real;' => "\xE2\x84\x9C", - 'REG' => "\xC2\xAE", - 'reg' => "\xC2\xAE", - 'REG;' => "\xC2\xAE", - 'reg;' => "\xC2\xAE", - 'rfloor;' => "\xE2\x8C\x8B", - 'Rho;' => "\xCE\xA1", - 'rho;' => "\xCF\x81", - 'rlm;' => "\xE2\x80\x8F", - 'rsaquo;' => "\xE2\x80\xBA", - 'rsquo;' => "\xE2\x80\x99", - 'sbquo;' => "\xE2\x80\x9A", - 'Scaron;' => "\xC5\xA0", - 'scaron;' => "\xC5\xA1", - 'sdot;' => "\xE2\x8B\x85", - 'sect' => "\xC2\xA7", - 'sect;' => "\xC2\xA7", - 'shy' => "\xC2\xAD", - 'shy;' => "\xC2\xAD", - 'Sigma;' => "\xCE\xA3", - 'sigma;' => "\xCF\x83", - 'sigmaf;' => "\xCF\x82", - 'sim;' => "\xE2\x88\xBC", - 'spades;' => "\xE2\x99\xA0", - 'sub;' => "\xE2\x8A\x82", - 'sube;' => "\xE2\x8A\x86", - 'sum;' => "\xE2\x88\x91", - 'sup;' => "\xE2\x8A\x83", - 'sup1' => "\xC2\xB9", - 'sup1;' => "\xC2\xB9", - 'sup2' => "\xC2\xB2", - 'sup2;' => "\xC2\xB2", - 'sup3' => "\xC2\xB3", - 'sup3;' => "\xC2\xB3", - 'supe;' => "\xE2\x8A\x87", - 'szlig' => "\xC3\x9F", - 'szlig;' => "\xC3\x9F", - 'Tau;' => "\xCE\xA4", - 'tau;' => "\xCF\x84", - 'there4;' => "\xE2\x88\xB4", - 'Theta;' => "\xCE\x98", - 'theta;' => "\xCE\xB8", - 'thetasym;' => "\xCF\x91", - 'thinsp;' => "\xE2\x80\x89", - 'THORN' => "\xC3\x9E", - 'thorn' => "\xC3\xBE", - 'THORN;' => "\xC3\x9E", - 'thorn;' => "\xC3\xBE", - 'tilde;' => "\xCB\x9C", - 'times' => "\xC3\x97", - 'times;' => "\xC3\x97", - 'TRADE;' => "\xE2\x84\xA2", - 'trade;' => "\xE2\x84\xA2", - 'Uacute' => "\xC3\x9A", - 'uacute' => "\xC3\xBA", - 'Uacute;' => "\xC3\x9A", - 'uacute;' => "\xC3\xBA", - 'uArr;' => "\xE2\x87\x91", - 'uarr;' => "\xE2\x86\x91", - 'Ucirc' => "\xC3\x9B", - 'ucirc' => "\xC3\xBB", - 'Ucirc;' => "\xC3\x9B", - 'ucirc;' => "\xC3\xBB", - 'Ugrave' => "\xC3\x99", - 'ugrave' => "\xC3\xB9", - 'Ugrave;' => "\xC3\x99", - 'ugrave;' => "\xC3\xB9", - 'uml' => "\xC2\xA8", - 'uml;' => "\xC2\xA8", - 'upsih;' => "\xCF\x92", - 'Upsilon;' => "\xCE\xA5", - 'upsilon;' => "\xCF\x85", - 'Uuml' => "\xC3\x9C", - 'uuml' => "\xC3\xBC", - 'Uuml;' => "\xC3\x9C", - 'uuml;' => "\xC3\xBC", - 'weierp;' => "\xE2\x84\x98", - 'Xi;' => "\xCE\x9E", - 'xi;' => "\xCE\xBE", - 'Yacute' => "\xC3\x9D", - 'yacute' => "\xC3\xBD", - 'Yacute;' => "\xC3\x9D", - 'yacute;' => "\xC3\xBD", - 'yen' => "\xC2\xA5", - 'yen;' => "\xC2\xA5", - 'yuml' => "\xC3\xBF", - 'Yuml;' => "\xC5\xB8", - 'yuml;' => "\xC3\xBF", - 'Zeta;' => "\xCE\x96", - 'zeta;' => "\xCE\xB6", - 'zwj;' => "\xE2\x80\x8D", - 'zwnj;' => "\xE2\x80\x8C" - ]; - - for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++) { - // Cast for PHPStan on PHP < 8.0: We consumed as per the loop condition, - // so `$this->consumed` is non-empty and the substr offset is valid. - $consumed = (string) substr($this->consumed, 1); - if (isset($entities[$consumed])) { - $match = $consumed; - } - } - - if ($match !== null) { - $this->data = substr_replace($this->data, $entities[$match], $this->position - strlen($consumed) - 1, strlen($match) + 1); - $this->position += strlen($entities[$match]) - strlen($consumed) - 1; - } - break; - } - } -} diff --git a/core/vendor/simplepie/simplepie/library/SimplePie/Enclosure.php b/core/vendor/simplepie/simplepie/library/SimplePie/Enclosure.php deleted file mode 100644 index dd3740ddb8..0000000000 --- a/core/vendor/simplepie/simplepie/library/SimplePie/Enclosure.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - class SimplePie_HTTP_Parser extends Parser - { - } -} diff --git a/core/vendor/simplepie/simplepie/library/SimplePie/IRI.php b/core/vendor/simplepie/simplepie/library/SimplePie/IRI.php deleted file mode 100644 index 7b1e81e2ae..0000000000 --- a/core/vendor/simplepie/simplepie/library/SimplePie/IRI.php +++ /dev/null @@ -1,20 +0,0 @@ -, string given\.$)' - - count: 3 - path: tests/Unit/Cache/Psr16Test.php - # Only occurs on PHP ≤ 7.4 - reportUnmatched: false - - - - message: '(^Parameter \$parser of method SimplePie\\Parser::(tag_open|cdata|tag_close)\(\) has invalid type XMLParser\.$)' - - count: 3 - path: src/Parser.php - # Only occurs on PHP ≤ 7.4 - reportUnmatched: false - - # PHPStan stubs bug https://github.com/phpstan/phpstan/issues/8629 - - - message: '(^Access to an undefined property XMLReader::\$\w+\.$)' - # Only occurs on PHP ≥ 8.2 - reportUnmatched: false - -includes: - - utils/PHPStan/extension.neon diff --git a/core/vendor/simplepie/simplepie/src/Author.php b/core/vendor/simplepie/simplepie/src/Author.php deleted file mode 100644 index 1ac55589f7..0000000000 --- a/core/vendor/simplepie/simplepie/src/Author.php +++ /dev/null @@ -1,110 +0,0 @@ -name = $name; - $this->link = $link; - $this->email = $email; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Author's name - * - * @return string|null - */ - public function get_name() - { - if ($this->name !== null) { - return $this->name; - } - - return null; - } - - /** - * Author's link - * - * @return string|null - */ - public function get_link() - { - if ($this->link !== null) { - return $this->link; - } - - return null; - } - - /** - * Author's email address - * - * @return string|null - */ - public function get_email() - { - if ($this->email !== null) { - return $this->email; - } - - return null; - } -} - -class_alias('SimplePie\Author', 'SimplePie_Author'); diff --git a/core/vendor/simplepie/simplepie/src/Cache.php b/core/vendor/simplepie/simplepie/src/Cache.php deleted file mode 100644 index 587fb1522e..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache.php +++ /dev/null @@ -1,114 +0,0 @@ -> - */ - protected static $handlers = [ - 'mysql' => Cache\MySQL::class, - 'memcache' => Cache\Memcache::class, - 'memcached' => Cache\Memcached::class, - 'redis' => Cache\Redis::class, - ]; - - /** - * Don't call the constructor. Please. - */ - private function __construct() - { - } - - /** - * Create a new SimplePie\Cache object - * - * @param string $location URL location (scheme is used to determine handler) - * @param string $filename Unique identifier for cache object - * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension 'spi' or 'spc' - * @return Base Type of object depends on scheme of `$location` - */ - public static function get_handler(string $location, string $filename, $extension) - { - $type = explode(':', $location, 2); - $type = $type[0]; - if (!empty(self::$handlers[$type])) { - $class = self::$handlers[$type]; - return new $class($location, $filename, $extension); - } - - return new \SimplePie\Cache\File($location, $filename, $extension); - } - - /** - * Create a new SimplePie\Cache object - * - * @deprecated since SimplePie 1.3.1, use {@see get_handler()} instead - * @param string $location - * @param string $filename - * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension - * @return Base - */ - public function create(string $location, string $filename, $extension) - { - trigger_error('Cache::create() has been replaced with Cache::get_handler() since SimplePie 1.3.1, use the registry system instead.', \E_USER_DEPRECATED); - - return self::get_handler($location, $filename, $extension); - } - - /** - * Register a handler - * - * @param string $type DSN type to register for - * @param class-string $class Name of handler class. Must implement Base - * @return void - */ - public static function register(string $type, $class) - { - self::$handlers[$type] = $class; - } - - /** - * Parse a URL into an array - * - * @param string $url - * @return array - */ - public static function parse_URL(string $url) - { - $parsedUrl = parse_url($url); - - if ($parsedUrl === false) { - return []; - } - - $params = array_merge($parsedUrl, ['extras' => []]); - if (isset($params['query'])) { - parse_str($params['query'], $params['extras']); - } - return $params; - } -} - -class_alias('SimplePie\Cache', 'SimplePie_Cache'); diff --git a/core/vendor/simplepie/simplepie/src/Cache/Base.php b/core/vendor/simplepie/simplepie/src/Cache/Base.php deleted file mode 100644 index 7d6747a0bd..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/Base.php +++ /dev/null @@ -1,80 +0,0 @@ -|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property - * @return bool Successfulness - */ - public function save($data); - - /** - * Retrieve the data saved to the cache - * - * @return array Data for SimplePie::$data - */ - public function load(); - - /** - * Retrieve the last modified time for the cache - * - * @return int Timestamp - */ - public function mtime(); - - /** - * Set the last modified time to the current time - * - * @return bool Success status - */ - public function touch(); - - /** - * Remove the cache - * - * @return bool Success status - */ - public function unlink(); -} - -class_alias('SimplePie\Cache\Base', 'SimplePie_Cache_Base'); diff --git a/core/vendor/simplepie/simplepie/src/Cache/BaseDataCache.php b/core/vendor/simplepie/simplepie/src/Cache/BaseDataCache.php deleted file mode 100644 index 60207b0750..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/BaseDataCache.php +++ /dev/null @@ -1,119 +0,0 @@ -cache = $cache; - } - - /** - * Fetches a value from the cache. - * - * Equivalent to \Psr\SimpleCache\CacheInterface::get() - * - * public function get(string $key, mixed $default = null): mixed; - * - * - * @param string $key The unique key of this item in the cache. - * @param mixed $default Default value to return if the key does not exist. - * - * @return array|mixed The value of the item from the cache, or $default in case of cache miss. - * - * @throws InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function get_data(string $key, $default = null) - { - $data = $this->cache->load(); - - if (!is_array($data)) { - return $default; - } - - // ignore data if internal cache expiration time is not set - if (!array_key_exists('__cache_expiration_time', $data)) { - return $default; - } - - // ignore data if internal cache expiration time is expired - if ($data['__cache_expiration_time'] < time()) { - return $default; - } - - // remove internal cache expiration time - unset($data['__cache_expiration_time']); - - return $data; - } - - /** - * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. - * - * Equivalent to \Psr\SimpleCache\CacheInterface::set() - * - * public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool; - * - * - * @param string $key The key of the item to store. - * @param array $value The value of the item to store, must be serializable. - * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and - * the driver supports TTL then the library may set a default value - * for it or let the driver take care of that. - * - * @return bool True on success and false on failure. - * - * @throws InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function set_data(string $key, array $value, ?int $ttl = null): bool - { - if ($ttl === null) { - $ttl = 3600; - } - - // place internal cache expiration time - $value['__cache_expiration_time'] = time() + $ttl; - - return $this->cache->save($value); - } - - /** - * Delete an item from the cache by its unique key. - * - * Equivalent to \Psr\SimpleCache\CacheInterface::delete() - * - * public function delete(string $key): bool; - * - * - * @param string $key The unique cache key of the item to delete. - * - * @return bool True if the item was successfully removed. False if there was an error. - * - * @throws InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function delete_data(string $key): bool - { - return $this->cache->unlink(); - } -} diff --git a/core/vendor/simplepie/simplepie/src/Cache/CallableNameFilter.php b/core/vendor/simplepie/simplepie/src/Cache/CallableNameFilter.php deleted file mode 100644 index e95fa29175..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/CallableNameFilter.php +++ /dev/null @@ -1,53 +0,0 @@ -callable = $callable; - } - - /** - * Method to create cache filename with. - * - * The returning name MUST follow the rules for keys in PSR-16. - * - * @link https://www.php-fig.org/psr/psr-16/ - * - * The returning name MUST be a string of at least one character - * that uniquely identifies a cached item, MUST only contain the - * characters A-Z, a-z, 0-9, _, and . in any order in UTF-8 encoding - * and MUST not longer then 64 characters. The following characters - * are reserved for future extensions and MUST NOT be used: {}()/\@: - * - * A provided implementing library MAY support additional characters - * and encodings or longer lengths, but MUST support at least that - * minimum. - * - * @param string $name The name for the cache will be most likely an url with query string - * - * @return string the new cache name - */ - public function filter(string $name): string - { - return call_user_func($this->callable, $name); - } -} diff --git a/core/vendor/simplepie/simplepie/src/Cache/DB.php b/core/vendor/simplepie/simplepie/src/Cache/DB.php deleted file mode 100644 index 5dac94f407..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/DB.php +++ /dev/null @@ -1,84 +0,0 @@ -} First item is the serialized data for storage, second item is the unique ID for this item - */ - protected static function prepare_simplepie_object_for_cache(\SimplePie\SimplePie $data) - { - $items = $data->get_items(); - $items_by_id = []; - - if (!empty($items)) { - foreach ($items as $item) { - $items_by_id[$item->get_id()] = $item; - } - - if (count($items_by_id) !== count($items)) { - $items_by_id = []; - foreach ($items as $item) { - $items_by_id[$item->get_id(true)] = $item; - } - } - - if (isset($data->data['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['feed'][0])) { - $channel = &$data->data['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['feed'][0]; - } elseif (isset($data->data['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['feed'][0])) { - $channel = &$data->data['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['feed'][0]; - } elseif (isset($data->data['child'][\SimplePie\SimplePie::NAMESPACE_RDF]['RDF'][0])) { - $channel = &$data->data['child'][\SimplePie\SimplePie::NAMESPACE_RDF]['RDF'][0]; - } elseif (isset($data->data['child'][\SimplePie\SimplePie::NAMESPACE_RSS_20]['rss'][0]['child'][\SimplePie\SimplePie::NAMESPACE_RSS_20]['channel'][0])) { - $channel = &$data->data['child'][\SimplePie\SimplePie::NAMESPACE_RSS_20]['rss'][0]['child'][\SimplePie\SimplePie::NAMESPACE_RSS_20]['channel'][0]; - } else { - $channel = null; - } - - if ($channel !== null) { - if (isset($channel['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['entry'])) { - unset($channel['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['entry']); - } - if (isset($channel['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['entry'])) { - unset($channel['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['entry']); - } - if (isset($channel['child'][\SimplePie\SimplePie::NAMESPACE_RSS_10]['item'])) { - unset($channel['child'][\SimplePie\SimplePie::NAMESPACE_RSS_10]['item']); - } - if (isset($channel['child'][\SimplePie\SimplePie::NAMESPACE_RSS_090]['item'])) { - unset($channel['child'][\SimplePie\SimplePie::NAMESPACE_RSS_090]['item']); - } - if (isset($channel['child'][\SimplePie\SimplePie::NAMESPACE_RSS_20]['item'])) { - unset($channel['child'][\SimplePie\SimplePie::NAMESPACE_RSS_20]['item']); - } - } - if (isset($data->data['items'])) { - unset($data->data['items']); - } - if (isset($data->data['ordered_items'])) { - unset($data->data['ordered_items']); - } - } - return [serialize($data->data), $items_by_id]; - } -} - -class_alias('SimplePie\Cache\DB', 'SimplePie_Cache_DB'); diff --git a/core/vendor/simplepie/simplepie/src/Cache/DataCache.php b/core/vendor/simplepie/simplepie/src/Cache/DataCache.php deleted file mode 100644 index 02ec59e9c7..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/DataCache.php +++ /dev/null @@ -1,80 +0,0 @@ - - * public function get(string $key, mixed $default = null): mixed; - * - * - * @param string $key The unique key of this item in the cache. - * @param mixed $default Default value to return if the key does not exist. - * - * @return array|mixed The value of the item from the cache, or $default in case of cache miss. - * - * @throws InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function get_data(string $key, $default = null); - - /** - * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. - * - * Equivalent to \Psr\SimpleCache\CacheInterface::set() - * - * public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool; - * - * - * @param string $key The key of the item to store. - * @param array $value The value of the item to store, must be serializable. - * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and - * the driver supports TTL then the library may set a default value - * for it or let the driver take care of that. - * - * @return bool True on success and false on failure. - * - * @throws InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function set_data(string $key, array $value, ?int $ttl = null): bool; - - /** - * Delete an item from the cache by its unique key. - * - * Equivalent to \Psr\SimpleCache\CacheInterface::delete() - * - * public function delete(string $key): bool; - * - * - * @param string $key The unique cache key of the item to delete. - * - * @return bool True if the item was successfully removed. False if there was an error. - * - * @throws InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function delete_data(string $key): bool; -} diff --git a/core/vendor/simplepie/simplepie/src/Cache/File.php b/core/vendor/simplepie/simplepie/src/Cache/File.php deleted file mode 100644 index 110a77c43e..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/File.php +++ /dev/null @@ -1,127 +0,0 @@ -location = $location; - $this->filename = $name; - $this->extension = $type; - $this->name = "$this->location/$this->filename.$this->extension"; - } - - /** - * Save data to the cache - * - * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property - * @return bool Successfulness - */ - public function save($data) - { - if (file_exists($this->name) && is_writable($this->name) || file_exists($this->location) && is_writable($this->location)) { - if ($data instanceof \SimplePie\SimplePie) { - $data = $data->data; - } - - $data = serialize($data); - return (bool) file_put_contents($this->name, $data); - } - return false; - } - - /** - * Retrieve the data saved to the cache - * - * @return array|false Data for SimplePie::$data - */ - public function load() - { - if (file_exists($this->name) && is_readable($this->name)) { - return unserialize((string) file_get_contents($this->name)); - } - return false; - } - - /** - * Retrieve the last modified time for the cache - * - * @return int|false Timestamp - */ - public function mtime() - { - return @filemtime($this->name); - } - - /** - * Set the last modified time to the current time - * - * @return bool Success status - */ - public function touch() - { - return @touch($this->name); - } - - /** - * Remove the cache - * - * @return bool Success status - */ - public function unlink() - { - if (file_exists($this->name)) { - return unlink($this->name); - } - return false; - } -} - -class_alias('SimplePie\Cache\File', 'SimplePie_Cache_File'); diff --git a/core/vendor/simplepie/simplepie/src/Cache/Memcache.php b/core/vendor/simplepie/simplepie/src/Cache/Memcache.php deleted file mode 100644 index 261bb5d484..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/Memcache.php +++ /dev/null @@ -1,145 +0,0 @@ - - */ - protected $options; - - /** - * Cache name - * - * @var string - */ - protected $name; - - /** - * Create a new cache object - * - * @param string $location Location string (from SimplePie::$cache_location) - * @param string $name Unique ID for the cache - * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data - */ - public function __construct(string $location, string $name, $type) - { - $this->options = [ - 'host' => '127.0.0.1', - 'port' => 11211, - 'extras' => [ - 'timeout' => 3600, // one hour - 'prefix' => 'simplepie_', - ], - ]; - $this->options = array_replace_recursive($this->options, \SimplePie\Cache::parse_URL($location)); - - $this->name = $this->options['extras']['prefix'] . md5("$name:$type"); - - $this->cache = new NativeMemcache(); - $this->cache->addServer($this->options['host'], (int) $this->options['port']); - } - - /** - * Save data to the cache - * - * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property - * @return bool Successfulness - */ - public function save($data) - { - if ($data instanceof \SimplePie\SimplePie) { - $data = $data->data; - } - return $this->cache->set($this->name, serialize($data), MEMCACHE_COMPRESSED, (int) $this->options['extras']['timeout']); - } - - /** - * Retrieve the data saved to the cache - * - * @return array|false Data for SimplePie::$data - */ - public function load() - { - $data = $this->cache->get($this->name); - - if ($data !== false) { - return unserialize($data); - } - return false; - } - - /** - * Retrieve the last modified time for the cache - * - * @return int|false Timestamp - */ - public function mtime() - { - $data = $this->cache->get($this->name); - - if ($data !== false) { - // essentially ignore the mtime because Memcache expires on its own - return time(); - } - - return false; - } - - /** - * Set the last modified time to the current time - * - * @return bool Success status - */ - public function touch() - { - $data = $this->cache->get($this->name); - - if ($data !== false) { - return $this->cache->set($this->name, $data, MEMCACHE_COMPRESSED, (int) $this->options['extras']['timeout']); - } - - return false; - } - - /** - * Remove the cache - * - * @return bool Success status - */ - public function unlink() - { - return $this->cache->delete($this->name, 0); - } -} - -class_alias('SimplePie\Cache\Memcache', 'SimplePie_Cache_Memcache'); diff --git a/core/vendor/simplepie/simplepie/src/Cache/Memcached.php b/core/vendor/simplepie/simplepie/src/Cache/Memcached.php deleted file mode 100644 index 924f31fca5..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/Memcached.php +++ /dev/null @@ -1,142 +0,0 @@ - - */ - protected $options; - - /** - * Cache name - * @var string - */ - protected $name; - - /** - * Create a new cache object - * @param string $location Location string (from SimplePie::$cache_location) - * @param string $name Unique ID for the cache - * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data - */ - public function __construct(string $location, string $name, $type) - { - $this->options = [ - 'host' => '127.0.0.1', - 'port' => 11211, - 'extras' => [ - 'timeout' => 3600, // one hour - 'prefix' => 'simplepie_', - ], - ]; - $this->options = array_replace_recursive($this->options, \SimplePie\Cache::parse_URL($location)); - - $this->name = $this->options['extras']['prefix'] . md5("$name:$type"); - - $this->cache = new NativeMemcached(); - $this->cache->addServer($this->options['host'], (int)$this->options['port']); - } - - /** - * Save data to the cache - * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property - * @return bool Successfulness - */ - public function save($data) - { - if ($data instanceof \SimplePie\SimplePie) { - $data = $data->data; - } - - return $this->setData(serialize($data)); - } - - /** - * Retrieve the data saved to the cache - * @return array|false Data for SimplePie::$data - */ - public function load() - { - $data = $this->cache->get($this->name); - - if ($data !== false) { - return unserialize($data); - } - return false; - } - - /** - * Retrieve the last modified time for the cache - * @return int Timestamp - */ - public function mtime() - { - $data = $this->cache->get($this->name . '_mtime'); - return (int) $data; - } - - /** - * Set the last modified time to the current time - * @return bool Success status - */ - public function touch() - { - $data = $this->cache->get($this->name); - return $this->setData($data); - } - - /** - * Remove the cache - * @return bool Success status - */ - public function unlink() - { - return $this->cache->delete($this->name, 0); - } - - /** - * Set the last modified time and data to NativeMemcached - * @param string|false $data - * @return bool Success status - */ - private function setData($data): bool - { - if ($data !== false) { - $this->cache->set($this->name . '_mtime', time(), (int)$this->options['extras']['timeout']); - return $this->cache->set($this->name, $data, (int)$this->options['extras']['timeout']); - } - - return false; - } -} - -class_alias('SimplePie\Cache\Memcached', 'SimplePie_Cache_Memcached'); diff --git a/core/vendor/simplepie/simplepie/src/Cache/MySQL.php b/core/vendor/simplepie/simplepie/src/Cache/MySQL.php deleted file mode 100644 index 73699ad75f..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/MySQL.php +++ /dev/null @@ -1,344 +0,0 @@ - - */ - protected $options; - - /** - * Cache ID - * - * @var string - */ - protected $id; - - /** - * Create a new cache object - * - * @param string $location Location string (from SimplePie::$cache_location) - * @param string $name Unique ID for the cache - * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data - */ - public function __construct(string $location, string $name, $type) - { - $this->options = [ - 'user' => null, - 'pass' => null, - 'host' => '127.0.0.1', - 'port' => '3306', - 'path' => '', - 'extras' => [ - 'prefix' => '', - 'cache_purge_time' => 2592000 - ], - ]; - - $this->options = array_replace_recursive($this->options, \SimplePie\Cache::parse_URL($location)); - - // Path is prefixed with a "/" - $this->options['dbname'] = substr($this->options['path'], 1); - - try { - $this->mysql = new \PDO("mysql:dbname={$this->options['dbname']};host={$this->options['host']};port={$this->options['port']}", $this->options['user'], $this->options['pass'], [\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8']); - } catch (\PDOException $e) { - $this->mysql = null; - return; - } - - $this->id = $name . $type; - - if (!$query = $this->mysql->query('SHOW TABLES')) { - $this->mysql = null; - return; - } - - $db = []; - while ($row = $query->fetchColumn()) { - $db[] = $row; - } - - if (!in_array($this->options['extras']['prefix'] . 'cache_data', $db)) { - $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))'); - if ($query === false) { - trigger_error("Can't create " . $this->options['extras']['prefix'] . "cache_data table, check permissions", \E_USER_WARNING); - $this->mysql = null; - return; - } - } - - if (!in_array($this->options['extras']['prefix'] . 'items', $db)) { - $query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` MEDIUMBLOB NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))'); - if ($query === false) { - trigger_error("Can't create " . $this->options['extras']['prefix'] . "items table, check permissions", \E_USER_WARNING); - $this->mysql = null; - return; - } - } - } - - /** - * Save data to the cache - * - * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property - * @return bool Successfulness - */ - public function save($data) - { - if ($this->mysql === null) { - return false; - } - - $query = $this->mysql->prepare('DELETE i, cd FROM `' . $this->options['extras']['prefix'] . 'cache_data` cd, ' . - '`' . $this->options['extras']['prefix'] . 'items` i ' . - 'WHERE cd.id = i.feed_id ' . - 'AND cd.mtime < (unix_timestamp() - :purge_time)'); - $query->bindValue(':purge_time', $this->options['extras']['cache_purge_time']); - - if (!$query->execute()) { - return false; - } - - if ($data instanceof \SimplePie\SimplePie) { - $data = clone $data; - - $prepared = self::prepare_simplepie_object_for_cache($data); - - $query = $this->mysql->prepare('SELECT COUNT(*) FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed'); - $query->bindValue(':feed', $this->id); - if ($query->execute()) { - if ($query->fetchColumn() > 0) { - $items = count($prepared[1]); - if ($items) { - $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = :items, `data` = :data, `mtime` = :time WHERE `id` = :feed'; - $query = $this->mysql->prepare($sql); - $query->bindValue(':items', $items); - } else { - $sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `data` = :data, `mtime` = :time WHERE `id` = :feed'; - $query = $this->mysql->prepare($sql); - } - - $query->bindValue(':data', $prepared[0]); - $query->bindValue(':time', time()); - $query->bindValue(':feed', $this->id); - if (!$query->execute()) { - return false; - } - } else { - $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:feed, :count, :data, :time)'); - $query->bindValue(':feed', $this->id); - $query->bindValue(':count', count($prepared[1])); - $query->bindValue(':data', $prepared[0]); - $query->bindValue(':time', time()); - if (!$query->execute()) { - return false; - } - } - - $ids = array_keys($prepared[1]); - if (!empty($ids)) { - foreach ($ids as $id) { - $database_ids[] = $this->mysql->quote($id); - } - - $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `id` = ' . implode(' OR `id` = ', $database_ids) . ' AND `feed_id` = :feed'); - $query->bindValue(':feed', $this->id); - - if ($query->execute()) { - $existing_ids = []; - while ($row = $query->fetchColumn()) { - $existing_ids[] = $row; - } - - $new_ids = array_diff($ids, $existing_ids); - - foreach ($new_ids as $new_id) { - if (!($date = $prepared[1][$new_id]->get_date('U'))) { - $date = time(); - } - - $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(:feed, :id, :data, :date)'); - $query->bindValue(':feed', $this->id); - $query->bindValue(':id', $new_id); - $query->bindValue(':data', serialize($prepared[1][$new_id]->data)); - $query->bindValue(':date', $date); - if (!$query->execute()) { - return false; - } - } - return true; - } - } else { - return true; - } - } - } else { - $query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed'); - $query->bindValue(':feed', $this->id); - if ($query->execute()) { - if ($query->rowCount() > 0) { - $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = 0, `data` = :data, `mtime` = :time WHERE `id` = :feed'); - $query->bindValue(':data', serialize($data)); - $query->bindValue(':time', time()); - $query->bindValue(':feed', $this->id); - if ($query->execute()) { - return true; - } - } else { - $query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:id, 0, :data, :time)'); - $query->bindValue(':id', $this->id); - $query->bindValue(':data', serialize($data)); - $query->bindValue(':time', time()); - if ($query->execute()) { - return true; - } - } - } - } - return false; - } - - /** - * Retrieve the data saved to the cache - * - * @return array|false Data for SimplePie::$data - */ - public function load() - { - if ($this->mysql === null) { - return false; - } - - $query = $this->mysql->prepare('SELECT `items`, `data` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); - $query->bindValue(':id', $this->id); - if ($query->execute() && ($row = $query->fetch())) { - $data = unserialize($row[1]); - - if (isset($this->options['items'][0])) { - $items = (int) $this->options['items'][0]; - } else { - $items = (int) $row[0]; - } - - if ($items !== 0) { - if (isset($data['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['feed'][0])) { - $feed = &$data['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['feed'][0]; - } elseif (isset($data['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['feed'][0])) { - $feed = &$data['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['feed'][0]; - } elseif (isset($data['child'][\SimplePie\SimplePie::NAMESPACE_RDF]['RDF'][0])) { - $feed = &$data['child'][\SimplePie\SimplePie::NAMESPACE_RDF]['RDF'][0]; - } elseif (isset($data['child'][\SimplePie\SimplePie::NAMESPACE_RSS_20]['rss'][0])) { - $feed = &$data['child'][\SimplePie\SimplePie::NAMESPACE_RSS_20]['rss'][0]; - } else { - $feed = null; - } - - if ($feed !== null) { - $sql = 'SELECT `data` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC'; - if ($items > 0) { - $sql .= ' LIMIT ' . $items; - } - - $query = $this->mysql->prepare($sql); - $query->bindValue(':feed', $this->id); - if ($query->execute()) { - while ($row = $query->fetchColumn()) { - $feed['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['entry'][] = unserialize((string) $row); - } - } else { - return false; - } - } - } - return $data; - } - return false; - } - - /** - * Retrieve the last modified time for the cache - * - * @return int|false Timestamp - */ - public function mtime() - { - if ($this->mysql === null) { - return false; - } - - $query = $this->mysql->prepare('SELECT `mtime` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); - $query->bindValue(':id', $this->id); - if ($query->execute() && ($time = $query->fetchColumn())) { - return (int) $time; - } - - return false; - } - - /** - * Set the last modified time to the current time - * - * @return bool Success status - */ - public function touch() - { - if ($this->mysql === null) { - return false; - } - - $query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `mtime` = :time WHERE `id` = :id'); - $query->bindValue(':time', time()); - $query->bindValue(':id', $this->id); - - return $query->execute() && $query->rowCount() > 0; - } - - /** - * Remove the cache - * - * @return bool Success status - */ - public function unlink() - { - if ($this->mysql === null) { - return false; - } - - $query = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id'); - $query->bindValue(':id', $this->id); - $query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id'); - $query2->bindValue(':id', $this->id); - - return $query->execute() && $query2->execute(); - } -} - -class_alias('SimplePie\Cache\MySQL', 'SimplePie_Cache_MySQL'); diff --git a/core/vendor/simplepie/simplepie/src/Cache/NameFilter.php b/core/vendor/simplepie/simplepie/src/Cache/NameFilter.php deleted file mode 100644 index 9babb41f96..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/NameFilter.php +++ /dev/null @@ -1,37 +0,0 @@ -cache = $cache; - } - - /** - * Fetches a value from the cache. - * - * Equivalent to \Psr\SimpleCache\CacheInterface::get() - * - * public function get(string $key, mixed $default = null): mixed; - * - * - * @param string $key The unique key of this item in the cache. - * @param mixed $default Default value to return if the key does not exist. - * - * @return array|mixed The value of the item from the cache, or $default in case of cache miss. - * - * @throws InvalidArgumentException&Throwable - * MUST be thrown if the $key string is not a legal value. - */ - public function get_data(string $key, $default = null) - { - $data = $this->cache->get($key, $default); - - if (!is_array($data) || $data === $default) { - return $default; - } - - return $data; - } - - /** - * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. - * - * Equivalent to \Psr\SimpleCache\CacheInterface::set() - * - * public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool; - * - * - * @param string $key The key of the item to store. - * @param array $value The value of the item to store, must be serializable. - * @param null|int $ttl Optional. The TTL value of this item. If no value is sent and - * the driver supports TTL then the library may set a default value - * for it or let the driver take care of that. - * - * @return bool True on success and false on failure. - * - * @throws InvalidArgumentException&Throwable - * MUST be thrown if the $key string is not a legal value. - */ - public function set_data(string $key, array $value, ?int $ttl = null): bool - { - return $this->cache->set($key, $value, $ttl); - } - - /** - * Delete an item from the cache by its unique key. - * - * Equivalent to \Psr\SimpleCache\CacheInterface::delete() - * - * public function delete(string $key): bool; - * - * - * @param string $key The unique cache key of the item to delete. - * - * @return bool True if the item was successfully removed. False if there was an error. - * - * @throws InvalidArgumentException&Throwable - * MUST be thrown if the $key string is not a legal value. - */ - public function delete_data(string $key): bool - { - return $this->cache->delete($key); - } -} diff --git a/core/vendor/simplepie/simplepie/src/Cache/Redis.php b/core/vendor/simplepie/simplepie/src/Cache/Redis.php deleted file mode 100644 index 3ba0a3ed59..0000000000 --- a/core/vendor/simplepie/simplepie/src/Cache/Redis.php +++ /dev/null @@ -1,171 +0,0 @@ - -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie\Cache; - -use Redis as NativeRedis; - -/** - * Caches data to redis - * - * Registered for URLs with the "redis" protocol - * - * For example, `redis://localhost:6379/?timeout=3600&prefix=sp_&dbIndex=0` will - * connect to redis on `localhost` on port 6379. All tables will be - * prefixed with `simple_primary-` and data will expire after 3600 seconds - * - * @uses Redis - * @deprecated since SimplePie 1.8.0, use implementation of "Psr\SimpleCache\CacheInterface" instead - */ -class Redis implements Base -{ - /** - * Redis instance - * - * @var NativeRedis - */ - protected $cache; - - /** - * Options - * - * @var array - */ - protected $options; - - /** - * Cache name - * - * @var string - */ - protected $name; - - /** - * Create a new cache object - * - * @param string $location Location string (from SimplePie::$cache_location) - * @param string $name Unique ID for the cache - * @param Base::TYPE_FEED|Base::TYPE_IMAGE|array|null $options Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data - */ - public function __construct(string $location, string $name, $options = null) - { - //$this->cache = \flow\simple\cache\Redis::getRedisClientInstance(); - $parsed = \SimplePie\Cache::parse_URL($location); - $redis = new NativeRedis(); - $redis->connect($parsed['host'], $parsed['port']); - if (isset($parsed['pass'])) { - $redis->auth($parsed['pass']); - } - if (isset($parsed['path'])) { - $redis->select((int)substr($parsed['path'], 1)); - } - $this->cache = $redis; - - if (!is_null($options) && is_array($options)) { - $this->options = $options; - } else { - $this->options = [ - 'prefix' => 'rss:simple_primary:', - 'expire' => 0, - ]; - } - - $this->name = $this->options['prefix'] . $name; - } - - /** - * @param NativeRedis $cache - * @return void - */ - public function setRedisClient(NativeRedis $cache) - { - $this->cache = $cache; - } - - /** - * Save data to the cache - * - * @param array|\SimplePie\SimplePie $data Data to store in the cache. If passed a SimplePie object, only cache the $data property - * @return bool Successfulness - */ - public function save($data) - { - if ($data instanceof \SimplePie\SimplePie) { - $data = $data->data; - } - $response = $this->cache->set($this->name, serialize($data)); - if ($this->options['expire']) { - $this->cache->expire($this->name, $this->options['expire']); - } - - return $response; - } - - /** - * Retrieve the data saved to the cache - * - * @return array|false Data for SimplePie::$data - */ - public function load() - { - $data = $this->cache->get($this->name); - - if ($data !== false) { - return unserialize($data); - } - return false; - } - - /** - * Retrieve the last modified time for the cache - * - * @return int|false Timestamp - */ - public function mtime() - { - $data = $this->cache->get($this->name); - - if ($data !== false) { - return time(); - } - - return false; - } - - /** - * Set the last modified time to the current time - * - * @return bool Success status - */ - public function touch() - { - $data = $this->cache->get($this->name); - - if ($data !== false) { - $return = $this->cache->set($this->name, $data); - if ($this->options['expire']) { - return $this->cache->expire($this->name, $this->options['expire']); - } - return $return; - } - - return false; - } - - /** - * Remove the cache - * - * @return bool Success status - */ - public function unlink() - { - return $this->cache->set($this->name, null); - } -} - -class_alias('SimplePie\Cache\Redis', 'SimplePie_Cache_Redis'); diff --git a/core/vendor/simplepie/simplepie/src/Caption.php b/core/vendor/simplepie/simplepie/src/Caption.php deleted file mode 100644 index 0c25fa5ce1..0000000000 --- a/core/vendor/simplepie/simplepie/src/Caption.php +++ /dev/null @@ -1,162 +0,0 @@ -` captions as defined in Media RSS. - * - * Used by {@see \SimplePie\Enclosure::get_caption()} and {@see \SimplePie\Enclosure::get_captions()} - * - * This class can be overloaded with {@see \SimplePie\SimplePie::set_caption_class()} - */ -class Caption -{ - /** - * Content type - * - * @var ?string - * @see get_type() - */ - public $type; - - /** - * Language - * - * @var ?string - * @see get_language() - */ - public $lang; - - /** - * Start time - * - * @var ?string - * @see get_starttime() - */ - public $startTime; - - /** - * End time - * - * @var ?string - * @see get_endtime() - */ - public $endTime; - - /** - * Caption text - * - * @var ?string - * @see get_text() - */ - public $text; - - /** - * Constructor, used to input the data - * - * For documentation on all the parameters, see the corresponding - * properties and their accessors - */ - public function __construct( - ?string $type = null, - ?string $lang = null, - ?string $startTime = null, - ?string $endTime = null, - ?string $text = null - ) { - $this->type = $type; - $this->lang = $lang; - $this->startTime = $startTime; - $this->endTime = $endTime; - $this->text = $text; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Get the end time - * - * @return string|null Time in the format 'hh:mm:ss.SSS' - */ - public function get_endtime() - { - if ($this->endTime !== null) { - return $this->endTime; - } - - return null; - } - - /** - * Get the language - * - * @link http://tools.ietf.org/html/rfc3066 - * @return string|null Language code as per RFC 3066 - */ - public function get_language() - { - if ($this->lang !== null) { - return $this->lang; - } - - return null; - } - - /** - * Get the start time - * - * @return string|null Time in the format 'hh:mm:ss.SSS' - */ - public function get_starttime() - { - if ($this->startTime !== null) { - return $this->startTime; - } - - return null; - } - - /** - * Get the text of the caption - * - * @return string|null - */ - public function get_text() - { - if ($this->text !== null) { - return $this->text; - } - - return null; - } - - /** - * Get the content type (not MIME type) - * - * @return string|null Either 'text' or 'html' - */ - public function get_type() - { - if ($this->type !== null) { - return $this->type; - } - - return null; - } -} - -class_alias('SimplePie\Caption', 'SimplePie_Caption'); diff --git a/core/vendor/simplepie/simplepie/src/Category.php b/core/vendor/simplepie/simplepie/src/Category.php deleted file mode 100644 index 5439ef4415..0000000000 --- a/core/vendor/simplepie/simplepie/src/Category.php +++ /dev/null @@ -1,126 +0,0 @@ - - * subject for - * - * @var string|null - * @see get_type() - */ - public $type; - - /** - * Constructor, used to input the data - * - * @param string|null $term - * @param string|null $scheme - * @param string|null $label - * @param string|null $type - */ - public function __construct(?string $term = null, ?string $scheme = null, ?string $label = null, ?string $type = null) - { - $this->term = $term; - $this->scheme = $scheme; - $this->label = $label; - $this->type = $type; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Get the category identifier - * - * @return string|null - */ - public function get_term() - { - return $this->term; - } - - /** - * Get the categorization scheme identifier - * - * @return string|null - */ - public function get_scheme() - { - return $this->scheme; - } - - /** - * Get the human readable label - * - * @param bool $strict - * @return string|null - */ - public function get_label(bool $strict = false) - { - if ($this->label === null && $strict !== true) { - return $this->get_term(); - } - return $this->label; - } - - /** - * Get the category type - * - * @return string|null - */ - public function get_type() - { - return $this->type; - } -} - -class_alias('SimplePie\Category', 'SimplePie_Category'); diff --git a/core/vendor/simplepie/simplepie/src/Content/Type/Sniffer.php b/core/vendor/simplepie/simplepie/src/Content/Type/Sniffer.php deleted file mode 100644 index d1da5fd71f..0000000000 --- a/core/vendor/simplepie/simplepie/src/Content/Type/Sniffer.php +++ /dev/null @@ -1,243 +0,0 @@ -file = $file; - } - - /** - * Get the Content-Type of the specified file - * - * @return string Actual Content-Type - */ - public function get_type() - { - $content_type = $this->file->has_header('content-type') ? $this->file->get_header_line('content-type') : null; - $content_encoding = $this->file->has_header('content-encoding') ? $this->file->get_header_line('content-encoding') : null; - if ($content_type !== null) { - if ($content_encoding === null - && ($content_type === 'text/plain' - || $content_type === 'text/plain; charset=ISO-8859-1' - || $content_type === 'text/plain; charset=iso-8859-1' - || $content_type === 'text/plain; charset=UTF-8')) { - return $this->text_or_binary(); - } - - if (($pos = strpos($content_type, ';')) !== false) { - $official = substr($content_type, 0, $pos); - } else { - $official = $content_type; - } - $official = trim(strtolower($official)); - - if ($official === 'unknown/unknown' - || $official === 'application/unknown') { - return $this->unknown(); - } elseif (substr($official, -4) === '+xml' - || $official === 'text/xml' - || $official === 'application/xml') { - return $official; - } elseif (substr($official, 0, 6) === 'image/') { - if ($return = $this->image()) { - return $return; - } - - return $official; - } elseif ($official === 'text/html') { - return $this->feed_or_html(); - } - - return $official; - } - - return $this->unknown(); - } - - /** - * Sniff text or binary - * - * @return string Actual Content-Type - */ - public function text_or_binary() - { - $body = $this->file->get_body_content(); - - if (substr($body, 0, 2) === "\xFE\xFF" - || substr($body, 0, 2) === "\xFF\xFE" - || substr($body, 0, 4) === "\x00\x00\xFE\xFF" - || substr($body, 0, 3) === "\xEF\xBB\xBF") { - return 'text/plain'; - } elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $body)) { - return 'application/octet-stream'; - } - - return 'text/plain'; - } - - /** - * Sniff unknown - * - * @return string Actual Content-Type - */ - public function unknown() - { - $body = $this->file->get_body_content(); - - $ws = strspn($body, "\x09\x0A\x0B\x0C\x0D\x20"); - if (strtolower(substr($body, $ws, 14)) === 'text_or_binary(); - } - - /** - * Sniff images - * - * @return string|false Actual Content-Type - */ - public function image() - { - $body = $this->file->get_body_content(); - - if (substr($body, 0, 6) === 'GIF87a' - || substr($body, 0, 6) === 'GIF89a') { - return 'image/gif'; - } elseif (substr($body, 0, 8) === "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") { - return 'image/png'; - } elseif (substr($body, 0, 3) === "\xFF\xD8\xFF") { - return 'image/jpeg'; - } elseif (substr($body, 0, 2) === "\x42\x4D") { - return 'image/bmp'; - } elseif (substr($body, 0, 4) === "\x00\x00\x01\x00") { - return 'image/vnd.microsoft.icon'; - } - - return false; - } - - /** - * Sniff HTML - * - * @return string Actual Content-Type - */ - public function feed_or_html() - { - $body = $this->file->get_body_content(); - - $len = strlen($body); - $pos = strspn($body, "\x09\x0A\x0D\x20\xEF\xBB\xBF"); - - while ($pos < $len) { - switch ($body[$pos]) { - case "\x09": - case "\x0A": - case "\x0D": - case "\x20": - $pos += strspn($body, "\x09\x0A\x0D\x20", $pos); - continue 2; - - case '<': - $pos++; - break; - - default: - return 'text/html'; - } - - if (substr($body, $pos, 3) === '!--') { - $pos += 3; - if ($pos < $len && ($pos = strpos($body, '-->', $pos)) !== false) { - $pos += 3; - } else { - return 'text/html'; - } - } elseif (substr($body, $pos, 1) === '!') { - if ($pos < $len && ($pos = strpos($body, '>', $pos)) !== false) { - $pos++; - } else { - return 'text/html'; - } - } elseif (substr($body, $pos, 1) === '?') { - if ($pos < $len && ($pos = strpos($body, '?>', $pos)) !== false) { - $pos += 2; - } else { - return 'text/html'; - } - } elseif (substr($body, $pos, 3) === 'rss' - || substr($body, $pos, 7) === 'rdf:RDF') { - return 'application/rss+xml'; - } elseif (substr($body, $pos, 4) === 'feed') { - return 'application/atom+xml'; - } else { - return 'text/html'; - } - } - - return 'text/html'; - } -} - -class_alias('SimplePie\Content\Type\Sniffer', 'SimplePie_Content_Type_Sniffer'); diff --git a/core/vendor/simplepie/simplepie/src/Copyright.php b/core/vendor/simplepie/simplepie/src/Copyright.php deleted file mode 100644 index 080e332bd0..0000000000 --- a/core/vendor/simplepie/simplepie/src/Copyright.php +++ /dev/null @@ -1,89 +0,0 @@ -` copyright tags as defined in Media RSS - * - * Used by {@see \SimplePie\Enclosure::get_copyright()} - * - * This class can be overloaded with {@see \SimplePie\SimplePie::set_copyright_class()} - */ -class Copyright -{ - /** - * Copyright URL - * - * @var ?string - * @see get_url() - */ - public $url; - - /** - * Attribution - * - * @var ?string - * @see get_attribution() - */ - public $label; - - /** - * Constructor, used to input the data - * - * For documentation on all the parameters, see the corresponding - * properties and their accessors - */ - public function __construct( - ?string $url = null, - ?string $label = null - ) { - $this->url = $url; - $this->label = $label; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Get the copyright URL - * - * @return string|null URL to copyright information - */ - public function get_url() - { - if ($this->url !== null) { - return $this->url; - } - - return null; - } - - /** - * Get the attribution text - * - * @return string|null - */ - public function get_attribution() - { - if ($this->label !== null) { - return $this->label; - } - - return null; - } -} - -class_alias('SimplePie\Copyright', 'SimplePie_Copyright'); diff --git a/core/vendor/simplepie/simplepie/src/Credit.php b/core/vendor/simplepie/simplepie/src/Credit.php deleted file mode 100644 index 3fc0ea1c17..0000000000 --- a/core/vendor/simplepie/simplepie/src/Credit.php +++ /dev/null @@ -1,113 +0,0 @@ -` as defined in Media RSS - * - * Used by {@see \SimplePie\Enclosure::get_credit()} and {@see \SimplePie\Enclosure::get_credits()} - * - * This class can be overloaded with {@see \SimplePie\SimplePie::set_credit_class()} - */ -class Credit -{ - /** - * Credited role - * - * @var ?string - * @see get_role() - */ - public $role; - - /** - * Organizational scheme - * - * @var ?string - * @see get_scheme() - */ - public $scheme; - - /** - * Credited name - * - * @var ?string - * @see get_name() - */ - public $name; - - /** - * Constructor, used to input the data - * - * For documentation on all the parameters, see the corresponding - * properties and their accessors - */ - public function __construct( - ?string $role = null, - ?string $scheme = null, - ?string $name = null - ) { - $this->role = $role; - $this->scheme = $scheme; - $this->name = $name; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Get the role of the person receiving credit - * - * @return string|null - */ - public function get_role() - { - if ($this->role !== null) { - return $this->role; - } - - return null; - } - - /** - * Get the organizational scheme - * - * @return string|null - */ - public function get_scheme() - { - if ($this->scheme !== null) { - return $this->scheme; - } - - return null; - } - - /** - * Get the credited person/entity's name - * - * @return string|null - */ - public function get_name() - { - if ($this->name !== null) { - return $this->name; - } - - return null; - } -} - -class_alias('SimplePie\Credit', 'SimplePie_Credit'); diff --git a/core/vendor/simplepie/simplepie/src/Enclosure.php b/core/vendor/simplepie/simplepie/src/Enclosure.php deleted file mode 100644 index 89231c7f99..0000000000 --- a/core/vendor/simplepie/simplepie/src/Enclosure.php +++ /dev/null @@ -1,1217 +0,0 @@ -bitrate = $bitrate; - $this->captions = $captions; - $this->categories = $categories; - $this->channels = $channels; - $this->copyright = $copyright; - $this->credits = $credits; - $this->description = $description; - $this->duration = $duration; - $this->expression = $expression; - $this->framerate = $framerate; - $this->hashes = $hashes; - $this->height = $height; - $this->keywords = $keywords; - $this->lang = $lang; - $this->length = $length; - $this->link = $link; - $this->medium = $medium; - $this->player = $player; - $this->ratings = $ratings; - $this->restrictions = $restrictions; - $this->samplingrate = $samplingrate; - $this->thumbnails = $thumbnails; - $this->title = $title; - $this->type = $type; - $this->width = $width; - - if (function_exists('idn_to_ascii')) { - $parsed = \SimplePie\Misc::parse_url($link ?? ''); - if ($parsed['authority'] !== '' && !ctype_print($parsed['authority'])) { - $authority = (string) \idn_to_ascii($parsed['authority'], \IDNA_NONTRANSITIONAL_TO_ASCII, \INTL_IDNA_VARIANT_UTS46); - $this->link = \SimplePie\Misc::compress_parse_url($parsed['scheme'], $authority, $parsed['path'], $parsed['query'], $parsed['fragment']); - } - } - $this->handler = $this->get_handler(); // Needs to load last - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Get the bitrate - * - * @return string|null - */ - public function get_bitrate() - { - if ($this->bitrate !== null) { - return $this->bitrate; - } - - return null; - } - - /** - * Get a single caption - * - * @param int $key - * @return \SimplePie\Caption|null - */ - public function get_caption(int $key = 0) - { - $captions = $this->get_captions(); - if (isset($captions[$key])) { - return $captions[$key]; - } - - return null; - } - - /** - * Get all captions - * - * @return Caption[]|null - */ - public function get_captions() - { - if ($this->captions !== null) { - return $this->captions; - } - - return null; - } - - /** - * Get a single category - * - * @param int $key - * @return \SimplePie\Category|null - */ - public function get_category(int $key = 0) - { - $categories = $this->get_categories(); - if (isset($categories[$key])) { - return $categories[$key]; - } - - return null; - } - - /** - * Get all categories - * - * @return \SimplePie\Category[]|null - */ - public function get_categories() - { - if ($this->categories !== null) { - return $this->categories; - } - - return null; - } - - /** - * Get the number of audio channels - * - * @return int|null - */ - public function get_channels() - { - if ($this->channels !== null) { - return $this->channels; - } - - return null; - } - - /** - * Get the copyright information - * - * @return \SimplePie\Copyright|null - */ - public function get_copyright() - { - if ($this->copyright !== null) { - return $this->copyright; - } - - return null; - } - - /** - * Get a single credit - * - * @param int $key - * @return \SimplePie\Credit|null - */ - public function get_credit(int $key = 0) - { - $credits = $this->get_credits(); - if (isset($credits[$key])) { - return $credits[$key]; - } - - return null; - } - - /** - * Get all credits - * - * @return Credit[]|null - */ - public function get_credits() - { - if ($this->credits !== null) { - return $this->credits; - } - - return null; - } - - /** - * Get the description of the enclosure - * - * @return string|null - */ - public function get_description() - { - if ($this->description !== null) { - return $this->description; - } - - return null; - } - - /** - * Get the duration of the enclosure - * - * @param bool $convert Convert seconds into hh:mm:ss - * @return string|int|null 'hh:mm:ss' string if `$convert` was specified, otherwise integer (or null if none found) - */ - public function get_duration(bool $convert = false) - { - if ($this->duration !== null) { - if ($convert) { - $time = \SimplePie\Misc::time_hms($this->duration); - return $time; - } - - return $this->duration; - } - - return null; - } - - /** - * Get the expression - * - * @return string Probably one of 'sample', 'full', 'nonstop', 'clip'. Defaults to 'full' - */ - public function get_expression() - { - if ($this->expression !== null) { - return $this->expression; - } - - return 'full'; - } - - /** - * Get the file extension - * - * @return string|null - */ - public function get_extension() - { - if ($this->link !== null) { - $url = \SimplePie\Misc::parse_url($this->link); - if ($url['path'] !== '') { - return pathinfo($url['path'], PATHINFO_EXTENSION); - } - } - return null; - } - - /** - * Get the framerate (in frames-per-second) - * - * @return string|null - */ - public function get_framerate() - { - if ($this->framerate !== null) { - return $this->framerate; - } - - return null; - } - - /** - * Get the preferred handler - * - * @return string|null One of 'flash', 'fmedia', 'quicktime', 'wmedia', 'mp3' - */ - public function get_handler() - { - return $this->get_real_type(true); - } - - /** - * Get a single hash - * - * @link http://www.rssboard.org/media-rss#media-hash - * @param int $key - * @return string|null Hash as per `media:hash`, prefixed with "$algo:" - */ - public function get_hash(int $key = 0) - { - $hashes = $this->get_hashes(); - if (isset($hashes[$key])) { - return $hashes[$key]; - } - - return null; - } - - /** - * Get all credits - * - * @return string[]|null Array of strings, see {@see get_hash()} - */ - public function get_hashes() - { - if ($this->hashes !== null) { - return $this->hashes; - } - - return null; - } - - /** - * Get the height - * - * @return string|null - */ - public function get_height() - { - if ($this->height !== null) { - return $this->height; - } - - return null; - } - - /** - * Get the language - * - * @link http://tools.ietf.org/html/rfc3066 - * @return string|null Language code as per RFC 3066 - */ - public function get_language() - { - if ($this->lang !== null) { - return $this->lang; - } - - return null; - } - - /** - * Get a single keyword - * - * @param int $key - * @return string|null - */ - public function get_keyword(int $key = 0) - { - $keywords = $this->get_keywords(); - if (isset($keywords[$key])) { - return $keywords[$key]; - } - - return null; - } - - /** - * Get all keywords - * - * @return string[]|null - */ - public function get_keywords() - { - if ($this->keywords !== null) { - return $this->keywords; - } - - return null; - } - - /** - * Get length - * - * @return ?int Length in bytes - */ - public function get_length() - { - if ($this->length !== null) { - return $this->length; - } - - return null; - } - - /** - * Get the URL - * - * @return string|null - */ - public function get_link() - { - if ($this->link !== null) { - return $this->link; - } - - return null; - } - - /** - * Get the medium - * - * @link http://www.rssboard.org/media-rss#media-content - * @return string|null Should be one of 'image', 'audio', 'video', 'document', 'executable' - */ - public function get_medium() - { - if ($this->medium !== null) { - return $this->medium; - } - - return null; - } - - /** - * Get the player URL - * - * Typically the same as {@see get_permalink()} - * @return string|null Player URL - */ - public function get_player() - { - if ($this->player !== null) { - return $this->player; - } - - return null; - } - - /** - * Get a single rating - * - * @param int $key - * @return \SimplePie\Rating|null - */ - public function get_rating(int $key = 0) - { - $ratings = $this->get_ratings(); - if (isset($ratings[$key])) { - return $ratings[$key]; - } - - return null; - } - - /** - * Get all ratings - * - * @return Rating[]|null - */ - public function get_ratings() - { - if ($this->ratings !== null) { - return $this->ratings; - } - - return null; - } - - /** - * Get a single restriction - * - * @param int $key - * @return \SimplePie\Restriction|null - */ - public function get_restriction(int $key = 0) - { - $restrictions = $this->get_restrictions(); - if (isset($restrictions[$key])) { - return $restrictions[$key]; - } - - return null; - } - - /** - * Get all restrictions - * - * @return Restriction[]|null - */ - public function get_restrictions() - { - if ($this->restrictions !== null) { - return $this->restrictions; - } - - return null; - } - - /** - * Get the sampling rate (in kHz) - * - * @return string|null - */ - public function get_sampling_rate() - { - if ($this->samplingrate !== null) { - return $this->samplingrate; - } - - return null; - } - - /** - * Get the file size (in MiB) - * - * @return float|null File size in mebibytes (1048 bytes) - */ - public function get_size() - { - $length = $this->get_length(); - if ($length !== null) { - return round($length / 1048576, 2); - } - - return null; - } - - /** - * Get a single thumbnail - * - * @param int $key - * @return string|null Thumbnail URL - */ - public function get_thumbnail(int $key = 0) - { - $thumbnails = $this->get_thumbnails(); - if (isset($thumbnails[$key])) { - return $thumbnails[$key]; - } - - return null; - } - - /** - * Get all thumbnails - * - * @return string[]|null Array of thumbnail URLs - */ - public function get_thumbnails() - { - if ($this->thumbnails !== null) { - return $this->thumbnails; - } - - return null; - } - - /** - * Get the title - * - * @return string|null - */ - public function get_title() - { - if ($this->title !== null) { - return $this->title; - } - - return null; - } - - /** - * Get mimetype of the enclosure - * - * @see get_real_type() - * @return string|null MIME type - */ - public function get_type() - { - if ($this->type !== null) { - return $this->type; - } - - return null; - } - - /** - * Get the width - * - * @return string|null - */ - public function get_width() - { - if ($this->width !== null) { - return $this->width; - } - - return null; - } - - /** - * Embed the enclosure using `` - * - * @deprecated Use the second parameter to {@see embed} instead - * - * @param array|string $options See first parameter to {@see embed} - * @return string HTML string to output - */ - public function native_embed($options = '') - { - return $this->embed($options, true); - } - - /** - * Embed the enclosure using Javascript - * - * `$options` is an array or comma-separated key:value string, with the - * following properties: - * - * - `alt` (string): Alternate content for when an end-user does not have - * the appropriate handler installed or when a file type is - * unsupported. Can be any text or HTML. Defaults to blank. - * - `altclass` (string): If a file type is unsupported, the end-user will - * see the alt text (above) linked directly to the content. That link - * will have this value as its class name. Defaults to blank. - * - `audio` (string): This is an image that should be used as a - * placeholder for audio files before they're loaded (QuickTime-only). - * Can be any relative or absolute URL. Defaults to blank. - * - `bgcolor` (string): The background color for the media, if not - * already transparent. Defaults to `#ffffff`. - * - `height` (integer): The height of the embedded media. Accepts any - * numeric pixel value (such as `360`) or `auto`. Defaults to `auto`, - * and it is recommended that you use this default. - * - `loop` (boolean): Do you want the media to loop when it's done? - * Defaults to `false`. - * - `mediaplayer` (string): The location of the included - * `mediaplayer.swf` file. This allows for the playback of Flash Video - * (`.flv`) files, and is the default handler for non-Odeo MP3's. - * Defaults to blank. - * - `video` (string): This is an image that should be used as a - * placeholder for video files before they're loaded (QuickTime-only). - * Can be any relative or absolute URL. Defaults to blank. - * - `width` (integer): The width of the embedded media. Accepts any - * numeric pixel value (such as `480`) or `auto`. Defaults to `auto`, - * and it is recommended that you use this default. - * - `widescreen` (boolean): Is the enclosure widescreen or standard? - * This applies only to video enclosures, and will automatically resize - * the content appropriately. Defaults to `false`, implying 4:3 mode. - * - * Note: Non-widescreen (4:3) mode with `width` and `height` set to `auto` - * will default to 480x360 video resolution. Widescreen (16:9) mode with - * `width` and `height` set to `auto` will default to 480x270 video resolution. - * - * @todo If the dimensions for media:content are defined, use them when width/height are set to 'auto'. - * @param array|string $options Comma-separated key:value list, or array - * @param bool $native Use `` - * @return string HTML string to output - */ - public function embed($options = '', bool $native = false) - { - // Set up defaults - $audio = ''; - $video = ''; - $alt = ''; - $altclass = ''; - $loop = 'false'; - $width = 'auto'; - $height = 'auto'; - $bgcolor = '#ffffff'; - $mediaplayer = ''; - $widescreen = false; - $handler = $this->get_handler(); - $type = $this->get_real_type(); - $placeholder = ''; - - // Process options and reassign values as necessary - if (is_array($options)) { - extract($options); - } else { - $options = explode(',', $options); - foreach ($options as $option) { - $opt = explode(':', $option, 2); - if (isset($opt[0], $opt[1])) { - $opt[0] = trim($opt[0]); - $opt[1] = trim($opt[1]); - switch ($opt[0]) { - case 'audio': - $audio = $opt[1]; - break; - - case 'video': - $video = $opt[1]; - break; - - case 'alt': - $alt = $opt[1]; - break; - - case 'altclass': - $altclass = $opt[1]; - break; - - case 'loop': - $loop = $opt[1]; - break; - - case 'width': - $width = $opt[1]; - break; - - case 'height': - $height = $opt[1]; - break; - - case 'bgcolor': - $bgcolor = $opt[1]; - break; - - case 'mediaplayer': - $mediaplayer = $opt[1]; - break; - - case 'widescreen': - $widescreen = $opt[1]; - break; - } - } - } - } - - $mime = explode('/', (string) $type, 2); - $mime = $mime[0]; - - // Process values for 'auto' - if ($width === 'auto') { - if ($mime === 'video') { - if ($height === 'auto') { - $width = 480; - } elseif ($widescreen) { - $width = round((intval($height) / 9) * 16); - } else { - $width = round((intval($height) / 3) * 4); - } - } else { - $width = '100%'; - } - } - - if ($height === 'auto') { - if ($mime === 'audio') { - $height = 0; - } elseif ($mime === 'video') { - if ($width === 'auto') { - if ($widescreen) { - $height = 270; - } else { - $height = 360; - } - } elseif ($widescreen) { - $height = round((intval($width) / 16) * 9); - } else { - $height = round((intval($width) / 4) * 3); - } - } else { - $height = 376; - } - } elseif ($mime === 'audio') { - $height = 0; - } - - // Set proper placeholder value - if ($mime === 'audio') { - $placeholder = $audio; - } elseif ($mime === 'video') { - $placeholder = $video; - } - - $embed = ''; - - // Flash - if ($handler === 'flash') { - if ($native) { - $embed .= "get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\">"; - } else { - $embed .= ""; - } - } - - // Flash Media Player file types. - // Preferred handler for MP3 file types. - elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== '')) { - if (is_numeric($height)) { - $height += 20; - } - - if ($native) { - $embed .= "get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\">"; - } else { - $embed .= ""; - } - } - - // QuickTime 7 file types. Need to test with QuickTime 6. - // Only handle MP3's if the Flash Media Player is not present. - elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === '')) { - if (is_numeric($height)) { - $height += 16; - } - - if ($native) { - if ($placeholder !== '') { - $embed .= "get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\">"; - } else { - $embed .= "get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\">"; - } - } else { - $embed .= ""; - } - } - - // Windows Media - elseif ($handler === 'wmedia') { - if (is_numeric($height)) { - $height += 45; - } - - if ($native) { - $embed .= "get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\">"; - } else { - $embed .= ""; - } - } - - // Everything else - else { - $embed .= '' . $alt . ''; - } - - return $embed; - } - - /** - * Get the real media type - * - * Often, feeds lie to us, necessitating a bit of deeper inspection. This - * converts types to their canonical representations based on the file - * extension - * - * @see get_type() - * @param bool $find_handler Internal use only, use {@see get_handler()} instead - * @return string|null MIME type - */ - public function get_real_type(bool $find_handler = false) - { - // Mime-types by handler. - $types_flash = ['application/x-shockwave-flash', 'application/futuresplash']; // Flash - $types_fmedia = ['video/flv', 'video/x-flv','flv-application/octet-stream']; // Flash Media Player - $types_quicktime = ['audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video']; // QuickTime - $types_wmedia = ['application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx']; // Windows Media - $types_mp3 = ['audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg']; // MP3 - - $type = $this->get_type(); - if ($type !== null) { - $type = strtolower($type); - } - - // If we encounter an unsupported mime-type, check the file extension and guess intelligently. - if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3))) { - $extension = $this->get_extension(); - if ($extension === null) { - return null; - } - - switch (strtolower($extension)) { - // Audio mime-types - case 'aac': - case 'adts': - $type = 'audio/acc'; - break; - - case 'aif': - case 'aifc': - case 'aiff': - case 'cdda': - $type = 'audio/aiff'; - break; - - case 'bwf': - $type = 'audio/wav'; - break; - - case 'kar': - case 'mid': - case 'midi': - case 'smf': - $type = 'audio/midi'; - break; - - case 'm4a': - $type = 'audio/x-m4a'; - break; - - case 'mp3': - case 'swa': - $type = 'audio/mp3'; - break; - - case 'wav': - $type = 'audio/wav'; - break; - - case 'wax': - $type = 'audio/x-ms-wax'; - break; - - case 'wma': - $type = 'audio/x-ms-wma'; - break; - - case '3gp': - case '3gpp': - // Video mime-types - $type = 'video/3gpp'; - break; - - case '3g2': - case '3gp2': - $type = 'video/3gpp2'; - break; - - case 'asf': - $type = 'video/x-ms-asf'; - break; - - case 'flv': - $type = 'video/x-flv'; - break; - - case 'm1a': - case 'm1s': - case 'm1v': - case 'm15': - case 'm75': - case 'mp2': - case 'mpa': - case 'mpeg': - case 'mpg': - case 'mpm': - case 'mpv': - $type = 'video/mpeg'; - break; - - case 'm4v': - $type = 'video/x-m4v'; - break; - - case 'mov': - case 'qt': - $type = 'video/quicktime'; - break; - - case 'mp4': - case 'mpg4': - $type = 'video/mp4'; - break; - - case 'sdv': - $type = 'video/sd-video'; - break; - - case 'wm': - $type = 'video/x-ms-wm'; - break; - - case 'wmv': - $type = 'video/x-ms-wmv'; - break; - - case 'wvx': - $type = 'video/x-ms-wvx'; - break; - - case 'spl': - // Flash mime-types - $type = 'application/futuresplash'; - break; - - case 'swf': - $type = 'application/x-shockwave-flash'; - break; - } - } - - if ($find_handler) { - if (in_array($type, $types_flash)) { - return 'flash'; - } elseif (in_array($type, $types_fmedia)) { - return 'fmedia'; - } elseif (in_array($type, $types_quicktime)) { - return 'quicktime'; - } elseif (in_array($type, $types_wmedia)) { - return 'wmedia'; - } elseif (in_array($type, $types_mp3)) { - return 'mp3'; - } - - return null; - } - - return $type; - } -} - -class_alias('SimplePie\Enclosure', 'SimplePie_Enclosure'); diff --git a/core/vendor/simplepie/simplepie/src/Exception.php b/core/vendor/simplepie/simplepie/src/Exception.php deleted file mode 100644 index c5d3ba3a02..0000000000 --- a/core/vendor/simplepie/simplepie/src/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ -> Canonical representation of headers */ - private $parsed_headers = []; - /** @var array Last known value of $headers property (used to detect external modification) */ - private $last_headers = []; - /** - * @var array Headers as string for BC - * @deprecated Use `get_headers()` method. - */ - public $headers = []; - - /** - * @var ?string Body of the HTTP response - * @deprecated Use `get_body_content()` method. - */ - public $body; - - /** - * @var int Status code of the HTTP response - * @deprecated Use `get_status_code()` method. - */ - public $status_code = 0; - - /** @var non-negative-int Number of redirect that were already performed during this request sequence. */ - public $redirects = 0; - - /** @var ?string */ - public $error; - - /** - * @var int-mask-of Bit mask representing the method used to fetch the file and whether it is a local file or remote file obtained over HTTP. - * @deprecated Backend is implementation detail which you should not care about; to see if the file was retrieved over HTTP, check if `get_final_requested_uri()` with `Misc::is_remote_uri()`. - */ - public $method = \SimplePie\SimplePie::FILE_SOURCE_NONE; - - /** - * @var string The permanent URL or the resource (first URL after the prefix of (only) permanent redirects) - * @deprecated Use `get_permanent_uri()` method. - */ - public $permanent_url; - /** @var bool Whether the permanent URL is still writeable (prefix of permanent redirects has not ended) */ - private $permanentUrlMutable = true; - - /** - * @param string $url - * @param int $timeout - * @param int $redirects - * @param ?array $headers - * @param ?string $useragent - * @param bool $force_fsockopen - * @param array $curl_options - */ - public function __construct(string $url, int $timeout = 10, int $redirects = 5, ?array $headers = null, ?string $useragent = null, bool $force_fsockopen = false, array $curl_options = []) - { - if (function_exists('idn_to_ascii')) { - $parsed = \SimplePie\Misc::parse_url($url); - if ($parsed['authority'] !== '' && !ctype_print($parsed['authority'])) { - $authority = (string) \idn_to_ascii($parsed['authority'], \IDNA_NONTRANSITIONAL_TO_ASCII, \INTL_IDNA_VARIANT_UTS46); - $url = \SimplePie\Misc::compress_parse_url($parsed['scheme'], $authority, $parsed['path'], $parsed['query'], null); - } - } - $this->url = $url; - if ($this->permanentUrlMutable) { - $this->permanent_url = $url; - } - $this->useragent = $useragent; - if (preg_match('/^http(s)?:\/\//i', $url)) { - if ($useragent === null) { - $useragent = (string) ini_get('user_agent'); - $this->useragent = $useragent; - } - if (!is_array($headers)) { - $headers = []; - } - if (!$force_fsockopen && function_exists('curl_exec')) { - $this->method = \SimplePie\SimplePie::FILE_SOURCE_REMOTE | \SimplePie\SimplePie::FILE_SOURCE_CURL; - $fp = curl_init(); - $headers2 = []; - foreach ($headers as $key => $value) { - $headers2[] = "$key: $value"; - } - if (isset($curl_options[CURLOPT_HTTPHEADER])) { - if (is_array($curl_options[CURLOPT_HTTPHEADER])) { - $headers2 = array_merge($headers2, $curl_options[CURLOPT_HTTPHEADER]); - } - unset($curl_options[CURLOPT_HTTPHEADER]); - } - if (version_compare(\SimplePie\Misc::get_curl_version(), '7.10.5', '>=')) { - curl_setopt($fp, CURLOPT_ENCODING, ''); - } - curl_setopt($fp, CURLOPT_URL, $url); - curl_setopt($fp, CURLOPT_HEADER, 1); - curl_setopt($fp, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($fp, CURLOPT_FAILONERROR, 1); - curl_setopt($fp, CURLOPT_TIMEOUT, $timeout); - curl_setopt($fp, CURLOPT_CONNECTTIMEOUT, $timeout); - curl_setopt($fp, CURLOPT_REFERER, \SimplePie\Misc::url_remove_credentials($url)); - curl_setopt($fp, CURLOPT_USERAGENT, $useragent); - curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2); - foreach ($curl_options as $curl_param => $curl_value) { - curl_setopt($fp, $curl_param, $curl_value); - } - - $responseHeaders = curl_exec($fp); - if (curl_errno($fp) === CURLE_WRITE_ERROR || curl_errno($fp) === CURLE_BAD_CONTENT_ENCODING) { - curl_setopt($fp, CURLOPT_ENCODING, 'none'); - $responseHeaders = curl_exec($fp); - } - $this->status_code = curl_getinfo($fp, CURLINFO_HTTP_CODE); - if (curl_errno($fp)) { - $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); - $this->success = false; - } else { - // Use the updated url provided by curl_getinfo after any redirects. - if ($info = curl_getinfo($fp)) { - $this->url = $info['url']; - } - // For PHPStan: We already checked that error did not occur. - assert(is_array($info) && $info['redirect_count'] >= 0); - if (\PHP_VERSION_ID < 80000) { - curl_close($fp); - } - $responseHeaders = \SimplePie\HTTP\Parser::prepareHeaders((string) $responseHeaders, $info['redirect_count'] + 1); - $parser = new \SimplePie\HTTP\Parser($responseHeaders, true); - if ($parser->parse()) { - $this->set_headers($parser->headers); - $this->body = $parser->body; - $this->status_code = $parser->status_code; - if ((in_array($this->status_code, [300, 301, 302, 303, 307]) || $this->status_code > 307 && $this->status_code < 400) && ($locationHeader = $this->get_header_line('location')) !== '' && $this->redirects < $redirects) { - $this->redirects++; - $location = \SimplePie\Misc::absolutize_url($locationHeader, $url); - if ($location === false) { - $this->error = "Invalid redirect location, trying to base “{$locationHeader}” onto “{$url}”"; - $this->success = false; - return; - } - $this->permanentUrlMutable = $this->permanentUrlMutable && ($this->status_code == 301 || $this->status_code == 308); - $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options); - return; - } - } - } - } else { - $this->method = \SimplePie\SimplePie::FILE_SOURCE_REMOTE | \SimplePie\SimplePie::FILE_SOURCE_FSOCKOPEN; - if (($url_parts = parse_url($url)) === false) { - throw new \InvalidArgumentException('Malformed URL: ' . $url); - } - if (!isset($url_parts['host'])) { - throw new \InvalidArgumentException('Missing hostname: ' . $url); - } - $socket_host = $url_parts['host']; - if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') { - $socket_host = 'ssl://' . $socket_host; - $url_parts['port'] = 443; - } - if (!isset($url_parts['port'])) { - $url_parts['port'] = 80; - } - $fp = @fsockopen($socket_host, $url_parts['port'], $errno, $errstr, $timeout); - if (!$fp) { - $this->error = 'fsockopen error: ' . $errstr; - $this->success = false; - } else { - stream_set_timeout($fp, $timeout); - if (isset($url_parts['path'])) { - if (isset($url_parts['query'])) { - $get = "$url_parts[path]?$url_parts[query]"; - } else { - $get = $url_parts['path']; - } - } else { - $get = '/'; - } - $out = "GET $get HTTP/1.1\r\n"; - $out .= "Host: $url_parts[host]\r\n"; - $out .= "User-Agent: $useragent\r\n"; - if (extension_loaded('zlib')) { - $out .= "Accept-Encoding: x-gzip,gzip,deflate\r\n"; - } - - if (isset($url_parts['user']) && isset($url_parts['pass'])) { - $out .= "Authorization: Basic " . base64_encode("$url_parts[user]:$url_parts[pass]") . "\r\n"; - } - foreach ($headers as $key => $value) { - $out .= "$key: $value\r\n"; - } - $out .= "Connection: Close\r\n\r\n"; - fwrite($fp, $out); - - $info = stream_get_meta_data($fp); - - $responseHeaders = ''; - while (!$info['eof'] && !$info['timed_out']) { - $responseHeaders .= fread($fp, 1160); - $info = stream_get_meta_data($fp); - } - if (!$info['timed_out']) { - $parser = new \SimplePie\HTTP\Parser($responseHeaders, true); - if ($parser->parse()) { - $this->set_headers($parser->headers); - $this->body = $parser->body; - $this->status_code = $parser->status_code; - if ((in_array($this->status_code, [300, 301, 302, 303, 307]) || $this->status_code > 307 && $this->status_code < 400) && ($locationHeader = $this->get_header_line('location')) !== '' && $this->redirects < $redirects) { - $this->redirects++; - $location = \SimplePie\Misc::absolutize_url($locationHeader, $url); - $this->permanentUrlMutable = $this->permanentUrlMutable && ($this->status_code == 301 || $this->status_code == 308); - if ($location === false) { - $this->error = "Invalid redirect location, trying to base “{$locationHeader}” onto “{$url}”"; - $this->success = false; - return; - } - $this->__construct($location, $timeout, $redirects, $headers, $useragent, $force_fsockopen, $curl_options); - return; - } - if (($contentEncodingHeader = $this->get_header_line('content-encoding')) !== '') { - // Hey, we act dumb elsewhere, so let's do that here too - switch (strtolower(trim($contentEncodingHeader, "\x09\x0A\x0D\x20"))) { - case 'gzip': - case 'x-gzip': - if (($decompressed = gzdecode($this->body)) === false) { - $this->error = 'Unable to decode HTTP "gzip" stream'; - $this->success = false; - } else { - $this->body = $decompressed; - } - break; - - case 'deflate': - if (($decompressed = gzinflate($this->body)) !== false) { - $this->body = $decompressed; - } elseif (($decompressed = gzuncompress($this->body)) !== false) { - $this->body = $decompressed; - } elseif (($decompressed = gzdecode($this->body)) !== false) { - $this->body = $decompressed; - } else { - $this->error = 'Unable to decode HTTP "deflate" stream'; - $this->success = false; - } - break; - - default: - $this->error = 'Unknown content coding'; - $this->success = false; - } - } - } - } else { - $this->error = 'fsocket timed out'; - $this->success = false; - } - fclose($fp); - } - } - } else { - $this->method = \SimplePie\SimplePie::FILE_SOURCE_LOCAL | \SimplePie\SimplePie::FILE_SOURCE_FILE_GET_CONTENTS; - if (empty($url) || !is_readable($url) || false === $filebody = file_get_contents($url)) { - $this->body = ''; - $this->error = sprintf('file "%s" is not readable', $url); - $this->success = false; - } else { - $this->body = $filebody; - $this->status_code = 200; - } - } - if ($this->success) { - assert($this->body !== null); // For PHPStan - // Leading whitespace may cause XML parsing errors (XML declaration cannot be preceded by anything other than BOM) so we trim it. - // Note that unlike built-in `trim` function’s default settings, we do not trim `\x00` to avoid breaking characters in UTF-16 or UTF-32 encoded strings. - // We also only do that when the whitespace is followed by `<`, so that we do not break e.g. UTF-16LE encoded whitespace like `\n\x00` in half. - $this->body = preg_replace('/^[ \n\r\t\v]+body); - } - } - - public function get_permanent_uri(): string - { - return (string) $this->permanent_url; - } - - public function get_final_requested_uri(): string - { - return (string) $this->url; - } - - public function get_status_code(): int - { - return (int) $this->status_code; - } - - public function get_headers(): array - { - $this->maybe_update_headers(); - return $this->parsed_headers; - } - - public function has_header(string $name): bool - { - $this->maybe_update_headers(); - return $this->get_header($name) !== []; - } - - public function get_header(string $name): array - { - $this->maybe_update_headers(); - return $this->parsed_headers[strtolower($name)] ?? []; - } - - public function with_header(string $name, $value) - { - $this->maybe_update_headers(); - $new = clone $this; - - $newHeader = [ - strtolower($name) => (array) $value, - ]; - $new->set_headers($newHeader + $this->get_headers()); - - return $new; - } - - public function get_header_line(string $name): string - { - $this->maybe_update_headers(); - return implode(', ', $this->get_header($name)); - } - - public function get_body_content(): string - { - return (string) $this->body; - } - - /** - * Check if the $headers property was changed and update the internal state accordingly. - */ - private function maybe_update_headers(): void - { - if ($this->headers !== $this->last_headers) { - $this->parsed_headers = array_map( - function (string $header_line): array { - if (strpos($header_line, ',') === false) { - return [$header_line]; - } else { - return array_map('trim', explode(',', $header_line)); - } - }, - $this->headers - ); - } - $this->last_headers = $this->headers; - } - - /** - * Sets headers internally. - * - * @param array> $headers - */ - private function set_headers(array $headers): void - { - $this->parsed_headers = $headers; - $this->headers = self::flatten_headers($headers); - $this->last_headers = $this->headers; - } - - /** - * Converts PSR-7 compatible headers into a legacy format. - * - * @param array> $headers - * - * @return array - */ - private function flatten_headers(array $headers): array - { - return array_map(function (array $values): string { - return implode(',', $values); - }, $headers); - } - - /** - * Create a File instance from another Response - * - * For BC reasons in some places there MUST be a `File` instance - * instead of a `Response` implementation - * - * @see Locator::__construct() - * @internal - */ - final public static function fromResponse(Response $response): self - { - $headers = []; - - foreach ($response->get_headers() as $name => $header) { - $headers[$name] = implode(', ', $header); - } - - /** @var File */ - $file = (new \ReflectionClass(File::class))->newInstanceWithoutConstructor(); - - $file->url = $response->get_final_requested_uri(); - $file->useragent = null; - $file->headers = $headers; - $file->body = $response->get_body_content(); - $file->status_code = $response->get_status_code(); - $file->permanent_url = $response->get_permanent_uri(); - - return $file; - } -} - -class_alias('SimplePie\File', 'SimplePie_File'); diff --git a/core/vendor/simplepie/simplepie/src/Gzdecode.php b/core/vendor/simplepie/simplepie/src/Gzdecode.php deleted file mode 100644 index 2c97707837..0000000000 --- a/core/vendor/simplepie/simplepie/src/Gzdecode.php +++ /dev/null @@ -1,310 +0,0 @@ -compressed_data = $data; - $this->compressed_size = strlen($data); - } - - /** - * Decode the GZIP stream - * - * @return bool Successfulness - */ - public function parse() - { - if ($this->compressed_size >= $this->min_compressed_size) { - $len = 0; - - // Check ID1, ID2, and CM - if (substr($this->compressed_data, 0, 3) !== "\x1F\x8B\x08") { - return false; - } - - // Get the FLG (FLaGs) - $this->flags = ord($this->compressed_data[3]); - - // FLG bits above (1 << 4) are reserved - if ($this->flags > 0x1F) { - return false; - } - - // Advance the pointer after the above - $this->position += 4; - - // MTIME - $mtime = substr($this->compressed_data, $this->position, 4); - // Reverse the string if we're on a big-endian arch because l is the only signed long and is machine endianness - if (current((array) unpack('S', "\x00\x01")) === 1) { - $mtime = strrev($mtime); - } - $this->MTIME = current((array) unpack('l', $mtime)); - $this->position += 4; - - // Get the XFL (eXtra FLags) - $this->XFL = ord($this->compressed_data[$this->position++]); - - // Get the OS (Operating System) - $this->OS = ord($this->compressed_data[$this->position++]); - - // Parse the FEXTRA - if ($this->flags & 4) { - // Read subfield IDs - $this->SI1 = $this->compressed_data[$this->position++]; - $this->SI2 = $this->compressed_data[$this->position++]; - - // SI2 set to zero is reserved for future use - if ($this->SI2 === "\x00") { - return false; - } - - // Get the length of the extra field - $len = current((array) unpack('v', substr($this->compressed_data, $this->position, 2))); - $this->position += 2; - - // Check the length of the string is still valid - $this->min_compressed_size += $len + 4; - if ($this->compressed_size >= $this->min_compressed_size) { - // Set the extra field to the given data - $this->extra_field = substr($this->compressed_data, $this->position, $len); - $this->position += $len; - } else { - return false; - } - } - - // Parse the FNAME - if ($this->flags & 8) { - // Get the length of the filename - $len = strcspn($this->compressed_data, "\x00", $this->position); - - // Check the length of the string is still valid - $this->min_compressed_size += $len + 1; - if ($this->compressed_size >= $this->min_compressed_size) { - // Set the original filename to the given string - $this->filename = substr($this->compressed_data, $this->position, $len); - $this->position += $len + 1; - } else { - return false; - } - } - - // Parse the FCOMMENT - if ($this->flags & 16) { - // Get the length of the comment - $len = strcspn($this->compressed_data, "\x00", $this->position); - - // Check the length of the string is still valid - $this->min_compressed_size += $len + 1; - if ($this->compressed_size >= $this->min_compressed_size) { - // Set the original comment to the given string - $this->comment = substr($this->compressed_data, $this->position, $len); - $this->position += $len + 1; - } else { - return false; - } - } - - // Parse the FHCRC - if ($this->flags & 2) { - // Check the length of the string is still valid - $this->min_compressed_size += $len + 2; - if ($this->compressed_size >= $this->min_compressed_size) { - // Read the CRC - $crc = current((array) unpack('v', substr($this->compressed_data, $this->position, 2))); - - // Check the CRC matches - if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc) { - $this->position += 2; - } else { - return false; - } - } else { - return false; - } - } - - // Decompress the actual data - if (($data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false) { - return false; - } - - $this->data = $data; - $this->position = $this->compressed_size - 8; - - // Check CRC of data - $crc = current((array) unpack('V', substr($this->compressed_data, $this->position, 4))); - $this->position += 4; - /*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc)) - { - return false; - }*/ - - // Check ISIZE of data - $isize = current((array) unpack('V', substr($this->compressed_data, $this->position, 4))); - $this->position += 4; - if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize)) { - return false; - } - - // Wow, against all odds, we've actually got a valid gzip string - return true; - } - - return false; - } -} - -class_alias('SimplePie\Gzdecode', 'SimplePie_gzdecode'); diff --git a/core/vendor/simplepie/simplepie/src/HTTP/Client.php b/core/vendor/simplepie/simplepie/src/HTTP/Client.php deleted file mode 100644 index 507c1b0f1f..0000000000 --- a/core/vendor/simplepie/simplepie/src/HTTP/Client.php +++ /dev/null @@ -1,28 +0,0 @@ - $headers - * - * @throws ClientException if anything goes wrong requesting the data - */ - public function request(string $method, string $url, array $headers = []): Response; -} diff --git a/core/vendor/simplepie/simplepie/src/HTTP/ClientException.php b/core/vendor/simplepie/simplepie/src/HTTP/ClientException.php deleted file mode 100644 index d7c0056808..0000000000 --- a/core/vendor/simplepie/simplepie/src/HTTP/ClientException.php +++ /dev/null @@ -1,19 +0,0 @@ -} */ - private $options; - - /** - * @param array{timeout?: int, redirects?: int, useragent?: string, force_fsockopen?: bool, curl_options?: array} $options - */ - public function __construct(Registry $registry, array $options = []) - { - $this->registry = $registry; - $this->options = $options; - } - - /** - * send a request and return the response - * - * @param Client::METHOD_* $method - * @param array $headers - * - * @throws ClientException if anything goes wrong requesting the data - */ - public function request(string $method, string $url, array $headers = []): Response - { - // @phpstan-ignore-next-line Enforce PHPDoc type. - if ($method !== self::METHOD_GET) { - throw new InvalidArgumentException(sprintf( - '%s(): Argument #1 ($method) only supports method "%s".', - __METHOD__, - self::METHOD_GET - ), 1); - } - - try { - $file = $this->registry->create(File::class, [ - $url, - $this->options['timeout'] ?? 10, - $this->options['redirects'] ?? 5, - $headers, - $this->options['useragent'] ?? Misc::get_default_useragent(), - $this->options['force_fsockopen'] ?? false, - $this->options['curl_options'] ?? [] - ]); - } catch (Throwable $th) { - throw new ClientException($th->getMessage(), $th->getCode(), $th); - } - - if ($file->error !== null && $file->get_status_code() === 0) { - throw new ClientException($file->error); - } - - return $file; - } -} diff --git a/core/vendor/simplepie/simplepie/src/HTTP/Parser.php b/core/vendor/simplepie/simplepie/src/HTTP/Parser.php deleted file mode 100644 index e9bcc46716..0000000000 --- a/core/vendor/simplepie/simplepie/src/HTTP/Parser.php +++ /dev/null @@ -1,523 +0,0 @@ -> : array) - */ - public $headers = []; - - /** - * Body of the response - * - * @var string - */ - public $body = ''; - - private const STATE_HTTP_VERSION = 'http_version'; - - private const STATE_STATUS = 'status'; - - private const STATE_REASON = 'reason'; - - private const STATE_NEW_LINE = 'new_line'; - - private const STATE_BODY = 'body'; - - private const STATE_NAME = 'name'; - - private const STATE_VALUE = 'value'; - - private const STATE_VALUE_CHAR = 'value_char'; - - private const STATE_QUOTE = 'quote'; - - private const STATE_QUOTE_ESCAPED = 'quote_escaped'; - - private const STATE_QUOTE_CHAR = 'quote_char'; - - private const STATE_CHUNKED = 'chunked'; - - private const STATE_EMIT = 'emit'; - - private const STATE_ERROR = false; - - /** - * Current state of the state machine - * - * @var self::STATE_* - */ - protected $state = self::STATE_HTTP_VERSION; - - /** - * Input data - * - * @var string - */ - protected $data = ''; - - /** - * Input data length (to avoid calling strlen() everytime this is needed) - * - * @var int - */ - protected $data_length = 0; - - /** - * Current position of the pointer - * - * @var int - */ - protected $position = 0; - - /** - * Name of the header currently being parsed - * - * @var string - */ - protected $name = ''; - - /** - * Value of the header currently being parsed - * - * @var string - */ - protected $value = ''; - - /** - * Create an instance of the class with the input data - * - * @param string $data Input data - * @param Psr7Compatible $psr7Compatible Whether the data types are in format compatible with PSR-7. - */ - public function __construct(string $data, bool $psr7Compatible = false) - { - $this->data = $data; - $this->data_length = strlen($this->data); - $this->psr7Compatible = $psr7Compatible; - } - - /** - * Parse the input data - * - * @return bool true on success, false on failure - */ - public function parse() - { - while ($this->state && $this->state !== self::STATE_EMIT && $this->has_data()) { - $state = $this->state; - $this->$state(); - } - $this->data = ''; - if ($this->state === self::STATE_EMIT || $this->state === self::STATE_BODY) { - return true; - } - - // Reset the parser state. - $this->http_version = 0.0; - $this->status_code = 0; - $this->reason = ''; - $this->headers = []; - $this->body = ''; - return false; - } - - /** - * Check whether there is data beyond the pointer - * - * @return bool true if there is further data, false if not - */ - protected function has_data() - { - return (bool) ($this->position < $this->data_length); - } - - /** - * See if the next character is LWS - * - * @return bool true if the next character is LWS, false if not - */ - protected function is_linear_whitespace() - { - return (bool) ($this->data[$this->position] === "\x09" - || $this->data[$this->position] === "\x20" - || ($this->data[$this->position] === "\x0A" - && isset($this->data[$this->position + 1]) - && ($this->data[$this->position + 1] === "\x09" || $this->data[$this->position + 1] === "\x20"))); - } - - /** - * Parse the HTTP version - * @return void - */ - protected function http_version() - { - if (strpos($this->data, "\x0A") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/') { - $len = strspn($this->data, '0123456789.', 5); - $http_version = substr($this->data, 5, $len); - $this->position += 5 + $len; - if (substr_count($http_version, '.') <= 1) { - $this->http_version = (float) $http_version; - $this->position += strspn($this->data, "\x09\x20", $this->position); - $this->state = self::STATE_STATUS; - } else { - $this->state = self::STATE_ERROR; - } - } else { - $this->state = self::STATE_ERROR; - } - } - - /** - * Parse the status code - * @return void - */ - protected function status() - { - if ($len = strspn($this->data, '0123456789', $this->position)) { - $this->status_code = (int) substr($this->data, $this->position, $len); - $this->position += $len; - $this->state = self::STATE_REASON; - } else { - $this->state = self::STATE_ERROR; - } - } - - /** - * Parse the reason phrase - * @return void - */ - protected function reason() - { - $len = strcspn($this->data, "\x0A", $this->position); - $this->reason = trim(substr($this->data, $this->position, $len), "\x09\x0D\x20"); - $this->position += $len + 1; - $this->state = self::STATE_NEW_LINE; - } - - private function add_header(string $name, string $value): void - { - if ($this->psr7Compatible) { - // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough. - /** @var array> */ - $headers = &$this->headers; - $headers[$name][] = $value; - } else { - // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough. - /** @var array) */ - $headers = &$this->headers; - $headers[$name] .= ', ' . $value; - } - } - - private function replace_header(string $name, string $value): void - { - if ($this->psr7Compatible) { - // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough. - /** @var array> */ - $headers = &$this->headers; - $headers[$name] = [$value]; - } else { - // For PHPStan: should be enforced by template parameter but PHPStan is not smart enough. - /** @var array) */ - $headers = &$this->headers; - $headers[$name] = $value; - } - } - - /** - * Deal with a new line, shifting data around as needed - * @return void - */ - protected function new_line() - { - $this->value = trim($this->value, "\x0D\x20"); - if ($this->name !== '' && $this->value !== '') { - $this->name = strtolower($this->name); - // We should only use the last Content-Type header. c.f. issue #1 - if (isset($this->headers[$this->name]) && $this->name !== 'content-type') { - $this->add_header($this->name, $this->value); - } else { - $this->replace_header($this->name, $this->value); - } - } - $this->name = ''; - $this->value = ''; - if (substr($this->data[$this->position], 0, 2) === "\x0D\x0A") { - $this->position += 2; - $this->state = self::STATE_BODY; - } elseif ($this->data[$this->position] === "\x0A") { - $this->position++; - $this->state = self::STATE_BODY; - } else { - $this->state = self::STATE_NAME; - } - } - - /** - * Parse a header name - * @return void - */ - protected function name() - { - $len = strcspn($this->data, "\x0A:", $this->position); - if (isset($this->data[$this->position + $len])) { - if ($this->data[$this->position + $len] === "\x0A") { - $this->position += $len; - $this->state = self::STATE_NEW_LINE; - } else { - $this->name = substr($this->data, $this->position, $len); - $this->position += $len + 1; - $this->state = self::STATE_VALUE; - } - } else { - $this->state = self::STATE_ERROR; - } - } - - /** - * Parse LWS, replacing consecutive LWS characters with a single space - * @return void - */ - protected function linear_whitespace() - { - do { - if (substr($this->data, $this->position, 2) === "\x0D\x0A") { - $this->position += 2; - } elseif ($this->data[$this->position] === "\x0A") { - $this->position++; - } - $this->position += strspn($this->data, "\x09\x20", $this->position); - } while ($this->has_data() && $this->is_linear_whitespace()); - $this->value .= "\x20"; - } - - /** - * See what state to move to while within non-quoted header values - * @return void - */ - protected function value() - { - if ($this->is_linear_whitespace()) { - $this->linear_whitespace(); - } else { - switch ($this->data[$this->position]) { - case '"': - // Workaround for ETags: we have to include the quotes as - // part of the tag. - if (strtolower($this->name) === 'etag') { - $this->value .= '"'; - $this->position++; - $this->state = self::STATE_VALUE_CHAR; - break; - } - $this->position++; - $this->state = self::STATE_QUOTE; - break; - - case "\x0A": - $this->position++; - $this->state = self::STATE_NEW_LINE; - break; - - default: - $this->state = self::STATE_VALUE_CHAR; - break; - } - } - } - - /** - * Parse a header value while outside quotes - * @return void - */ - protected function value_char() - { - $len = strcspn($this->data, "\x09\x20\x0A\"", $this->position); - $this->value .= substr($this->data, $this->position, $len); - $this->position += $len; - $this->state = self::STATE_VALUE; - } - - /** - * See what state to move to while within quoted header values - * @return void - */ - protected function quote() - { - if ($this->is_linear_whitespace()) { - $this->linear_whitespace(); - } else { - switch ($this->data[$this->position]) { - case '"': - $this->position++; - $this->state = self::STATE_VALUE; - break; - - case "\x0A": - $this->position++; - $this->state = self::STATE_NEW_LINE; - break; - - case '\\': - $this->position++; - $this->state = self::STATE_QUOTE_ESCAPED; - break; - - default: - $this->state = self::STATE_QUOTE_CHAR; - break; - } - } - } - - /** - * Parse a header value while within quotes - * @return void - */ - protected function quote_char() - { - $len = strcspn($this->data, "\x09\x20\x0A\"\\", $this->position); - $this->value .= substr($this->data, $this->position, $len); - $this->position += $len; - $this->state = self::STATE_VALUE; - } - - /** - * Parse an escaped character within quotes - * @return void - */ - protected function quote_escaped() - { - $this->value .= $this->data[$this->position]; - $this->position++; - $this->state = self::STATE_QUOTE; - } - - /** - * Parse the body - * @return void - */ - protected function body() - { - $this->body = substr($this->data, $this->position); - if (!empty($this->headers['transfer-encoding'])) { - unset($this->headers['transfer-encoding']); - $this->state = self::STATE_CHUNKED; - } else { - $this->state = self::STATE_EMIT; - } - } - - /** - * Parsed a "Transfer-Encoding: chunked" body - * @return void - */ - protected function chunked() - { - if (!preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', trim($this->body))) { - $this->state = self::STATE_EMIT; - return; - } - - $decoded = ''; - $encoded = $this->body; - - while (true) { - $is_chunked = (bool) preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches); - if (!$is_chunked) { - // Looks like it's not chunked after all - $this->state = self::STATE_EMIT; - return; - } - - $length = hexdec(trim($matches[1])); - // For PHPStan: this will only be float when larger than PHP_INT_MAX. - // But even on 32-bit systems, it would mean 2GiB chunk, which sounds unlikely. - \assert(\is_int($length), "Length needs to be shorter than PHP_INT_MAX"); - if ($length === 0) { - // Ignore trailer headers - $this->state = self::STATE_EMIT; - $this->body = $decoded; - return; - } - - $chunk_length = strlen($matches[0]); - $decoded .= substr($encoded, $chunk_length, $length); - $encoded = substr($encoded, $chunk_length + $length + 2); - - // BC for PHP < 8.0: substr() can return bool instead of string - $encoded = ($encoded === false) ? '' : $encoded; - - if (trim($encoded) === '0' || empty($encoded)) { - $this->state = self::STATE_EMIT; - $this->body = $decoded; - return; - } - } - } - - /** - * Prepare headers (take care of proxies headers) - * - * @param string $headers Raw headers - * @param non-negative-int $count Redirection count. Default to 1. - * - * @return string - */ - public static function prepareHeaders(string $headers, int $count = 1) - { - $data = explode("\r\n\r\n", $headers, $count); - $data = array_pop($data); - if (false !== stripos($data, "HTTP/1.0 200 Connection established\r\n")) { - $exploded = explode("\r\n\r\n", $data, 2); - $data = end($exploded); - } - if (false !== stripos($data, "HTTP/1.1 200 Connection established\r\n")) { - $exploded = explode("\r\n\r\n", $data, 2); - $data = end($exploded); - } - return $data; - } -} - -class_alias('SimplePie\HTTP\Parser', 'SimplePie_HTTP_Parser'); diff --git a/core/vendor/simplepie/simplepie/src/HTTP/Psr18Client.php b/core/vendor/simplepie/simplepie/src/HTTP/Psr18Client.php deleted file mode 100644 index b920333e4d..0000000000 --- a/core/vendor/simplepie/simplepie/src/HTTP/Psr18Client.php +++ /dev/null @@ -1,162 +0,0 @@ -httpClient = $httpClient; - $this->requestFactory = $requestFactory; - $this->uriFactory = $uriFactory; - } - - public function getHttpClient(): ClientInterface - { - return $this->httpClient; - } - - public function getRequestFactory(): RequestFactoryInterface - { - return $this->requestFactory; - } - - public function getUriFactory(): UriFactoryInterface - { - return $this->uriFactory; - } - - /** - * send a request and return the response - * - * @param Client::METHOD_* $method - * @param string $url - * @param array $headers - * - * @throws ClientException if anything goes wrong requesting the data - */ - public function request(string $method, string $url, array $headers = []): Response - { - if ($method !== self::METHOD_GET) { - throw new InvalidArgumentException(sprintf( - '%s(): Argument #1 ($method) only supports method "%s".', - __METHOD__, - self::METHOD_GET - ), 1); - } - - if (preg_match('/^http(s)?:\/\//i', $url)) { - return $this->requestUrl($method, $url, $headers); - } - - return $this->requestLocalFile($url); - } - - /** - * @param array $headers - */ - private function requestUrl(string $method, string $url, array $headers): Response - { - $permanentUrl = $url; - $requestedUrl = $url; - $remainingRedirects = $this->allowedRedirects; - - $request = $this->requestFactory->createRequest( - $method, - $this->uriFactory->createUri($requestedUrl) - ); - - foreach ($headers as $name => $value) { - $request = $request->withHeader($name, $value); - } - - do { - $followRedirect = false; - - try { - $response = $this->httpClient->sendRequest($request); - } catch (ClientExceptionInterface $th) { - throw new ClientException($th->getMessage(), $th->getCode(), $th); - } - - $statusCode = $response->getStatusCode(); - - // If we have a redirect - if (in_array($statusCode, [300, 301, 302, 303, 307]) && $response->hasHeader('Location')) { - // Prevent infinity redirect loops - if ($remainingRedirects <= 0) { - break; - } - - $remainingRedirects--; - $followRedirect = true; - - $requestedUrl = $response->getHeaderLine('Location'); - - if ($statusCode === 301) { - $permanentUrl = $requestedUrl; - } - - $request = $request->withUri($this->uriFactory->createUri($requestedUrl)); - } - } while ($followRedirect); - - return new Psr7Response($response, $permanentUrl, $requestedUrl); - } - - private function requestLocalFile(string $path): Response - { - if (!is_readable($path)) { - throw new ClientException(sprintf('file "%s" is not readable', $path)); - } - - try { - $raw = file_get_contents($path); - } catch (Throwable $th) { - throw new ClientException($th->getMessage(), $th->getCode(), $th); - } - - if ($raw === false) { - throw new ClientException('file_get_contents() could not read the file', 1); - } - - return new RawTextResponse($raw, $path); - } -} diff --git a/core/vendor/simplepie/simplepie/src/HTTP/Psr7Response.php b/core/vendor/simplepie/simplepie/src/HTTP/Psr7Response.php deleted file mode 100644 index 418fddf523..0000000000 --- a/core/vendor/simplepie/simplepie/src/HTTP/Psr7Response.php +++ /dev/null @@ -1,91 +0,0 @@ -response = $response; - $this->permanent_url = $permanent_url; - $this->requested_url = $requested_url; - } - - public function get_permanent_uri(): string - { - return $this->permanent_url; - } - - public function get_final_requested_uri(): string - { - return $this->requested_url; - } - - public function get_status_code(): int - { - return $this->response->getStatusCode(); - } - - public function get_headers(): array - { - // The filtering is probably redundant but let’s make PHPStan happy. - return array_filter($this->response->getHeaders(), function (array $header): bool { - return count($header) >= 1; - }); - } - - public function has_header(string $name): bool - { - return $this->response->hasHeader($name); - } - - public function with_header(string $name, $value) - { - return new self($this->response->withHeader($name, $value), $this->permanent_url, $this->requested_url); - } - - public function get_header(string $name): array - { - return $this->response->getHeader($name); - } - - public function get_header_line(string $name): string - { - return $this->response->getHeaderLine($name); - } - - public function get_body_content(): string - { - return $this->response->getBody()->__toString(); - } -} diff --git a/core/vendor/simplepie/simplepie/src/HTTP/RawTextResponse.php b/core/vendor/simplepie/simplepie/src/HTTP/RawTextResponse.php deleted file mode 100644 index fee5e53725..0000000000 --- a/core/vendor/simplepie/simplepie/src/HTTP/RawTextResponse.php +++ /dev/null @@ -1,98 +0,0 @@ -> - */ - private $headers = []; - - /** - * @var string - */ - private $requested_url; - - public function __construct(string $raw_text, string $filepath) - { - $this->raw_text = $raw_text; - $this->permanent_url = $filepath; - $this->requested_url = $filepath; - } - - public function get_permanent_uri(): string - { - return $this->permanent_url; - } - - public function get_final_requested_uri(): string - { - return $this->requested_url; - } - - public function get_status_code(): int - { - return 200; - } - - public function get_headers(): array - { - return $this->headers; - } - - public function has_header(string $name): bool - { - return isset($this->headers[strtolower($name)]); - } - - public function get_header(string $name): array - { - return isset($this->headers[strtolower($name)]) ? $this->headers[$name] : []; - } - - public function with_header(string $name, $value) - { - $new = clone $this; - - $newHeader = [ - strtolower($name) => (array) $value, - ]; - $new->headers = $newHeader + $this->headers; - - return $new; - } - - public function get_header_line(string $name): string - { - return isset($this->headers[strtolower($name)]) ? implode(", ", $this->headers[$name]) : ''; - } - - public function get_body_content(): string - { - return $this->raw_text; - } -} diff --git a/core/vendor/simplepie/simplepie/src/HTTP/Response.php b/core/vendor/simplepie/simplepie/src/HTTP/Response.php deleted file mode 100644 index cc52967586..0000000000 --- a/core/vendor/simplepie/simplepie/src/HTTP/Response.php +++ /dev/null @@ -1,171 +0,0 @@ -get_headers() as $name => $values) { - * echo $name . ': ' . implode(', ', $values); - * } - * - * // Emit headers iteratively: - * foreach ($message->get_headers() as $name => $values) { - * foreach ($values as $value) { - * header(sprintf('%s: %s', $name, $value), false); - * } - * } - * - * @return array> Returns an associative array of the message's headers. - * Each key MUST be a header name, and each value MUST be an array of - * strings for that header. - */ - public function get_headers(): array; - - /** - * Checks if a header exists by the given case-insensitive name. - * - * @param string $name Case-insensitive header field name. - * @return bool Returns true if any header names match the given header - * name using a case-insensitive string comparison. Returns false if - * no matching header name is found in the message. - */ - public function has_header(string $name): bool; - - /** - * Retrieves a message header value by the given case-insensitive name. - * - * This method returns an array of all the header values of the given - * case-insensitive header name. - * - * If the header does not appear in the message, this method MUST return an - * empty array. - * - * @param string $name Case-insensitive header field name. - * @return string[] An array of string values as provided for the given - * header. If the header does not appear in the message, this method MUST - * return an empty array. - */ - public function get_header(string $name): array; - - /** - * Return an instance with the provided value replacing the specified header. - * - * This method MUST be implemented in such a way as to retain the - * immutability of the message, and MUST return an instance that has the - * new and/or updated header and value. - * - * @param string $name Case-insensitive header field name. - * @param string|non-empty-array $value Header value(s). - * @return static - * @throws \InvalidArgumentException for invalid header names or values. - */ - public function with_header(string $name, $value); - - /** - * Retrieves a comma-separated string of the values for a single header. - * - * This method returns all of the header values of the given - * case-insensitive header name as a string concatenated together using - * a comma. - * - * NOTE: Not all header values may be appropriately represented using - * comma concatenation. For such headers, use getHeader() instead - * and supply your own delimiter when concatenating. - * - * If the header does not appear in the message, this method MUST return - * an empty string. - * - * @param string $name Case-insensitive header field name. - * @return string A string of values as provided for the given header - * concatenated together using a comma. If the header does not appear in - * the message, this method MUST return an empty string. - */ - public function get_header_line(string $name): string; - - /** - * get the body as string - * - * @return string - */ - public function get_body_content(): string; -} diff --git a/core/vendor/simplepie/simplepie/src/IRI.php b/core/vendor/simplepie/simplepie/src/IRI.php deleted file mode 100644 index 8ca0a4ae71..0000000000 --- a/core/vendor/simplepie/simplepie/src/IRI.php +++ /dev/null @@ -1,1087 +0,0 @@ -> - */ - protected $normalization = [ - 'acap' => [ - 'port' => 674 - ], - 'dict' => [ - 'port' => 2628 - ], - 'file' => [ - 'ihost' => 'localhost' - ], - 'http' => [ - 'port' => 80, - 'ipath' => '/' - ], - 'https' => [ - 'port' => 443, - 'ipath' => '/' - ], - ]; - - /** - * Return the entire IRI when you try and read the object as a string - * - * @return string - */ - public function __toString() - { - return (string) $this->get_iri(); - } - - /** - * Overload __set() to provide access via properties - * - * @param string $name Property name - * @param mixed $value Property value - * @return void - */ - public function __set(string $name, $value) - { - $callable = [$this, 'set_' . $name]; - if (is_callable($callable)) { - call_user_func($callable, $value); - } elseif ( - $name === 'iauthority' - || $name === 'iuserinfo' - || $name === 'ihost' - || $name === 'ipath' - || $name === 'iquery' - || $name === 'ifragment' - ) { - call_user_func([$this, 'set_' . substr($name, 1)], $value); - } - } - - /** - * Overload __get() to provide access via properties - * - * @param string $name Property name - * @return mixed - */ - public function __get(string $name) - { - // isset() returns false for null, we don't want to do that - // Also why we use array_key_exists below instead of isset() - $props = get_object_vars($this); - - if ( - $name === 'iri' || - $name === 'uri' || - $name === 'iauthority' || - $name === 'authority' - ) { - $return = $this->{"get_$name"}(); - } elseif (array_key_exists($name, $props)) { - $return = $this->$name; - } - // host -> ihost - elseif (array_key_exists($prop = 'i' . $name, $props)) { - $name = $prop; - $return = $this->$prop; - } - // ischeme -> scheme - elseif (($prop = substr($name, 1)) && array_key_exists($prop, $props)) { - $name = $prop; - $return = $this->$prop; - } else { - trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE); - $return = null; - } - - if ($return === null && isset($this->normalization[$this->scheme][$name])) { - return $this->normalization[$this->scheme][$name]; - } - - return $return; - } - - /** - * Overload __isset() to provide access via properties - * - * @param string $name Property name - * @return bool - */ - public function __isset(string $name) - { - return method_exists($this, 'get_' . $name) || isset($this->$name); - } - - /** - * Overload __unset() to provide access via properties - * - * @param string $name Property name - * @return void - */ - public function __unset(string $name) - { - $callable = [$this, 'set_' . $name]; - if (is_callable($callable)) { - call_user_func($callable, ''); - } - } - - /** - * Create a new IRI object, from a specified string - * - * @param string|null $iri - */ - public function __construct(?string $iri = null) - { - $this->set_iri($iri); - } - - /** - * Clean up - * @return void - */ - public function __destruct() - { - $this->set_iri(null, true); - $this->set_path(null, true); - $this->set_authority(null, true); - } - - /** - * Create a new IRI object by resolving a relative IRI - * - * Returns false if $base is not absolute, otherwise an IRI. - * - * @param IRI|string $base (Absolute) Base IRI - * @param IRI|string $relative Relative IRI - * @return IRI|false - */ - public static function absolutize($base, $relative) - { - if (!($relative instanceof IRI)) { - $relative = new IRI($relative); - } - if (!$relative->is_valid()) { - return false; - } elseif ($relative->scheme !== null) { - return clone $relative; - } else { - if (!($base instanceof IRI)) { - $base = new IRI($base); - } - if ($base->scheme !== null && $base->is_valid()) { - if ($relative->get_iri() !== '') { - if ($relative->iuserinfo !== null || $relative->ihost !== null || $relative->port !== null) { - $target = clone $relative; - $target->scheme = $base->scheme; - } else { - $target = new IRI(); - $target->scheme = $base->scheme; - $target->iuserinfo = $base->iuserinfo; - $target->ihost = $base->ihost; - $target->port = $base->port; - if ($relative->ipath !== '') { - if ($relative->ipath[0] === '/') { - $target->ipath = $relative->ipath; - } elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') { - $target->ipath = '/' . $relative->ipath; - } elseif (($last_segment = strrpos($base->ipath, '/')) !== false) { - $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath; - } else { - $target->ipath = $relative->ipath; - } - $target->ipath = $target->remove_dot_segments($target->ipath); - $target->iquery = $relative->iquery; - } else { - $target->ipath = $base->ipath; - if ($relative->iquery !== null) { - $target->iquery = $relative->iquery; - } elseif ($base->iquery !== null) { - $target->iquery = $base->iquery; - } - } - $target->ifragment = $relative->ifragment; - } - } else { - $target = clone $base; - $target->ifragment = null; - } - $target->scheme_normalization(); - return $target; - } - - return false; - } - } - - /** - * Parse an IRI into scheme/authority/path/query/fragment segments - * - * @param string $iri - * @return array{ - * scheme: string|null, - * authority: string|null, - * path: string, - * query: string|null, - * fragment: string|null, - * }|false - */ - protected function parse_iri(string $iri) - { - $iri = trim($iri, "\x20\x09\x0A\x0C\x0D"); - if (preg_match('/^(?:(?P[^:\/?#]+):)?(:?\/\/(?P[^\/?#]*))?(?P[^?#]*)(?:\?(?P[^#]*))?(?:#(?P.*))?$/', $iri, $match, \PREG_UNMATCHED_AS_NULL)) { - // TODO: Remove once we require PHP ≥ 7.4. - $match['query'] = $match['query'] ?? null; - $match['fragment'] = $match['fragment'] ?? null; - return $match; - } - - // This can occur when a paragraph is accidentally parsed as a URI - return false; - } - - /** - * Remove dot segments from a path - * - * @param string $input - * @return string - */ - protected function remove_dot_segments(string $input) - { - $output = ''; - while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') { - // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, - if (strpos($input, '../') === 0) { - $input = substr($input, 3); - } elseif (strpos($input, './') === 0) { - $input = substr($input, 2); - } - // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise, - elseif (strpos($input, '/./') === 0) { - $input = substr($input, 2); - } elseif ($input === '/.') { - $input = '/'; - } - // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, - elseif (strpos($input, '/../') === 0) { - $input = substr($input, 3); - $output = substr_replace($output, '', intval(strrpos($output, '/'))); - } elseif ($input === '/..') { - $input = '/'; - $output = substr_replace($output, '', intval(strrpos($output, '/'))); - } - // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, - elseif ($input === '.' || $input === '..') { - $input = ''; - } - // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer - elseif (($pos = strpos($input, '/', 1)) !== false) { - $output .= substr($input, 0, $pos); - $input = substr_replace($input, '', 0, $pos); - } else { - $output .= $input; - $input = ''; - } - } - return $output . $input; - } - - /** - * Replace invalid character with percent encoding - * - * @param string $string Input string - * @param string $extra_chars Valid characters not in iunreserved or - * iprivate (this is ASCII-only) - * @param bool $iprivate Allow iprivate - * @return string - */ - protected function replace_invalid_with_pct_encoding(string $string, string $extra_chars, bool $iprivate = false) - { - // Normalize as many pct-encoded sections as possible - $string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', [$this, 'remove_iunreserved_percent_encoded'], $string); - \assert(\is_string($string), "For PHPStan: Should not occur, the regex is valid"); - - // Replace invalid percent characters - $string = preg_replace('/%(?![A-Fa-f0-9]{2})/', '%25', $string); - \assert(\is_string($string), "For PHPStan: Should not occur, the regex is valid"); - - // Add unreserved and % to $extra_chars (the latter is safe because all - // pct-encoded sections are now valid). - $extra_chars .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~%'; - - // Now replace any bytes that aren't allowed with their pct-encoded versions - $position = 0; - $strlen = strlen($string); - while (($position += strspn($string, $extra_chars, $position)) < $strlen) { - $value = ord($string[$position]); - $character = 0; - - // Start position - $start = $position; - - // By default we are valid - $valid = true; - - // No one byte sequences are valid due to the while. - // Two byte sequence: - if (($value & 0xE0) === 0xC0) { - $character = ($value & 0x1F) << 6; - $length = 2; - $remaining = 1; - } - // Three byte sequence: - elseif (($value & 0xF0) === 0xE0) { - $character = ($value & 0x0F) << 12; - $length = 3; - $remaining = 2; - } - // Four byte sequence: - elseif (($value & 0xF8) === 0xF0) { - $character = ($value & 0x07) << 18; - $length = 4; - $remaining = 3; - } - // Invalid byte: - else { - $valid = false; - $length = 1; - $remaining = 0; - } - - if ($remaining) { - if ($position + $length <= $strlen) { - for ($position++; $remaining; $position++) { - $value = ord($string[$position]); - - // Check that the byte is valid, then add it to the character: - if (($value & 0xC0) === 0x80) { - $character |= ($value & 0x3F) << (--$remaining * 6); - } - // If it is invalid, count the sequence as invalid and reprocess the current byte: - else { - $valid = false; - $position--; - break; - } - } - } else { - $position = $strlen - 1; - $valid = false; - } - } - - // Percent encode anything invalid or not in ucschar - if ( - // Invalid sequences - !$valid - // Non-shortest form sequences are invalid - || $length > 1 && $character <= 0x7F - || $length > 2 && $character <= 0x7FF - || $length > 3 && $character <= 0xFFFF - // Outside of range of ucschar codepoints - // Noncharacters - || ($character & 0xFFFE) === 0xFFFE - || $character >= 0xFDD0 && $character <= 0xFDEF - || ( - // Everything else not in ucschar - $character > 0xD7FF && $character < 0xF900 - || $character < 0xA0 - || $character > 0xEFFFD - ) - && ( - // Everything not in iprivate, if it applies - !$iprivate - || $character < 0xE000 - || $character > 0x10FFFD - ) - ) { - // If we were a character, pretend we weren't, but rather an error. - if ($valid) { - $position--; - } - - for ($j = $start; $j <= $position; $j++) { - $string = substr_replace($string, sprintf('%%%02X', ord($string[$j])), $j, 1); - $j += 2; - $position += 2; - $strlen += 2; - } - } - } - - return $string; - } - - /** - * Callback function for preg_replace_callback. - * - * Removes sequences of percent encoded bytes that represent UTF-8 - * encoded characters in iunreserved - * - * @param array{string} $match PCRE match, a capture group #0 consisting of a sequence of valid percent-encoded bytes - * @return string Replacement - */ - protected function remove_iunreserved_percent_encoded(array $match) - { - // As we just have valid percent encoded sequences we can just explode - // and ignore the first member of the returned array (an empty string). - $bytes = explode('%', $match[0]); - - // Initialize the new string (this is what will be returned) and that - // there are no bytes remaining in the current sequence (unsurprising - // at the first byte!). - $string = ''; - $remaining = 0; - - // these variables will be initialized in the loop but PHPStan is not able to detect it currently - $start = 0; - $character = 0; - $length = 0; - $valid = true; - - // Loop over each and every byte, and set $value to its value - for ($i = 1, $len = count($bytes); $i < $len; $i++) { - $value = hexdec($bytes[$i]); - - // If we're the first byte of sequence: - if (!$remaining) { - // Start position - $start = $i; - - // By default we are valid - $valid = true; - - // One byte sequence: - if ($value <= 0x7F) { - $character = $value; - $length = 1; - } - // Two byte sequence: - elseif (($value & 0xE0) === 0xC0) { - $character = ($value & 0x1F) << 6; - $length = 2; - $remaining = 1; - } - // Three byte sequence: - elseif (($value & 0xF0) === 0xE0) { - $character = ($value & 0x0F) << 12; - $length = 3; - $remaining = 2; - } - // Four byte sequence: - elseif (($value & 0xF8) === 0xF0) { - $character = ($value & 0x07) << 18; - $length = 4; - $remaining = 3; - } - // Invalid byte: - else { - $valid = false; - $remaining = 0; - } - } - // Continuation byte: - else { - // Check that the byte is valid, then add it to the character: - if (($value & 0xC0) === 0x80) { - $remaining--; - $character |= ($value & 0x3F) << ($remaining * 6); - } - // If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence: - else { - $valid = false; - $remaining = 0; - $i--; - } - } - - // If we've reached the end of the current byte sequence, append it to Unicode::$data - if (!$remaining) { - // Percent encode anything invalid or not in iunreserved - if ( - // Invalid sequences - !$valid - // Non-shortest form sequences are invalid - || $length > 1 && $character <= 0x7F - || $length > 2 && $character <= 0x7FF - || $length > 3 && $character <= 0xFFFF - // Outside of range of iunreserved codepoints - || $character < 0x2D - || $character > 0xEFFFD - // Noncharacters - || ($character & 0xFFFE) === 0xFFFE - || $character >= 0xFDD0 && $character <= 0xFDEF - // Everything else not in iunreserved (this is all BMP) - || $character === 0x2F - || $character > 0x39 && $character < 0x41 - || $character > 0x5A && $character < 0x61 - || $character > 0x7A && $character < 0x7E - || $character > 0x7E && $character < 0xA0 - || $character > 0xD7FF && $character < 0xF900 - ) { - for ($j = $start; $j <= $i; $j++) { - $string .= '%' . strtoupper($bytes[$j]); - } - } else { - for ($j = $start; $j <= $i; $j++) { - // Cast for PHPStan, this will always be a number between 0 and 0xFF so hexdec will return int. - $string .= chr((int) hexdec($bytes[$j])); - } - } - } - } - - // If we have any bytes left over they are invalid (i.e., we are - // mid-way through a multi-byte sequence) - if ($remaining) { - for ($j = $start; $j < $len; $j++) { - $string .= '%' . strtoupper($bytes[$j]); - } - } - - return $string; - } - - /** - * @return void - */ - protected function scheme_normalization() - { - $scheme = $this->scheme ?? ''; - - if (isset($this->normalization[$scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$scheme]['iuserinfo']) { - $this->iuserinfo = null; - } - if (isset($this->normalization[$scheme]['ihost']) && $this->ihost === $this->normalization[$scheme]['ihost']) { - $this->ihost = null; - } - if (isset($this->normalization[$scheme]['port']) && $this->port === $this->normalization[$scheme]['port']) { - $this->port = null; - } - if (isset($this->normalization[$scheme]['ipath']) && $this->ipath === $this->normalization[$scheme]['ipath']) { - $this->ipath = ''; - } - if (isset($this->normalization[$scheme]['iquery']) && $this->iquery === $this->normalization[$scheme]['iquery']) { - $this->iquery = null; - } - if (isset($this->normalization[$scheme]['ifragment']) && $this->ifragment === $this->normalization[$scheme]['ifragment']) { - $this->ifragment = null; - } - } - - /** - * Check if the object represents a valid IRI. This needs to be done on each - * call as some things change depending on another part of the IRI. - * - * @return bool - */ - public function is_valid() - { - if ($this->ipath === '') { - return true; - } - - $isauthority = $this->iuserinfo !== null || $this->ihost !== null || - $this->port !== null; - if ($isauthority && $this->ipath[0] === '/') { - return true; - } - - if (!$isauthority && (substr($this->ipath, 0, 2) === '//')) { - return false; - } - - // Relative urls cannot have a colon in the first path segment (and the - // slashes themselves are not included so skip the first character). - if (!$this->scheme && !$isauthority && - strpos($this->ipath, ':') !== false && - strpos($this->ipath, '/', 1) !== false && - strpos($this->ipath, ':') < strpos($this->ipath, '/', 1)) { - return false; - } - - return true; - } - - /** - * Set the entire IRI. Returns true on success, false on failure (if there - * are any invalid characters). - * - * @param string|null $iri - * @return bool - */ - public function set_iri(?string $iri, bool $clear_cache = false) - { - static $cache; - if ($clear_cache) { - $cache = null; - return false; - } - if (!$cache) { - $cache = []; - } - - if ($iri === null) { - return true; - } elseif (isset($cache[$iri])) { - [ - $this->scheme, - $this->iuserinfo, - $this->ihost, - $this->port, - $this->ipath, - $this->iquery, - $this->ifragment, - $return - ] = $cache[$iri]; - - return $return; - } - - $parsed = $this->parse_iri((string) $iri); - if (!$parsed) { - return false; - } - - $return = $this->set_scheme($parsed['scheme']) - && $this->set_authority($parsed['authority']) - && $this->set_path($parsed['path']) - && $this->set_query($parsed['query']) - && $this->set_fragment($parsed['fragment']); - - $cache[$iri] = [ - $this->scheme, - $this->iuserinfo, - $this->ihost, - $this->port, - $this->ipath, - $this->iquery, - $this->ifragment, - $return - ]; - - return $return; - } - - /** - * Set the scheme. Returns true on success, false on failure (if there are - * any invalid characters). - * - * @param string|null $scheme - * @return bool - */ - public function set_scheme(?string $scheme) - { - if ($scheme === null) { - $this->scheme = null; - } elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) { - $this->scheme = null; - return false; - } else { - $this->scheme = strtolower($scheme); - } - return true; - } - - /** - * Set the authority. Returns true on success, false on failure (if there are - * any invalid characters). - * - * @param string|null $authority - * @return bool - */ - public function set_authority(?string $authority, bool $clear_cache = false) - { - static $cache; - if ($clear_cache) { - $cache = null; - return false; - } - if (!$cache) { - $cache = []; - } - - if ($authority === null) { - $this->iuserinfo = null; - $this->ihost = null; - $this->port = null; - return true; - } elseif (isset($cache[$authority])) { - [ - $this->iuserinfo, - $this->ihost, - $this->port, - $return - ] = $cache[$authority]; - - return $return; - } - - $remaining = $authority; - if (($iuserinfo_end = strrpos($remaining, '@')) !== false) { - // Cast for PHPStan on PHP < 8.0. It does not detect that - // the range is not flipped so substr cannot return false. - $iuserinfo = (string) substr($remaining, 0, $iuserinfo_end); - $remaining = substr($remaining, $iuserinfo_end + 1); - } else { - $iuserinfo = null; - } - if (($port_start = strpos($remaining, ':', intval(strpos($remaining, ']')))) !== false) { - $port = substr($remaining, $port_start + 1); - if ($port === false) { - $port = null; - } - $remaining = substr($remaining, 0, $port_start); - } else { - $port = null; - } - - $return = $this->set_userinfo($iuserinfo) && - $this->set_host($remaining) && - $this->set_port($port); - - $cache[$authority] = [ - $this->iuserinfo, - $this->ihost, - $this->port, - $return - ]; - - return $return; - } - - /** - * Set the iuserinfo. - * - * @param string|null $iuserinfo - * @return bool - */ - public function set_userinfo(?string $iuserinfo) - { - if ($iuserinfo === null) { - $this->iuserinfo = null; - } else { - $this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\'()*+,;=:'); - $this->scheme_normalization(); - } - - return true; - } - - /** - * Set the ihost. Returns true on success, false on failure (if there are - * any invalid characters). - * - * @param string|null $ihost - * @return bool - */ - public function set_host(?string $ihost) - { - if ($ihost === null) { - $this->ihost = null; - return true; - } elseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']') { - if (\SimplePie\Net\IPv6::check_ipv6(substr($ihost, 1, -1))) { - $this->ihost = '[' . \SimplePie\Net\IPv6::compress(substr($ihost, 1, -1)) . ']'; - } else { - $this->ihost = null; - return false; - } - } else { - $ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\'()*+,;='); - - // Lowercase, but ignore pct-encoded sections (as they should - // remain uppercase). This must be done after the previous step - // as that can add unescaped characters. - $position = 0; - $strlen = strlen($ihost); - while (($position += strcspn($ihost, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ%', $position)) < $strlen) { - if ($ihost[$position] === '%') { - $position += 3; - } else { - $ihost[$position] = strtolower($ihost[$position]); - $position++; - } - } - - $this->ihost = $ihost; - } - - $this->scheme_normalization(); - - return true; - } - - /** - * Set the port. Returns true on success, false on failure (if there are - * any invalid characters). - * - * @param string|int|null $port - * @return bool - */ - public function set_port($port) - { - if ($port === null) { - $this->port = null; - return true; - } elseif (strspn((string) $port, '0123456789') === strlen((string) $port)) { - $this->port = (int) $port; - $this->scheme_normalization(); - return true; - } - - $this->port = null; - return false; - } - - /** - * Set the ipath. - * - * @param string|null $ipath - * @return bool - */ - public function set_path(?string $ipath, bool $clear_cache = false) - { - static $cache; - if ($clear_cache) { - $cache = null; - return false; - } - if (!$cache) { - $cache = []; - } - - $ipath = (string) $ipath; - - if (isset($cache[$ipath])) { - $this->ipath = $cache[$ipath][(int) ($this->scheme !== null)]; - } else { - $valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/'); - $removed = $this->remove_dot_segments($valid); - - $cache[$ipath] = [$valid, $removed]; - $this->ipath = ($this->scheme !== null) ? $removed : $valid; - } - - $this->scheme_normalization(); - return true; - } - - /** - * Set the iquery. - * - * @param string|null $iquery - * @return bool - */ - public function set_query(?string $iquery) - { - if ($iquery === null) { - $this->iquery = null; - } else { - $this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\'()*+,;=:@/?', true); - $this->scheme_normalization(); - } - return true; - } - - /** - * Set the ifragment. - * - * @param string|null $ifragment - * @return bool - */ - public function set_fragment(?string $ifragment) - { - if ($ifragment === null) { - $this->ifragment = null; - } else { - $this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\'()*+,;=:@/?'); - $this->scheme_normalization(); - } - return true; - } - - /** - * Convert an IRI to a URI (or parts thereof) - * - * @param string $string - * @return string - */ - public function to_uri(string $string) - { - static $non_ascii; - if (!$non_ascii) { - $non_ascii = implode('', range("\x80", "\xFF")); - } - - $position = 0; - $strlen = strlen($string); - while (($position += strcspn($string, $non_ascii, $position)) < $strlen) { - $string = substr_replace($string, sprintf('%%%02X', ord($string[$position])), $position, 1); - $position += 3; - $strlen += 2; - } - - return $string; - } - - /** - * Get the complete IRI - * - * @return string|false - */ - public function get_iri() - { - if (!$this->is_valid()) { - return false; - } - - $iri = ''; - if ($this->scheme !== null) { - $iri .= $this->scheme . ':'; - } - if (($iauthority = $this->get_iauthority()) !== null) { - $iri .= '//' . $iauthority; - } - if ($this->ipath !== '') { - $iri .= $this->ipath; - } elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '') { - $iri .= $this->normalization[$this->scheme]['ipath']; - } - if ($this->iquery !== null) { - $iri .= '?' . $this->iquery; - } - if ($this->ifragment !== null) { - $iri .= '#' . $this->ifragment; - } - - return $iri; - } - - /** - * Get the complete URI - * - * @return string - */ - public function get_uri() - { - return $this->to_uri((string) $this->get_iri()); - } - - /** - * Get the complete iauthority - * - * @return ?string - */ - protected function get_iauthority() - { - if ($this->iuserinfo !== null || $this->ihost !== null || $this->port !== null) { - $iauthority = ''; - if ($this->iuserinfo !== null) { - $iauthority .= $this->iuserinfo . '@'; - } - if ($this->ihost !== null) { - $iauthority .= $this->ihost; - } - if ($this->port !== null && $this->port !== 0) { - $iauthority .= ':' . $this->port; - } - return $iauthority; - } - - return null; - } - - /** - * Get the complete authority - * - * @return ?string - */ - protected function get_authority() - { - $iauthority = $this->get_iauthority(); - if (is_string($iauthority)) { - return $this->to_uri($iauthority); - } - - return $iauthority; - } -} - -class_alias('SimplePie\IRI', 'SimplePie_IRI'); diff --git a/core/vendor/simplepie/simplepie/src/Item.php b/core/vendor/simplepie/simplepie/src/Item.php deleted file mode 100644 index c2f7460c61..0000000000 --- a/core/vendor/simplepie/simplepie/src/Item.php +++ /dev/null @@ -1,2366 +0,0 @@ - - */ - public $data = []; - - /** - * Registry object - * - * @see set_registry - * @var \SimplePie\Registry - */ - protected $registry; - - /** - * @var Sanitize|null - */ - private $sanitize = null; - - /** - * Create a new item object - * - * This is usually used by {@see \SimplePie\SimplePie::get_items} and - * {@see \SimplePie\SimplePie::get_item}. Avoid creating this manually. - * - * @param \SimplePie\SimplePie $feed Parent feed - * @param array $data Raw data - */ - public function __construct(\SimplePie\SimplePie $feed, array $data) - { - $this->feed = $feed; - $this->data = $data; - } - - /** - * Set the registry handler - * - * This is usually used by {@see \SimplePie\Registry::create} - * - * @since 1.3 - * @param \SimplePie\Registry $registry - * @return void - */ - public function set_registry(\SimplePie\Registry $registry) - { - $this->registry = $registry; - } - - /** - * Get a string representation of the item - * - * @return string - */ - public function __toString() - { - return md5(serialize($this->data)); - } - - /** - * Remove items that link back to this before destroying this object - */ - public function __destruct() - { - if (!gc_enabled()) { - unset($this->feed); - } - } - - /** - * Get data for an item-level element - * - * This method allows you to get access to ANY element/attribute that is a - * sub-element of the item/entry tag. - * - * See {@see \SimplePie\SimplePie::get_feed_tags()} for a description of the return value - * - * @since 1.0 - * @see http://simplepie.org/wiki/faq/supported_xml_namespaces - * @param string $namespace The URL of the XML namespace of the elements you're trying to access - * @param string $tag Tag name - * @return array>|null - */ - public function get_item_tags(string $namespace, string $tag) - { - if (isset($this->data['child'][$namespace][$tag])) { - return $this->data['child'][$namespace][$tag]; - } - - return null; - } - - /** - * Get base URL of the item itself. - * Returns `` or feed base URL. - * Similar to `Item::get_base()` but can safely be used during initialisation methods - * such as `Item::get_links()` (`Item::get_base()` and `Item::get_links()` call each-other) - * and is not affected by enclosures. - * - * @param array $element - * @see get_base - */ - private function get_own_base(array $element = []): string - { - if (!empty($element['xml_base_explicit']) && isset($element['xml_base'])) { - return $element['xml_base']; - } - return $this->feed->get_base(); - } - - /** - * Get the base URL value. - * Uses ``, or item link, or enclosure link, or feed base URL. - * - * @param array $element - * @return string - */ - public function get_base(array $element = []) - { - if (!empty($element['xml_base_explicit']) && isset($element['xml_base'])) { - return $element['xml_base']; - } - $link = $this->get_permalink(); - if ($link != null) { - return $link; - } - return $this->feed->get_base($element); - } - - /** - * Sanitize feed data - * - * @access private - * @see \SimplePie\SimplePie::sanitize() - * @param string $data Data to sanitize - * @param int-mask-of $type - * @param string $base Base URL to resolve URLs against - * @return string Sanitized data - */ - public function sanitize(string $data, int $type, string $base = '') - { - // This really returns string|false but changing encoding is uncommon and we are going to deprecate it, so let’s just lie to PHPStan in the interest of cleaner annotations. - return $this->feed->sanitize($data, $type, $base); - } - - /** - * Get the parent feed - * - * Note: this may not work as you think for multifeeds! - * - * @link http://simplepie.org/faq/typical_multifeed_gotchas#missing_data_from_feed - * @since 1.0 - * @return \SimplePie\SimplePie - */ - public function get_feed() - { - return $this->feed; - } - - /** - * Get the unique identifier for the item - * - * This is usually used when writing code to check for new items in a feed. - * - * Uses ``, ``, `` or the `about` attribute - * for RDF. If none of these are supplied (or `$hash` is true), creates an - * MD5 hash based on the permalink, title and content. - * - * @since Beta 2 - * @param bool $hash Should we force using a hash instead of the supplied ID? - * @param string|false $fn User-supplied function to generate an hash - * @return string|null - */ - public function get_id(bool $hash = false, $fn = 'md5') - { - if (!$hash) { - if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'id')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'id')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'guid')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'identifier')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'identifier')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif (isset($this->data['attribs'][\SimplePie\SimplePie::NAMESPACE_RDF]['about'])) { - return $this->sanitize($this->data['attribs'][\SimplePie\SimplePie::NAMESPACE_RDF]['about'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - } - if ($fn === false) { - return null; - } elseif (!is_callable($fn)) { - trigger_error('User-supplied function $fn must be callable', E_USER_WARNING); - $fn = 'md5'; - } - return call_user_func( - $fn, - $this->get_permalink().$this->get_title().$this->get_content() - ); - } - - /** - * Get the title of the item - * - * Uses ``, `` or `<dc:title>` - * - * @since Beta 2 (previously called `get_item_title` since 0.8) - * @return string|null - */ - public function get_title() - { - if (!isset($this->data['title'])) { - if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'title')) { - $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'title')) { - $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'title')) { - $this->data['title'] = $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'title')) { - $this->data['title'] = $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'title')) { - $this->data['title'] = $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'title')) { - $this->data['title'] = $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'title')) { - $this->data['title'] = $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $this->data['title'] = null; - } - } - return $this->data['title']; - } - - /** - * Get the content for the item - * - * Prefers summaries over full content , but will return full content if a - * summary does not exist. - * - * To prefer full content instead, use {@see get_content} - * - * Uses `<atom:summary>`, `<description>`, `<dc:description>` or - * `<itunes:subtitle>` - * - * @since 0.8 - * @param bool $description_only Should we avoid falling back to the content? - * @return string|null - */ - public function get_description(bool $description_only = false) - { - if (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'summary')) && - ($return = $this->sanitize($tags[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$tags[0]['attribs']]), $this->get_base($tags[0])))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'summary')) && - ($return = $this->sanitize($tags[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$tags[0]['attribs']]), $this->get_base($tags[0])))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'description')) && - ($return = $this->sanitize($tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($tags[0])))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'description')) && - ($return = $this->sanitize($tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_HTML, $this->get_base($tags[0])))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'description')) && - ($return = $this->sanitize($tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'description')) && - ($return = $this->sanitize($tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'summary')) && - ($return = $this->sanitize($tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_HTML, $this->get_base($tags[0])))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'subtitle')) && - ($return = $this->sanitize($tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'description')) && - ($return = $this->sanitize($tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_HTML))) { - return $return; - } elseif (!$description_only) { - return $this->get_content(true); - } - - return null; - } - - /** - * Get the content for the item - * - * Prefers full content over summaries, but will return a summary if full - * content does not exist. - * - * To prefer summaries instead, use {@see get_description} - * - * Uses `<atom:content>` or `<content:encoded>` (RSS 1.0 Content Module) - * - * @since 1.0 - * @param bool $content_only Should we avoid falling back to the description? - * @return string|null - */ - public function get_content(bool $content_only = false) - { - if (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'content')) && - ($return = $this->sanitize($tags[0]['data'], $this->registry->call(Misc::class, 'atom_10_content_construct_type', [$tags[0]['attribs']]), $this->get_base($tags[0])))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'content')) && - ($return = $this->sanitize($tags[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$tags[0]['attribs']]), $this->get_base($tags[0])))) { - return $return; - } elseif (($tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded')) && - ($return = $this->sanitize($tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_HTML, $this->get_base($tags[0])))) { - return $return; - } elseif (!$content_only) { - return $this->get_description(true); - } - - return null; - } - - /** - * Get the media:thumbnail of the item - * - * Uses `<media:thumbnail>` - * - * - * @return array{url: string, height?: string, width?: string, time?: string}|null - */ - public function get_thumbnail() - { - if (!isset($this->data['thumbnail'])) { - if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'thumbnail')) { - $thumbnail = $return[0]['attribs']['']; - if (empty($thumbnail['url'])) { - $this->data['thumbnail'] = null; - } else { - $thumbnail['url'] = $this->sanitize($thumbnail['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($return[0])); - $this->data['thumbnail'] = $thumbnail; - } - } else { - $this->data['thumbnail'] = null; - } - } - return $this->data['thumbnail']; - } - - /** - * Get a category for the item - * - * @since Beta 3 (previously called `get_categories()` since Beta 2) - * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1 - * @return \SimplePie\Category|null - */ - public function get_category(int $key = 0) - { - $categories = $this->get_categories(); - if (isset($categories[$key])) { - return $categories[$key]; - } - - return null; - } - - /** - * Get all categories for the item - * - * Uses `<atom:category>`, `<category>` or `<dc:subject>` - * - * @since Beta 3 - * @return \SimplePie\Category[]|null List of {@see \SimplePie\Category} objects - */ - public function get_categories() - { - $categories = []; - - $type = 'category'; - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, $type) as $category) { - $term = null; - $scheme = null; - $label = null; - if (isset($category['attribs']['']['term'])) { - $term = $this->sanitize($category['attribs']['']['term'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['scheme'])) { - $scheme = $this->sanitize($category['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['label'])) { - $label = $this->sanitize($category['attribs']['']['label'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $categories[] = $this->registry->create(Category::class, [$term, $scheme, $label, $type]); - } - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, $type) as $category) { - // This is really the label, but keep this as the term also for BC. - // Label will also work on retrieving because that falls back to term. - $term = $this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - if (isset($category['attribs']['']['domain'])) { - $scheme = $this->sanitize($category['attribs']['']['domain'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $scheme = null; - } - $categories[] = $this->registry->create(Category::class, [$term, $scheme, null, $type]); - } - - $type = 'subject'; - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, $type) as $category) { - $categories[] = $this->registry->create(Category::class, [$this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null, $type]); - } - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, $type) as $category) { - $categories[] = $this->registry->create(Category::class, [$this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null, $type]); - } - - if (!empty($categories)) { - return array_unique($categories); - } - - return null; - } - - /** - * Get an author for the item - * - * @since Beta 2 - * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1 - * @return \SimplePie\Author|null - */ - public function get_author(int $key = 0) - { - $authors = $this->get_authors(); - if (isset($authors[$key])) { - return $authors[$key]; - } - - return null; - } - - /** - * Get a contributor for the item - * - * @since 1.1 - * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1 - * @return \SimplePie\Author|null - */ - public function get_contributor(int $key = 0) - { - $contributors = $this->get_contributors(); - if (isset($contributors[$key])) { - return $contributors[$key]; - } - - return null; - } - - /** - * Get all contributors for the item - * - * Uses `<atom:contributor>` - * - * @since 1.1 - * @return \SimplePie\Author[]|null List of {@see \SimplePie\Author} objects - */ - public function get_contributors() - { - $contributors = []; - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'contributor') as $contributor) { - $name = null; - $uri = null; - $email = null; - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'])) { - $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) { - $uri = $contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]; - $uri = $this->sanitize($uri['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($uri)); - } - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) { - $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $uri !== null) { - $contributors[] = $this->registry->create(Author::class, [$name, $uri, $email]); - } - } - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'contributor') as $contributor) { - $name = null; - $url = null; - $email = null; - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'])) { - $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) { - $url = $contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]; - $url = $this->sanitize($url['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($url)); - } - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) { - $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $url !== null) { - $contributors[] = $this->registry->create(Author::class, [$name, $url, $email]); - } - } - - if (!empty($contributors)) { - return array_unique($contributors); - } - - return null; - } - - /** - * Get all authors for the item - * - * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>` - * - * @since Beta 2 - * @return \SimplePie\Author[]|null List of {@see \SimplePie\Author} objects - */ - public function get_authors() - { - $authors = []; - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'author') as $author) { - $name = null; - $uri = null; - $email = null; - if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'])) { - $name = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) { - $uri = $author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]; - $uri = $this->sanitize($uri['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($uri)); - } - if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) { - $email = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $uri !== null) { - $authors[] = $this->registry->create(Author::class, [$name, $uri, $email]); - } - } - if ($author = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'author')) { - $name = null; - $url = null; - $email = null; - if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'])) { - $name = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) { - $url = $author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]; - $url = $this->sanitize($url['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($url)); - } - if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) { - $email = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $url !== null) { - $authors[] = $this->registry->create(Author::class, [$name, $url, $email]); - } - } - if ($author = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'author')) { - $authors[] = $this->registry->create(Author::class, [null, null, $this->sanitize($author[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT)]); - } - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'creator') as $author) { - $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); - } - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'creator') as $author) { - $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); - } - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'author') as $author) { - $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); - } - - if (!empty($authors)) { - return array_unique($authors); - } elseif (($source = $this->get_source()) && ($authors = $source->get_authors())) { - return $authors; - } elseif ($authors = $this->feed->get_authors()) { - return $authors; - } - - return null; - } - - /** - * Get the copyright info for the item - * - * Uses `<atom:rights>` or `<dc:rights>` - * - * @since 1.1 - * @return string|null - */ - public function get_copyright() - { - if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'rights')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'rights')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'rights')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - - return null; - } - - /** - * Get the posting date/time for the item - * - * Uses `<atom:published>`, `<atom:updated>`, `<atom:issued>`, - * `<atom:modified>`, `<pubDate>` or `<dc:date>` - * - * Note: obeys PHP's timezone setting. To get a UTC date/time, use - * {@see get_gmdate} - * - * @since Beta 2 (previously called `get_item_date` since 0.8) - * - * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data) - * @return ($date_format is 'U' ? ?int : ?string) - */ - public function get_date(string $date_format = 'j F Y, g:i a') - { - if (!isset($this->data['date'])) { - if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'published')) { - $this->data['date']['raw'] = $return[0]['data']; - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'pubDate')) { - $this->data['date']['raw'] = $return[0]['data']; - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'date')) { - $this->data['date']['raw'] = $return[0]['data']; - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'date')) { - $this->data['date']['raw'] = $return[0]['data']; - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'updated')) { - $this->data['date']['raw'] = $return[0]['data']; - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'issued')) { - $this->data['date']['raw'] = $return[0]['data']; - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'created')) { - $this->data['date']['raw'] = $return[0]['data']; - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'modified')) { - $this->data['date']['raw'] = $return[0]['data']; - } - - if (!empty($this->data['date']['raw'])) { - $parser = $this->registry->call(Parse\Date::class, 'get'); - $this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']) ?: null; - } else { - $this->data['date'] = null; - } - } - if ($this->data['date']) { - switch ($date_format) { - case '': - return $this->sanitize($this->data['date']['raw'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - - case 'U': - return $this->data['date']['parsed']; - - default: - return date($date_format, $this->data['date']['parsed']); - } - } - - return null; - } - - /** - * Get the update date/time for the item - * - * Uses `<atom:updated>` - * - * Note: obeys PHP's timezone setting. To get a UTC date/time, use - * {@see get_gmdate} - * - * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data) - * @return ($date_format is 'U' ? ?int : ?string) - */ - public function get_updated_date(string $date_format = 'j F Y, g:i a') - { - if (!isset($this->data['updated'])) { - if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'updated')) { - $this->data['updated']['raw'] = $return[0]['data']; - } - - if (!empty($this->data['updated']['raw'])) { - $parser = $this->registry->call(Parse\Date::class, 'get'); - $this->data['updated']['parsed'] = $parser->parse($this->data['updated']['raw']) ?: null; - } else { - $this->data['updated'] = null; - } - } - if ($this->data['updated']) { - switch ($date_format) { - case '': - return $this->sanitize($this->data['updated']['raw'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - - case 'U': - return $this->data['updated']['parsed']; - - default: - return date($date_format, $this->data['updated']['parsed']); - } - } - - return null; - } - - /** - * Get the localized posting date/time for the item - * - * Returns the date formatted in the localized language. To display in - * languages other than the server's default, you need to change the locale - * with {@link http://php.net/setlocale setlocale()}. The available - * localizations depend on which ones are installed on your web server. - * - * @since 1.0 - * - * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data) - * @return string|null|false see `strftime` for when this can return `false` - */ - public function get_local_date(string $date_format = '%c') - { - if ($date_format === '') { - if (($raw_date = $this->get_date('')) === null) { - return null; - } - - return $this->sanitize($raw_date, \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif (($date = $this->get_date('U')) !== null && $date !== false) { - return strftime($date_format, $date); - } - - return null; - } - - /** - * Get the posting date/time for the item (UTC time) - * - * @see get_date - * @param string $date_format Supports any PHP date format from {@see http://php.net/date} - * @return string|null - */ - public function get_gmdate(string $date_format = 'j F Y, g:i a') - { - $date = $this->get_date('U'); - if ($date === null) { - return null; - } - - return gmdate($date_format, $date); - } - - /** - * Get the update date/time for the item (UTC time) - * - * @see get_updated_date - * @param string $date_format Supports any PHP date format from {@see http://php.net/date} - * @return string|null - */ - public function get_updated_gmdate(string $date_format = 'j F Y, g:i a') - { - $date = $this->get_updated_date('U'); - if ($date === null) { - return null; - } - - return gmdate($date_format, $date); - } - - /** - * Get the permalink for the item - * - * Returns the first link available with a relationship of "alternate". - * Identical to {@see get_link()} with key 0 - * - * @see get_link - * @since 0.8 - * @return string|null Permalink URL - */ - public function get_permalink() - { - $link = $this->get_link(); - $enclosure = $this->get_enclosure(0); - if ($link !== null) { - return $link; - } elseif ($enclosure !== null) { - return $enclosure->get_link(); - } - - return null; - } - - /** - * Get a single link for the item - * - * @since Beta 3 - * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1 - * @param string $rel The relationship of the link to return - * @return string|null Link URL - */ - public function get_link(int $key = 0, string $rel = 'alternate') - { - $links = $this->get_links($rel); - if ($links && $links[$key] !== null) { - return $links[$key]; - } - - return null; - } - - /** - * Get all links for the item - * - * Uses `<atom:link>`, `<link>` or `<guid>` - * - * @since Beta 2 - * @param string $rel The relationship of links to return - * @return array<string>|null Links found for the item (strings) - */ - public function get_links(string $rel = 'alternate') - { - if (!isset($this->data['links'])) { - $this->data['links'] = []; - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'link') as $link) { - if (isset($link['attribs']['']['href'])) { - $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; - $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($link)); - } - } - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'link') as $link) { - if (isset($link['attribs']['']['href'])) { - $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; - $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($link)); - } - } - if ($links = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'link')) { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($links[0])); - } - if ($links = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'link')) { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($links[0])); - } - if ($links = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'link')) { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($links[0])); - } - if ($links = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'guid')) { - if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true') { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($links[0])); - } - } - - $keys = array_keys($this->data['links']); - foreach ($keys as $key) { - if ($this->registry->call(Misc::class, 'is_isegment_nz_nc', [$key])) { - if (isset($this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key])) { - $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key]); - $this->data['links'][$key] = &$this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key]; - } else { - $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key] = &$this->data['links'][$key]; - } - } elseif (substr((string) $key, 0, 41) === \SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY) { - $this->data['links'][substr((string) $key, 41)] = &$this->data['links'][$key]; - } - $this->data['links'][$key] = array_unique($this->data['links'][$key]); - } - } - if (isset($this->data['links'][$rel])) { - return $this->data['links'][$rel]; - } - - return null; - } - - /** - * Get an enclosure from the item - * - * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS. - * - * @since Beta 2 - * @todo Add ability to prefer one type of content over another (in a media group). - * @param int $key The enclosure that you want to return. Remember that arrays begin with 0, not 1 - * @return \SimplePie\Enclosure|null - */ - public function get_enclosure(int $key = 0) - { - $enclosures = $this->get_enclosures(); - if (isset($enclosures[$key])) { - return $enclosures[$key]; - } - - return null; - } - - /** - * Get all available enclosures (podcasts, etc.) - * - * Supports the <enclosure> RSS tag, as well as Media RSS and iTunes RSS. - * - * At this point, we're pretty much assuming that all enclosures for an item - * are the same content. Anything else is too complicated to - * properly support. - * - * @since Beta 2 - * @todo Add support for end-user defined sorting of enclosures by type/handler (so we can prefer the faster-loading FLV over MP4). - * @todo If an element exists at a level, but its value is empty, we should fall back to the value from the parent (if it exists). - * @return \SimplePie\Enclosure[]|null List of \SimplePie\Enclosure items - */ - public function get_enclosures() - { - if (!isset($this->data['enclosures'])) { - $this->data['enclosures'] = []; - - // Elements - $captions_parent = null; - $categories_parent = null; - $copyrights_parent = null; - $credits_parent = null; - $description_parent = null; - $duration_parent = null; - $hashes_parent = null; - $keywords_parent = null; - $player_parent = null; - $ratings_parent = null; - $restrictions_parent = []; - $thumbnails_parent = null; - $title_parent = null; - - // Let's do the channel and item-level ones first, and just re-use them if we need to. - $parent = $this->get_feed(); - - // CAPTIONS - if ($captions = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'text')) { - foreach ($captions as $caption) { - $caption_type = null; - $caption_lang = null; - $caption_startTime = null; - $caption_endTime = null; - $caption_text = null; - if (isset($caption['attribs']['']['type'])) { - $caption_type = $this->sanitize($caption['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['lang'])) { - $caption_lang = $this->sanitize($caption['attribs']['']['lang'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['start'])) { - $caption_startTime = $this->sanitize($caption['attribs']['']['start'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['end'])) { - $caption_endTime = $this->sanitize($caption['attribs']['']['end'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['data'])) { - $caption_text = $this->sanitize($caption['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $captions_parent[] = $this->registry->create(Caption::class, [$caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text]); - } - } elseif ($captions = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'text')) { - foreach ($captions as $caption) { - $caption_type = null; - $caption_lang = null; - $caption_startTime = null; - $caption_endTime = null; - $caption_text = null; - if (isset($caption['attribs']['']['type'])) { - $caption_type = $this->sanitize($caption['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['lang'])) { - $caption_lang = $this->sanitize($caption['attribs']['']['lang'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['start'])) { - $caption_startTime = $this->sanitize($caption['attribs']['']['start'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['end'])) { - $caption_endTime = $this->sanitize($caption['attribs']['']['end'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['data'])) { - $caption_text = $this->sanitize($caption['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $captions_parent[] = $this->registry->create(Caption::class, [$caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text]); - } - } - if (is_array($captions_parent)) { - $captions_parent = array_values(array_unique($captions_parent)); - } - - // CATEGORIES - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'category') as $category) { - $term = null; - $scheme = null; - $label = null; - if (isset($category['data'])) { - $term = $this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['scheme'])) { - $scheme = $this->sanitize($category['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $scheme = 'http://search.yahoo.com/mrss/category_schema'; - } - if (isset($category['attribs']['']['label'])) { - $label = $this->sanitize($category['attribs']['']['label'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $categories_parent[] = $this->registry->create(Category::class, [$term, $scheme, $label]); - } - foreach ((array) $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'category') as $category) { - $term = null; - $scheme = null; - $label = null; - if (isset($category['data'])) { - $term = $this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['scheme'])) { - $scheme = $this->sanitize($category['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $scheme = 'http://search.yahoo.com/mrss/category_schema'; - } - if (isset($category['attribs']['']['label'])) { - $label = $this->sanitize($category['attribs']['']['label'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $categories_parent[] = $this->registry->create(Category::class, [$term, $scheme, $label]); - } - foreach ((array) $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'category') as $category) { - $term = null; - $scheme = 'http://www.itunes.com/dtds/podcast-1.0.dtd'; - $label = null; - if (isset($category['attribs']['']['text'])) { - $label = $this->sanitize($category['attribs']['']['text'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $categories_parent[] = $this->registry->create(Category::class, [$term, $scheme, $label]); - - if (isset($category['child'][\SimplePie\SimplePie::NAMESPACE_ITUNES]['category'])) { - foreach ((array) $category['child'][\SimplePie\SimplePie::NAMESPACE_ITUNES]['category'] as $subcategory) { - if (isset($subcategory['attribs']['']['text'])) { - $label = $this->sanitize($subcategory['attribs']['']['text'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $categories_parent[] = $this->registry->create(Category::class, [$term, $scheme, $label]); - } - } - } - if (is_array($categories_parent)) { - $categories_parent = array_values(array_unique($categories_parent)); - } - - // COPYRIGHT - if ($copyright = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'copyright')) { - $copyright_url = null; - $copyright_label = null; - if (isset($copyright[0]['attribs']['']['url'])) { - $copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($copyright[0]['data'])) { - $copyright_label = $this->sanitize($copyright[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $copyrights_parent = $this->registry->create(Copyright::class, [$copyright_url, $copyright_label]); - } elseif ($copyright = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'copyright')) { - $copyright_url = null; - $copyright_label = null; - if (isset($copyright[0]['attribs']['']['url'])) { - $copyright_url = $this->sanitize($copyright[0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($copyright[0]['data'])) { - $copyright_label = $this->sanitize($copyright[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $copyrights_parent = $this->registry->create(Copyright::class, [$copyright_url, $copyright_label]); - } - - // CREDITS - if ($credits = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'credit')) { - foreach ($credits as $credit) { - $credit_role = null; - $credit_scheme = null; - $credit_name = null; - if (isset($credit['attribs']['']['role'])) { - $credit_role = $this->sanitize($credit['attribs']['']['role'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($credit['attribs']['']['scheme'])) { - $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $credit_scheme = 'urn:ebu'; - } - if (isset($credit['data'])) { - $credit_name = $this->sanitize($credit['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $credits_parent[] = $this->registry->create(Credit::class, [$credit_role, $credit_scheme, $credit_name]); - } - } elseif ($credits = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'credit')) { - foreach ($credits as $credit) { - $credit_role = null; - $credit_scheme = null; - $credit_name = null; - if (isset($credit['attribs']['']['role'])) { - $credit_role = $this->sanitize($credit['attribs']['']['role'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($credit['attribs']['']['scheme'])) { - $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $credit_scheme = 'urn:ebu'; - } - if (isset($credit['data'])) { - $credit_name = $this->sanitize($credit['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $credits_parent[] = $this->registry->create(Credit::class, [$credit_role, $credit_scheme, $credit_name]); - } - } - if (is_array($credits_parent)) { - $credits_parent = array_values(array_unique($credits_parent)); - } - - // DESCRIPTION - if ($description_parent = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'description')) { - if (isset($description_parent[0]['data'])) { - $description_parent = $this->sanitize($description_parent[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - } elseif ($description_parent = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'description')) { - if (isset($description_parent[0]['data'])) { - $description_parent = $this->sanitize($description_parent[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - } - - // DURATION - $duration_tags = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'duration'); - if ($duration_tags !== null) { - $seconds = null; - $minutes = null; - $hours = null; - if (isset($duration_tags[0]['data'])) { - $temp = explode(':', $this->sanitize($duration_tags[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT)); - $seconds = (int) array_pop($temp); - if (count($temp) > 0) { - $minutes = (int) array_pop($temp); - $seconds += $minutes * 60; - } - if (count($temp) > 0) { - $hours = (int) array_pop($temp); - $seconds += $hours * 3600; - } - unset($temp); - $duration_parent = $seconds; - } - } - - // HASHES - if ($hashes_iterator = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'hash')) { - foreach ($hashes_iterator as $hash) { - $value = null; - $algo = null; - if (isset($hash['data'])) { - $value = $this->sanitize($hash['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($hash['attribs']['']['algo'])) { - $algo = $this->sanitize($hash['attribs']['']['algo'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $algo = 'md5'; - } - $hashes_parent[] = $algo.':'.$value; - } - } elseif ($hashes_iterator = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'hash')) { - foreach ($hashes_iterator as $hash) { - $value = null; - $algo = null; - if (isset($hash['data'])) { - $value = $this->sanitize($hash['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($hash['attribs']['']['algo'])) { - $algo = $this->sanitize($hash['attribs']['']['algo'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $algo = 'md5'; - } - $hashes_parent[] = $algo.':'.$value; - } - } - if (is_array($hashes_parent)) { - $hashes_parent = array_values(array_unique($hashes_parent)); - } - - // KEYWORDS - if ($keywords = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'keywords')) { - if (isset($keywords[0]['data'])) { - $temp = explode(',', $this->sanitize($keywords[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT)); - foreach ($temp as $word) { - $keywords_parent[] = trim($word); - } - } - unset($temp); - } elseif ($keywords = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'keywords')) { - if (isset($keywords[0]['data'])) { - $temp = explode(',', $this->sanitize($keywords[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT)); - foreach ($temp as $word) { - $keywords_parent[] = trim($word); - } - } - unset($temp); - } elseif ($keywords = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'keywords')) { - if (isset($keywords[0]['data'])) { - $temp = explode(',', $this->sanitize($keywords[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT)); - foreach ($temp as $word) { - $keywords_parent[] = trim($word); - } - } - unset($temp); - } elseif ($keywords = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'keywords')) { - if (isset($keywords[0]['data'])) { - $temp = explode(',', $this->sanitize($keywords[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT)); - foreach ($temp as $word) { - $keywords_parent[] = trim($word); - } - } - unset($temp); - } - if (is_array($keywords_parent)) { - $keywords_parent = array_values(array_unique($keywords_parent)); - } - - // PLAYER - if ($player_parent = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'player')) { - if (isset($player_parent[0]['attribs']['']['url'])) { - $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($player_parent[0])); - } - } elseif ($player_parent = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'player')) { - if (isset($player_parent[0]['attribs']['']['url'])) { - $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($player_parent[0])); - } - } - - // RATINGS - if ($ratings = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'rating')) { - foreach ($ratings as $rating) { - $rating_scheme = null; - $rating_value = null; - if (isset($rating['attribs']['']['scheme'])) { - $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $rating_scheme = 'urn:simple'; - } - if (isset($rating['data'])) { - $rating_value = $this->sanitize($rating['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $ratings_parent[] = $this->registry->create(Rating::class, [$rating_scheme, $rating_value]); - } - } elseif ($ratings = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'explicit')) { - foreach ($ratings as $rating) { - $rating_scheme = 'urn:itunes'; - $rating_value = null; - if (isset($rating['data'])) { - $rating_value = $this->sanitize($rating['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $ratings_parent[] = $this->registry->create(Rating::class, [$rating_scheme, $rating_value]); - } - } elseif ($ratings = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'rating')) { - foreach ($ratings as $rating) { - $rating_scheme = null; - $rating_value = null; - if (isset($rating['attribs']['']['scheme'])) { - $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $rating_scheme = 'urn:simple'; - } - if (isset($rating['data'])) { - $rating_value = $this->sanitize($rating['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $ratings_parent[] = $this->registry->create(Rating::class, [$rating_scheme, $rating_value]); - } - } elseif ($ratings = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'explicit')) { - foreach ($ratings as $rating) { - $rating_scheme = 'urn:itunes'; - $rating_value = null; - if (isset($rating['data'])) { - $rating_value = $this->sanitize($rating['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $ratings_parent[] = $this->registry->create(Rating::class, [$rating_scheme, $rating_value]); - } - } - if (is_array($ratings_parent)) { - $ratings_parent = array_values(array_unique($ratings_parent)); - } - - // RESTRICTIONS - if ($restrictions = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'restriction')) { - foreach ($restrictions as $restriction) { - $restriction_relationship = null; - $restriction_type = null; - $restriction_value = null; - if (isset($restriction['attribs']['']['relationship'])) { - $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['attribs']['']['type'])) { - $restriction_type = $this->sanitize($restriction['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['data'])) { - $restriction_value = $this->sanitize($restriction['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $restrictions_parent[] = $this->registry->create(Restriction::class, [$restriction_relationship, $restriction_type, $restriction_value]); - } - } elseif ($restrictions = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'block')) { - foreach ($restrictions as $restriction) { - $restriction_relationship = Restriction::RELATIONSHIP_ALLOW; - $restriction_type = null; - $restriction_value = 'itunes'; - if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') { - $restriction_relationship = Restriction::RELATIONSHIP_DENY; - } - $restrictions_parent[] = $this->registry->create(Restriction::class, [$restriction_relationship, $restriction_type, $restriction_value]); - } - } elseif ($restrictions = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'restriction')) { - foreach ($restrictions as $restriction) { - $restriction_relationship = null; - $restriction_type = null; - $restriction_value = null; - if (isset($restriction['attribs']['']['relationship'])) { - $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['attribs']['']['type'])) { - $restriction_type = $this->sanitize($restriction['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['data'])) { - $restriction_value = $this->sanitize($restriction['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $restrictions_parent[] = $this->registry->create(Restriction::class, [$restriction_relationship, $restriction_type, $restriction_value]); - } - } elseif ($restrictions = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'block')) { - foreach ($restrictions as $restriction) { - $restriction_relationship = Restriction::RELATIONSHIP_ALLOW; - $restriction_type = null; - $restriction_value = 'itunes'; - if (isset($restriction['data']) && strtolower($restriction['data']) === 'yes') { - $restriction_relationship = Restriction::RELATIONSHIP_DENY; - } - $restrictions_parent[] = $this->registry->create(Restriction::class, [$restriction_relationship, $restriction_type, $restriction_value]); - } - } - if (count($restrictions_parent) > 0) { - $restrictions_parent = array_values(array_unique($restrictions_parent)); - } else { - $restrictions_parent = [new \SimplePie\Restriction(Restriction::RELATIONSHIP_ALLOW, null, 'default')]; - } - - // THUMBNAILS - if ($thumbnails = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'thumbnail')) { - foreach ($thumbnails as $thumbnail) { - if (isset($thumbnail['attribs']['']['url'])) { - $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail)); - } - } - } elseif ($thumbnails = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'thumbnail')) { - foreach ($thumbnails as $thumbnail) { - if (isset($thumbnail['attribs']['']['url'])) { - $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail)); - } - } - } - - // TITLES - if ($title_parent = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'title')) { - if (isset($title_parent[0]['data'])) { - $title_parent = $this->sanitize($title_parent[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - } elseif ($title_parent = $parent->get_channel_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'title')) { - if (isset($title_parent[0]['data'])) { - $title_parent = $this->sanitize($title_parent[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - } - - // Clear the memory - unset($parent); - - // Attributes - $bitrate = null; - $channels = null; - $duration = null; - $expression = null; - $framerate = null; - $height = null; - $javascript = null; - $lang = null; - $length = null; - $medium = null; - $samplingrate = null; - $type = null; - $url = null; - $width = null; - - // Elements - $captions = null; - $categories = null; - $copyrights = null; - $credits = null; - $description = null; - $hashes = null; - $keywords = null; - $player = null; - $ratings = null; - $restrictions = null; - $thumbnails = null; - $title = null; - - // If we have media:group tags, loop through them. - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'group') as $group) { - if (isset($group['child']) && isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['content'])) { - // If we have media:content tags, loop through them. - foreach ((array) $group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['content'] as $content) { - if (isset($content['attribs']['']['url'])) { - // Attributes - $bitrate = null; - $channels = null; - $duration = null; - $expression = null; - $framerate = null; - $height = null; - $javascript = null; - $lang = null; - $length = null; - $medium = null; - $samplingrate = null; - $type = null; - $url = null; - $width = null; - - // Elements - $captions = null; - $categories = null; - $copyrights = null; - $credits = null; - $description = null; - $hashes = null; - $keywords = null; - $player = null; - $ratings = null; - $restrictions = null; - $thumbnails = null; - $title = null; - - // Start checking the attributes of media:content - if (isset($content['attribs']['']['bitrate'])) { - $bitrate = $this->sanitize($content['attribs']['']['bitrate'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['channels'])) { - $channels = $this->sanitize($content['attribs']['']['channels'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['duration'])) { - $duration = $this->sanitize($content['attribs']['']['duration'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $duration = $duration_parent; - } - if (isset($content['attribs']['']['expression'])) { - $expression = $this->sanitize($content['attribs']['']['expression'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['framerate'])) { - $framerate = $this->sanitize($content['attribs']['']['framerate'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['height'])) { - $height = $this->sanitize($content['attribs']['']['height'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['lang'])) { - $lang = $this->sanitize($content['attribs']['']['lang'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['fileSize'])) { - $length = intval($content['attribs']['']['fileSize']); - } - if (isset($content['attribs']['']['medium'])) { - $medium = $this->sanitize($content['attribs']['']['medium'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['samplingrate'])) { - $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['type'])) { - $type = $this->sanitize($content['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['width'])) { - $width = $this->sanitize($content['attribs']['']['width'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $url = $this->sanitize($content['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($content)); - - // Checking the other optional media: elements. Priority: media:content, media:group, item, channel - - // CAPTIONS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['text'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['text'] as $caption) { - $caption_type = null; - $caption_lang = null; - $caption_startTime = null; - $caption_endTime = null; - $caption_text = null; - if (isset($caption['attribs']['']['type'])) { - $caption_type = $this->sanitize($caption['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['lang'])) { - $caption_lang = $this->sanitize($caption['attribs']['']['lang'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['start'])) { - $caption_startTime = $this->sanitize($caption['attribs']['']['start'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['end'])) { - $caption_endTime = $this->sanitize($caption['attribs']['']['end'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['data'])) { - $caption_text = $this->sanitize($caption['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $captions[] = $this->registry->create(Caption::class, [$caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text]); - } - if (is_array($captions)) { - $captions = array_values(array_unique($captions)); - } - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['text'])) { - foreach ($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['text'] as $caption) { - $caption_type = null; - $caption_lang = null; - $caption_startTime = null; - $caption_endTime = null; - $caption_text = null; - if (isset($caption['attribs']['']['type'])) { - $caption_type = $this->sanitize($caption['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['lang'])) { - $caption_lang = $this->sanitize($caption['attribs']['']['lang'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['start'])) { - $caption_startTime = $this->sanitize($caption['attribs']['']['start'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['end'])) { - $caption_endTime = $this->sanitize($caption['attribs']['']['end'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['data'])) { - $caption_text = $this->sanitize($caption['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $captions[] = $this->registry->create(Caption::class, [$caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text]); - } - if (is_array($captions)) { - $captions = array_values(array_unique($captions)); - } - } else { - $captions = $captions_parent; - } - - // CATEGORIES - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['category'])) { - foreach ((array) $content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['category'] as $category) { - $term = null; - $scheme = null; - $label = null; - if (isset($category['data'])) { - $term = $this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['scheme'])) { - $scheme = $this->sanitize($category['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $scheme = 'http://search.yahoo.com/mrss/category_schema'; - } - if (isset($category['attribs']['']['label'])) { - $label = $this->sanitize($category['attribs']['']['label'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $categories[] = $this->registry->create(Category::class, [$term, $scheme, $label]); - } - } - if (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['category'])) { - foreach ((array) $group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['category'] as $category) { - $term = null; - $scheme = null; - $label = null; - if (isset($category['data'])) { - $term = $this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['scheme'])) { - $scheme = $this->sanitize($category['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $scheme = 'http://search.yahoo.com/mrss/category_schema'; - } - if (isset($category['attribs']['']['label'])) { - $label = $this->sanitize($category['attribs']['']['label'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $categories[] = $this->registry->create(Category::class, [$term, $scheme, $label]); - } - } - if (is_array($categories) && is_array($categories_parent)) { - $categories = array_values(array_unique(array_merge($categories, $categories_parent))); - } elseif (is_array($categories)) { - $categories = array_values(array_unique($categories)); - } elseif (is_array($categories_parent)) { - $categories = array_values(array_unique($categories_parent)); - } - - // COPYRIGHTS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'])) { - $copyright_url = null; - $copyright_label = null; - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'])) { - $copyright_url = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['data'])) { - $copyright_label = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $copyrights = $this->registry->create(Copyright::class, [$copyright_url, $copyright_label]); - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'])) { - $copyright_url = null; - $copyright_label = null; - if (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'])) { - $copyright_url = $this->sanitize($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['data'])) { - $copyright_label = $this->sanitize($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $copyrights = $this->registry->create(Copyright::class, [$copyright_url, $copyright_label]); - } else { - $copyrights = $copyrights_parent; - } - - // CREDITS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['credit'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['credit'] as $credit) { - $credit_role = null; - $credit_scheme = null; - $credit_name = null; - if (isset($credit['attribs']['']['role'])) { - $credit_role = $this->sanitize($credit['attribs']['']['role'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($credit['attribs']['']['scheme'])) { - $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $credit_scheme = 'urn:ebu'; - } - if (isset($credit['data'])) { - $credit_name = $this->sanitize($credit['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $credits[] = $this->registry->create(Credit::class, [$credit_role, $credit_scheme, $credit_name]); - } - if (is_array($credits)) { - $credits = array_values(array_unique($credits)); - } - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['credit'])) { - foreach ($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['credit'] as $credit) { - $credit_role = null; - $credit_scheme = null; - $credit_name = null; - if (isset($credit['attribs']['']['role'])) { - $credit_role = $this->sanitize($credit['attribs']['']['role'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($credit['attribs']['']['scheme'])) { - $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $credit_scheme = 'urn:ebu'; - } - if (isset($credit['data'])) { - $credit_name = $this->sanitize($credit['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $credits[] = $this->registry->create(Credit::class, [$credit_role, $credit_scheme, $credit_name]); - } - if (is_array($credits)) { - $credits = array_values(array_unique($credits)); - } - } else { - $credits = $credits_parent; - } - - // DESCRIPTION - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['description'])) { - $description = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['description'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['description'])) { - $description = $this->sanitize($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['description'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $description = $description_parent; - } - - // HASHES - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['hash'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['hash'] as $hash) { - $value = null; - $algo = null; - if (isset($hash['data'])) { - $value = $this->sanitize($hash['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($hash['attribs']['']['algo'])) { - $algo = $this->sanitize($hash['attribs']['']['algo'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $algo = 'md5'; - } - $hashes[] = $algo.':'.$value; - } - if (is_array($hashes)) { - $hashes = array_values(array_unique($hashes)); - } - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['hash'])) { - foreach ($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['hash'] as $hash) { - $value = null; - $algo = null; - if (isset($hash['data'])) { - $value = $this->sanitize($hash['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($hash['attribs']['']['algo'])) { - $algo = $this->sanitize($hash['attribs']['']['algo'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $algo = 'md5'; - } - $hashes[] = $algo.':'.$value; - } - if (is_array($hashes)) { - $hashes = array_values(array_unique($hashes)); - } - } else { - $hashes = $hashes_parent; - } - - // KEYWORDS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['keywords'])) { - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['keywords'][0]['data'])) { - $temp = explode(',', $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['keywords'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT)); - foreach ($temp as $word) { - $keywords[] = trim($word); - } - unset($temp); - } - if (is_array($keywords)) { - $keywords = array_values(array_unique($keywords)); - } - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['keywords'])) { - if (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['keywords'][0]['data'])) { - $temp = explode(',', $this->sanitize($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['keywords'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT)); - foreach ($temp as $word) { - $keywords[] = trim($word); - } - unset($temp); - } - if (is_array($keywords)) { - $keywords = array_values(array_unique($keywords)); - } - } else { - $keywords = $keywords_parent; - } - - // PLAYER - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'])) { - $playerElem = $content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0]; - $player = $this->sanitize($playerElem['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($playerElem)); - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'])) { - $playerElem = $group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0]; - $player = $this->sanitize($playerElem['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($playerElem)); - } else { - $player = $player_parent; - } - - // RATINGS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['rating'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['rating'] as $rating) { - $rating_scheme = null; - $rating_value = null; - if (isset($rating['attribs']['']['scheme'])) { - $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $rating_scheme = 'urn:simple'; - } - if (isset($rating['data'])) { - $rating_value = $this->sanitize($rating['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $ratings[] = $this->registry->create(Rating::class, [$rating_scheme, $rating_value]); - } - if (is_array($ratings)) { - $ratings = array_values(array_unique($ratings)); - } - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['rating'])) { - foreach ($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['rating'] as $rating) { - $rating_scheme = null; - $rating_value = null; - if (isset($rating['attribs']['']['scheme'])) { - $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $rating_scheme = 'urn:simple'; - } - if (isset($rating['data'])) { - $rating_value = $this->sanitize($rating['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $ratings[] = $this->registry->create(Rating::class, [$rating_scheme, $rating_value]); - } - if (is_array($ratings)) { - $ratings = array_values(array_unique($ratings)); - } - } else { - $ratings = $ratings_parent; - } - - // RESTRICTIONS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['restriction'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['restriction'] as $restriction) { - $restriction_relationship = null; - $restriction_type = null; - $restriction_value = null; - if (isset($restriction['attribs']['']['relationship'])) { - $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['attribs']['']['type'])) { - $restriction_type = $this->sanitize($restriction['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['data'])) { - $restriction_value = $this->sanitize($restriction['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $restrictions[] = $this->registry->create(Restriction::class, [$restriction_relationship, $restriction_type, $restriction_value]); - } - if (is_array($restrictions)) { - $restrictions = array_values(array_unique($restrictions)); - } - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['restriction'])) { - foreach ($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['restriction'] as $restriction) { - $restriction_relationship = null; - $restriction_type = null; - $restriction_value = null; - if (isset($restriction['attribs']['']['relationship'])) { - $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['attribs']['']['type'])) { - $restriction_type = $this->sanitize($restriction['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['data'])) { - $restriction_value = $this->sanitize($restriction['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $restrictions[] = $this->registry->create(Restriction::class, [$restriction_relationship, $restriction_type, $restriction_value]); - } - if (is_array($restrictions)) { - $restrictions = array_values(array_unique($restrictions)); - } - } else { - $restrictions = $restrictions_parent; - } - - // THUMBNAILS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { - $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail)); - } - if (is_array($thumbnails)) { - $thumbnails = array_values(array_unique($thumbnails)); - } - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'])) { - foreach ($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { - $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail)); - } - if (is_array($thumbnails)) { - $thumbnails = array_values(array_unique($thumbnails)); - } - } else { - $thumbnails = $thumbnails_parent; - } - - // TITLES - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['title'])) { - $title = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['title'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif (isset($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['title'])) { - $title = $this->sanitize($group['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['title'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $title = $title_parent; - } - - $this->data['enclosures'][] = $this->registry->create(Enclosure::class, [$url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width]); - } - } - } - } - - // If we have standalone media:content tags, loop through them. - if (isset($this->data['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['content'])) { - foreach ((array) $this->data['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['content'] as $content) { - if (isset($content['attribs']['']['url']) || isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'])) { - // Attributes - $bitrate = null; - $channels = null; - $duration = null; - $expression = null; - $framerate = null; - $height = null; - $javascript = null; - $lang = null; - $length = null; - $medium = null; - $samplingrate = null; - $type = null; - $url = null; - $width = null; - - // Elements - $captions = null; - $categories = null; - $copyrights = null; - $credits = null; - $description = null; - $hashes = null; - $keywords = null; - $player = null; - $ratings = null; - $restrictions = null; - $thumbnails = null; - $title = null; - - // Start checking the attributes of media:content - if (isset($content['attribs']['']['bitrate'])) { - $bitrate = $this->sanitize($content['attribs']['']['bitrate'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['channels'])) { - $channels = $this->sanitize($content['attribs']['']['channels'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['duration'])) { - $duration = $this->sanitize($content['attribs']['']['duration'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $duration = $duration_parent; - } - if (isset($content['attribs']['']['expression'])) { - $expression = $this->sanitize($content['attribs']['']['expression'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['framerate'])) { - $framerate = $this->sanitize($content['attribs']['']['framerate'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['height'])) { - $height = $this->sanitize($content['attribs']['']['height'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['lang'])) { - $lang = $this->sanitize($content['attribs']['']['lang'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['fileSize'])) { - $length = intval($content['attribs']['']['fileSize']); - } - if (isset($content['attribs']['']['medium'])) { - $medium = $this->sanitize($content['attribs']['']['medium'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['samplingrate'])) { - $samplingrate = $this->sanitize($content['attribs']['']['samplingrate'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['type'])) { - $type = $this->sanitize($content['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['width'])) { - $width = $this->sanitize($content['attribs']['']['width'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['attribs']['']['url'])) { - $url = $this->sanitize($content['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($content)); - } - // Checking the other optional media: elements. Priority: media:content, media:group, item, channel - - // CAPTIONS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['text'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['text'] as $caption) { - $caption_type = null; - $caption_lang = null; - $caption_startTime = null; - $caption_endTime = null; - $caption_text = null; - if (isset($caption['attribs']['']['type'])) { - $caption_type = $this->sanitize($caption['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['lang'])) { - $caption_lang = $this->sanitize($caption['attribs']['']['lang'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['start'])) { - $caption_startTime = $this->sanitize($caption['attribs']['']['start'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['attribs']['']['end'])) { - $caption_endTime = $this->sanitize($caption['attribs']['']['end'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($caption['data'])) { - $caption_text = $this->sanitize($caption['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $captions[] = $this->registry->create(Caption::class, [$caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text]); - } - if (is_array($captions)) { - $captions = array_values(array_unique($captions)); - } - } else { - $captions = $captions_parent; - } - - // CATEGORIES - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['category'])) { - foreach ((array) $content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['category'] as $category) { - $term = null; - $scheme = null; - $label = null; - if (isset($category['data'])) { - $term = $this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['scheme'])) { - $scheme = $this->sanitize($category['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $scheme = 'http://search.yahoo.com/mrss/category_schema'; - } - if (isset($category['attribs']['']['label'])) { - $label = $this->sanitize($category['attribs']['']['label'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $categories[] = $this->registry->create(Category::class, [$term, $scheme, $label]); - } - } - if (is_array($categories) && is_array($categories_parent)) { - $categories = array_values(array_unique(array_merge($categories, $categories_parent))); - } elseif (is_array($categories)) { - $categories = array_values(array_unique($categories)); - } elseif (is_array($categories_parent)) { - $categories = array_values(array_unique($categories_parent)); - } else { - $categories = null; - } - - // COPYRIGHTS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'])) { - $copyright_url = null; - $copyright_label = null; - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'])) { - $copyright_url = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['data'])) { - $copyright_label = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['copyright'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $copyrights = $this->registry->create(Copyright::class, [$copyright_url, $copyright_label]); - } else { - $copyrights = $copyrights_parent; - } - - // CREDITS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['credit'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['credit'] as $credit) { - $credit_role = null; - $credit_scheme = null; - $credit_name = null; - if (isset($credit['attribs']['']['role'])) { - $credit_role = $this->sanitize($credit['attribs']['']['role'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($credit['attribs']['']['scheme'])) { - $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $credit_scheme = 'urn:ebu'; - } - if (isset($credit['data'])) { - $credit_name = $this->sanitize($credit['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $credits[] = $this->registry->create(Credit::class, [$credit_role, $credit_scheme, $credit_name]); - } - if (is_array($credits)) { - $credits = array_values(array_unique($credits)); - } - } else { - $credits = $credits_parent; - } - - // DESCRIPTION - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['description'])) { - $description = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['description'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $description = $description_parent; - } - - // HASHES - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['hash'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['hash'] as $hash) { - $value = null; - $algo = null; - if (isset($hash['data'])) { - $value = $this->sanitize($hash['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($hash['attribs']['']['algo'])) { - $algo = $this->sanitize($hash['attribs']['']['algo'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $algo = 'md5'; - } - $hashes[] = $algo.':'.$value; - } - if (is_array($hashes)) { - $hashes = array_values(array_unique($hashes)); - } - } else { - $hashes = $hashes_parent; - } - - // KEYWORDS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['keywords'])) { - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['keywords'][0]['data'])) { - $temp = explode(',', $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['keywords'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT)); - foreach ($temp as $word) { - $keywords[] = trim($word); - } - unset($temp); - } - if (is_array($keywords)) { - $keywords = array_values(array_unique($keywords)); - } - } else { - $keywords = $keywords_parent; - } - - // PLAYER - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'])) { - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'])) { - $playerElem = $content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['player'][0]; - $player = $this->sanitize($playerElem['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($playerElem)); - } - } else { - $player = $player_parent; - } - - // RATINGS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['rating'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['rating'] as $rating) { - $rating_scheme = null; - $rating_value = null; - if (isset($rating['attribs']['']['scheme'])) { - $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $rating_scheme = 'urn:simple'; - } - if (isset($rating['data'])) { - $rating_value = $this->sanitize($rating['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $ratings[] = $this->registry->create(Rating::class, [$rating_scheme, $rating_value]); - } - if (is_array($ratings)) { - $ratings = array_values(array_unique($ratings)); - } - } else { - $ratings = $ratings_parent; - } - - // RESTRICTIONS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['restriction'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['restriction'] as $restriction) { - $restriction_relationship = null; - $restriction_type = null; - $restriction_value = null; - if (isset($restriction['attribs']['']['relationship'])) { - $restriction_relationship = $this->sanitize($restriction['attribs']['']['relationship'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['attribs']['']['type'])) { - $restriction_type = $this->sanitize($restriction['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($restriction['data'])) { - $restriction_value = $this->sanitize($restriction['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $restrictions[] = $this->registry->create(Restriction::class, [$restriction_relationship, $restriction_type, $restriction_value]); - } - if (is_array($restrictions)) { - $restrictions = array_values(array_unique($restrictions)); - } - } else { - $restrictions = $restrictions_parent; - } - - // THUMBNAILS - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'])) { - foreach ($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) { - if (isset($thumbnail['attribs']['']['url'])) { - $thumbnails[] = $this->sanitize($thumbnail['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($thumbnail)); - } - } - if (is_array($thumbnails)) { - $thumbnails = array_values(array_unique($thumbnails)); - } - } else { - $thumbnails = $thumbnails_parent; - } - - // TITLES - if (isset($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['title'])) { - $title = $this->sanitize($content['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['title'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $title = $title_parent; - } - - $this->data['enclosures'][] = $this->registry->create(Enclosure::class, [$url, $type, $length, null, $bitrate, $captions, $categories, $channels, $copyrights, $credits, $description, $duration, $expression, $framerate, $hashes, $height, $keywords, $lang, $medium, $player, $ratings, $restrictions, $samplingrate, $thumbnails, $title, $width]); - } - } - } - - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'link') as $link) { - if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') { - // Attributes - $bitrate = null; - $channels = null; - $duration = null; - $expression = null; - $framerate = null; - $height = null; - $javascript = null; - $lang = null; - $length = null; - $medium = null; - $samplingrate = null; - $type = null; - $url = null; - $width = null; - - $url = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($link)); - if (isset($link['attribs']['']['type'])) { - $type = $this->sanitize($link['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($link['attribs']['']['length'])) { - $length = intval($link['attribs']['']['length']); - } - if (isset($link['attribs']['']['title'])) { - $title = $this->sanitize($link['attribs']['']['title'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $title = $title_parent; - } - - // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor - $this->data['enclosures'][] = $this->registry->create(Enclosure::class, [$url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title, $width]); - } - } - - foreach ((array) $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'link') as $link) { - if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') { - // Attributes - $bitrate = null; - $channels = null; - $duration = null; - $expression = null; - $framerate = null; - $height = null; - $javascript = null; - $lang = null; - $length = null; - $medium = null; - $samplingrate = null; - $type = null; - $url = null; - $width = null; - - $url = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($link)); - if (isset($link['attribs']['']['type'])) { - $type = $this->sanitize($link['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($link['attribs']['']['length'])) { - $length = intval($link['attribs']['']['length']); - } - - // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor - $this->data['enclosures'][] = $this->registry->create(Enclosure::class, [$url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width]); - } - } - - foreach ($this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'enclosure') ?? [] as $enclosure) { - if (isset($enclosure['attribs']['']['url'])) { - // Attributes - $bitrate = null; - $channels = null; - $duration = null; - $expression = null; - $framerate = null; - $height = null; - $javascript = null; - $lang = null; - $length = null; - $medium = null; - $samplingrate = null; - $type = null; - $url = null; - $width = null; - - $url = $this->sanitize($enclosure['attribs']['']['url'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_own_base($enclosure)); - $url = $this->get_sanitize()->https_url($url); - if (isset($enclosure['attribs']['']['type'])) { - $type = $this->sanitize($enclosure['attribs']['']['type'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($enclosure['attribs']['']['length'])) { - $length = intval($enclosure['attribs']['']['length']); - } - - // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor - $this->data['enclosures'][] = $this->registry->create(Enclosure::class, [$url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width]); - } - } - - if (count($this->data['enclosures']) === 0 && ($url || $type || $length || $bitrate || $captions_parent || $categories_parent || $channels || $copyrights_parent || $credits_parent || $description_parent || $duration_parent || $expression || $framerate || $hashes_parent || $height || $keywords_parent || $lang || $medium || $player_parent || $ratings_parent || $samplingrate || $thumbnails_parent || $title_parent || $width)) { - // Since we don't have group or content for these, we'll just pass the '*_parent' variables directly to the constructor - $this->data['enclosures'][] = $this->registry->create(Enclosure::class, [$url, $type, $length, null, $bitrate, $captions_parent, $categories_parent, $channels, $copyrights_parent, $credits_parent, $description_parent, $duration_parent, $expression, $framerate, $hashes_parent, $height, $keywords_parent, $lang, $medium, $player_parent, $ratings_parent, $restrictions_parent, $samplingrate, $thumbnails_parent, $title_parent, $width]); - } - - $this->data['enclosures'] = array_values(array_unique($this->data['enclosures'])); - } - if (!empty($this->data['enclosures'])) { - return $this->data['enclosures']; - } - - return null; - } - - /** - * Get the latitude coordinates for the item - * - * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications - * - * Uses `<geo:lat>` or `<georss:point>` - * - * @since 1.0 - * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo - * @link http://www.georss.org/ GeoRSS - * @return float|null - */ - public function get_latitude() - { - if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'lat')) { - return (float) $return[0]['data']; - } elseif (($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { - return (float) $match[1]; - } - - return null; - } - - /** - * Get the longitude coordinates for the item - * - * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications - * - * Uses `<geo:long>`, `<geo:lon>` or `<georss:point>` - * - * @since 1.0 - * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo - * @link http://www.georss.org/ GeoRSS - * @return float|null - */ - public function get_longitude() - { - if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'long')) { - return (float) $return[0]['data']; - } elseif ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'lon')) { - return (float) $return[0]['data']; - } elseif (($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { - return (float) $match[2]; - } - - return null; - } - - /** - * Get the `<atom:source>` for the item - * - * @since 1.1 - * @return \SimplePie\Source|null - */ - public function get_source() - { - if ($return = $this->get_item_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'source')) { - return $this->registry->create(Source::class, [$this, $return[0]]); - } - - return null; - } - - public function set_sanitize(Sanitize $sanitize): void - { - $this->sanitize = $sanitize; - } - - protected function get_sanitize(): Sanitize - { - if ($this->sanitize === null) { - $this->sanitize = new Sanitize(); - } - - return $this->sanitize; - } -} - -class_alias('SimplePie\Item', 'SimplePie_Item'); diff --git a/core/vendor/simplepie/simplepie/src/Locator.php b/core/vendor/simplepie/simplepie/src/Locator.php deleted file mode 100644 index 30a7fe5259..0000000000 --- a/core/vendor/simplepie/simplepie/src/Locator.php +++ /dev/null @@ -1,478 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -use DomDocument; -use Psr\Http\Client\ClientInterface; -use Psr\Http\Message\RequestFactoryInterface; -use Psr\Http\Message\UriFactoryInterface; -use SimplePie\HTTP\Client; -use SimplePie\HTTP\ClientException; -use SimplePie\HTTP\FileClient; -use SimplePie\HTTP\Psr18Client; -use SimplePie\HTTP\Response; - -/** - * Used for feed auto-discovery - * - * - * This class can be overloaded with {@see \SimplePie\SimplePie::set_locator_class()} - */ -class Locator implements RegistryAware -{ - /** @var ?string */ - public $useragent = null; - /** @var int */ - public $timeout = 10; - /** @var File */ - public $file; - /** @var string[] */ - public $local = []; - /** @var string[] */ - public $elsewhere = []; - /** @var array<mixed> */ - public $cached_entities = []; - /** @var string */ - public $http_base; - /** @var string */ - public $base; - /** @var int */ - public $base_location = 0; - /** @var int */ - public $checked_feeds = 0; - /** @var int */ - public $max_checked_feeds = 10; - /** @var bool */ - public $force_fsockopen = false; - /** @var array<int, mixed> */ - public $curl_options = []; - /** @var ?\DomDocument */ - public $dom; - /** @var ?Registry */ - protected $registry; - - /** - * @var Client|null - */ - private $http_client = null; - - /** - * @param array<int, mixed> $curl_options - */ - public function __construct(File $file, int $timeout = 10, ?string $useragent = null, int $max_checked_feeds = 10, bool $force_fsockopen = false, array $curl_options = []) - { - $this->file = $file; - $this->useragent = $useragent; - $this->timeout = $timeout; - $this->max_checked_feeds = $max_checked_feeds; - $this->force_fsockopen = $force_fsockopen; - $this->curl_options = $curl_options; - - $body = $this->file->get_body_content(); - - if (class_exists('DOMDocument') && $body != '') { - $this->dom = new \DOMDocument(); - - set_error_handler([Misc::class, 'silence_errors']); - try { - $this->dom->loadHTML($body); - } catch (\Throwable $ex) { - $this->dom = null; - } - restore_error_handler(); - } else { - $this->dom = null; - } - } - - /** - * Set a PSR-18 client and PSR-17 factories - * - * Allows you to use your own HTTP client implementations. - */ - final public function set_http_client( - ClientInterface $http_client, - RequestFactoryInterface $request_factory, - UriFactoryInterface $uri_factory - ): void { - $this->http_client = new Psr18Client($http_client, $request_factory, $uri_factory); - } - - /** - * @return void - */ - public function set_registry(\SimplePie\Registry $registry) - { - $this->registry = $registry; - } - - /** - * @param SimplePie::LOCATOR_* $type - * @param array<Response>|null $working - * @return Response|null - */ - public function find(int $type = \SimplePie\SimplePie::LOCATOR_ALL, ?array &$working = null) - { - assert($this->registry !== null); - - if ($this->is_feed($this->file)) { - return $this->file; - } - - if (Misc::is_remote_uri($this->file->get_final_requested_uri())) { - $sniffer = $this->registry->create(Content\Type\Sniffer::class, [$this->file]); - if ($sniffer->get_type() !== 'text/html') { - return null; - } - } - - if ($type & ~\SimplePie\SimplePie::LOCATOR_NONE) { - $this->get_base(); - } - - if ($type & \SimplePie\SimplePie::LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery()) { - return $working[0]; - } - - if ($type & (\SimplePie\SimplePie::LOCATOR_LOCAL_EXTENSION | \SimplePie\SimplePie::LOCATOR_LOCAL_BODY | \SimplePie\SimplePie::LOCATOR_REMOTE_EXTENSION | \SimplePie\SimplePie::LOCATOR_REMOTE_BODY) && $this->get_links()) { - if ($type & \SimplePie\SimplePie::LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local)) { - return $working[0]; - } - - if ($type & \SimplePie\SimplePie::LOCATOR_LOCAL_BODY && $working = $this->body($this->local)) { - return $working[0]; - } - - if ($type & \SimplePie\SimplePie::LOCATOR_REMOTE_EXTENSION && $working = $this->extension($this->elsewhere)) { - return $working[0]; - } - - if ($type & \SimplePie\SimplePie::LOCATOR_REMOTE_BODY && $working = $this->body($this->elsewhere)) { - return $working[0]; - } - } - return null; - } - - /** - * @return bool - */ - public function is_feed(Response $file, bool $check_html = false) - { - assert($this->registry !== null); - - if (Misc::is_remote_uri($file->get_final_requested_uri())) { - $sniffer = $this->registry->create(Content\Type\Sniffer::class, [$file]); - $sniffed = $sniffer->get_type(); - $mime_types = ['application/rss+xml', 'application/rdf+xml', - 'text/rdf', 'application/atom+xml', 'text/xml', - 'application/xml', 'application/x-rss+xml']; - if ($check_html) { - $mime_types[] = 'text/html'; - } - - return in_array($sniffed, $mime_types); - } elseif (is_file($file->get_final_requested_uri())) { - return true; - } else { - return false; - } - } - - /** - * @return void - */ - public function get_base() - { - assert($this->registry !== null); - - if ($this->dom === null) { - throw new \SimplePie\Exception('DOMDocument not found, unable to use locator'); - } - $this->http_base = $this->file->get_final_requested_uri(); - $this->base = $this->http_base; - $elements = $this->dom->getElementsByTagName('base'); - foreach ($elements as $element) { - if ($element->hasAttribute('href')) { - $base = $this->registry->call(Misc::class, 'absolutize_url', [trim($element->getAttribute('href')), $this->http_base]); - if ($base === false) { - continue; - } - $this->base = $base; - $this->base_location = method_exists($element, 'getLineNo') ? $element->getLineNo() : 0; - break; - } - } - } - - /** - * @return array<Response>|null - */ - public function autodiscovery() - { - $done = []; - $feeds = []; - $feeds = array_merge($feeds, $this->search_elements_by_tag('link', $done, $feeds)); - $feeds = array_merge($feeds, $this->search_elements_by_tag('a', $done, $feeds)); - $feeds = array_merge($feeds, $this->search_elements_by_tag('area', $done, $feeds)); - - if (!empty($feeds)) { - return array_values($feeds); - } - - return null; - } - - /** - * @param string[] $done - * @param array<string, Response> $feeds - * @return array<string, Response> - */ - protected function search_elements_by_tag(string $name, array &$done, array $feeds) - { - assert($this->registry !== null); - - if ($this->dom === null) { - throw new \SimplePie\Exception('DOMDocument not found, unable to use locator'); - } - - $links = $this->dom->getElementsByTagName($name); - foreach ($links as $link) { - if ($this->checked_feeds === $this->max_checked_feeds) { - break; - } - if ($link->hasAttribute('href') && $link->hasAttribute('rel')) { - $rel = array_unique($this->registry->call(Misc::class, 'space_separated_tokens', [strtolower($link->getAttribute('rel'))])); - $line = method_exists($link, 'getLineNo') ? $link->getLineNo() : 1; - - if ($this->base_location < $line) { - $href = $this->registry->call(Misc::class, 'absolutize_url', [trim($link->getAttribute('href')), $this->base]); - } else { - $href = $this->registry->call(Misc::class, 'absolutize_url', [trim($link->getAttribute('href')), $this->http_base]); - } - if ($href === false) { - continue; - } - - if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call(Misc::class, 'parse_mime', [$link->getAttribute('type')])), ['text/html', 'application/rss+xml', 'application/atom+xml'])) && !isset($feeds[$href])) { - $this->checked_feeds++; - $headers = [ - 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER, - ]; - - try { - $feed = $this->get_http_client()->request(Client::METHOD_GET, $href, $headers); - - if ((!Misc::is_remote_uri($feed->get_final_requested_uri()) || ($feed->get_status_code() === 200 || $feed->get_status_code() > 206 && $feed->get_status_code() < 300)) && $this->is_feed($feed, true)) { - $feeds[$href] = $feed; - } - } catch (ClientException $th) { - // Just mark it as done and continue. - } - } - $done[] = $href; - } - } - - return $feeds; - } - - /** - * @return true|null - */ - public function get_links() - { - assert($this->registry !== null); - - if ($this->dom === null) { - throw new \SimplePie\Exception('DOMDocument not found, unable to use locator'); - } - - $links = $this->dom->getElementsByTagName('a'); - foreach ($links as $link) { - if ($link->hasAttribute('href')) { - $href = trim($link->getAttribute('href')); - $parsed = $this->registry->call(Misc::class, 'parse_url', [$href]); - if ($parsed['scheme'] === '' || preg_match('/^(https?|feed)?$/i', $parsed['scheme'])) { - if (method_exists($link, 'getLineNo') && $this->base_location < $link->getLineNo()) { - $href = $this->registry->call(Misc::class, 'absolutize_url', [trim($link->getAttribute('href')), $this->base]); - } else { - $href = $this->registry->call(Misc::class, 'absolutize_url', [trim($link->getAttribute('href')), $this->http_base]); - } - if ($href === false) { - continue; - } - - $current = $this->registry->call(Misc::class, 'parse_url', [$this->file->get_final_requested_uri()]); - - if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority']) { - $this->local[] = $href; - } else { - $this->elsewhere[] = $href; - } - } - } - } - $this->local = array_unique($this->local); - $this->elsewhere = array_unique($this->elsewhere); - if (!empty($this->local) || !empty($this->elsewhere)) { - return true; - } - return null; - } - - /** - * Extracts first `link` element with given `rel` attribute inside the `head` element. - * - * @return string|null - */ - public function get_rel_link(string $rel) - { - assert($this->registry !== null); - - if ($this->dom === null) { - throw new \SimplePie\Exception('DOMDocument not found, unable to use '. - 'locator'); - } - if (!class_exists('DOMXpath')) { - throw new \SimplePie\Exception('DOMXpath not found, unable to use '. - 'get_rel_link'); - } - - $xpath = new \DOMXpath($this->dom); - $query = '(//head)[1]/link[@rel and @href]'; - /** @var \DOMNodeList<\DOMElement> */ - $queryResult = $xpath->query($query); - foreach ($queryResult as $link) { - $href = trim($link->getAttribute('href')); - $parsed = $this->registry->call(Misc::class, 'parse_url', [$href]); - if ($parsed['scheme'] === '' || - preg_match('/^https?$/i', $parsed['scheme'])) { - if (method_exists($link, 'getLineNo') && - $this->base_location < $link->getLineNo()) { - $href = $this->registry->call( - Misc::class, - 'absolutize_url', - [trim($link->getAttribute('href')), $this->base] - ); - } else { - $href = $this->registry->call( - Misc::class, - 'absolutize_url', - [trim($link->getAttribute('href')), $this->http_base] - ); - } - if ($href === false) { - return null; - } - $rel_values = explode(' ', strtolower($link->getAttribute('rel'))); - if (in_array($rel, $rel_values)) { - return $href; - } - } - } - - return null; - } - - /** - * @param string[] $array - * @return array<Response>|null - */ - public function extension(array &$array) - { - foreach ($array as $key => $value) { - if ($this->checked_feeds === $this->max_checked_feeds) { - break; - } - $extension = strrchr($value, '.'); - if ($extension !== false && in_array(strtolower($extension), ['.rss', '.rdf', '.atom', '.xml'])) { - $this->checked_feeds++; - - $headers = [ - 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER, - ]; - - try { - $feed = $this->get_http_client()->request(Client::METHOD_GET, $value, $headers); - - if ((!Misc::is_remote_uri($feed->get_final_requested_uri()) || ($feed->get_status_code() === 200 || $feed->get_status_code() > 206 && $feed->get_status_code() < 300)) && $this->is_feed($feed)) { - return [$feed]; - } - } catch (ClientException $th) { - // Just unset and continue. - } - - unset($array[$key]); - } - } - return null; - } - - /** - * @param string[] $array - * @return array<Response>|null - */ - public function body(array &$array) - { - foreach ($array as $key => $value) { - if ($this->checked_feeds === $this->max_checked_feeds) { - break; - } - if (preg_match('/(feed|rss|rdf|atom|xml)/i', $value)) { - $this->checked_feeds++; - $headers = [ - 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER, - ]; - - try { - $feed = $this->get_http_client()->request(Client::METHOD_GET, $value, $headers); - - if ((!Misc::is_remote_uri($feed->get_final_requested_uri()) || ($feed->get_status_code() === 200 || $feed->get_status_code() > 206 && $feed->get_status_code() < 300)) && $this->is_feed($feed)) { - return [$feed]; - } - } catch (ClientException $th) { - // Just unset and continue. - } - - unset($array[$key]); - } - } - return null; - } - - /** - * Get a HTTP client - */ - private function get_http_client(): Client - { - assert($this->registry !== null); - - if ($this->http_client === null) { - $options = [ - 'timeout' => $this->timeout, - 'redirects' => 5, - 'force_fsockopen' => $this->force_fsockopen, - 'curl_options' => $this->curl_options, - ]; - - if ($this->useragent !== null) { - $options['useragent'] = $this->useragent; - } - - return new FileClient( - $this->registry, - $options - ); - } - - return $this->http_client; - } -} - -class_alias('SimplePie\Locator', 'SimplePie_Locator', false); diff --git a/core/vendor/simplepie/simplepie/src/Misc.php b/core/vendor/simplepie/simplepie/src/Misc.php deleted file mode 100644 index 6f9197202c..0000000000 --- a/core/vendor/simplepie/simplepie/src/Misc.php +++ /dev/null @@ -1,2233 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -use SimplePie\XML\Declaration\Parser; - -/** - * Miscellaneous utilities - */ -class Misc -{ - /** @var int|null */ - private static $SIMPLEPIE_BUILD = null; - - /** - * @return string - */ - public static function time_hms(int $seconds) - { - $time = ''; - - $hours = floor($seconds / 3600); - $remainder = $seconds % 3600; - if ($hours > 0) { - $time .= $hours.':'; - } - - $minutes = floor($remainder / 60); - $seconds = $remainder % 60; - if ($minutes < 10 && $hours > 0) { - $minutes = '0' . $minutes; - } - if ($seconds < 10) { - $seconds = '0' . $seconds; - } - - $time .= $minutes.':'; - $time .= $seconds; - - return $time; - } - - /** - * @return string|false - */ - public static function absolutize_url(string $relative, string $base) - { - $iri = \SimplePie\IRI::absolutize(new \SimplePie\IRI($base), $relative); - if ($iri === false) { - return false; - } - return $iri->get_uri(); - } - - /** - * @internal - */ - public static function is_remote_uri(string $uri): bool - { - return preg_match('/^https?:\/\//i', $uri) === 1; - } - - /** - * Get a HTML/XML element from a HTML string - * - * @deprecated since SimplePie 1.3, use DOMDocument instead (parsing HTML with regex is bad!) - * @param string $realname Element name (including namespace prefix if applicable) - * @param string $string HTML document - * @return array<array{tag: string, self_closing: bool, attribs: array<string, array{data: string}>, content?: string}> - */ - public static function get_element(string $realname, string $string) - { - // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.3, use "DOMDocument" instead.'), \E_USER_DEPRECATED); - - $return = []; - $name = preg_quote($realname, '/'); - if (preg_match_all("/<($name)" . \SimplePie\SimplePie::PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { - for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++) { - $return[$i]['tag'] = $realname; - $return[$i]['full'] = $matches[$i][0][0]; - $return[$i]['offset'] = $matches[$i][0][1]; - if (strlen($matches[$i][3][0]) <= 2) { - $return[$i]['self_closing'] = true; - } else { - $return[$i]['self_closing'] = false; - $return[$i]['content'] = $matches[$i][4][0]; - } - $return[$i]['attribs'] = []; - if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER)) { - foreach ($attribs as $attrib) { - if (count($attrib) === 2) { - $attrib[2] = $attrib[1]; - } - $return[$i]['attribs'][strtolower($attrib[1])]['data'] = Misc::entities_decode(end($attrib)); - } - } - } - } - return $return; - } - - /** - * @deprecated since SimplePie 1.9.0. If you need it, you can copy the function to your codebase. But you should consider using `DOMDocument` for any DOM wrangling. - * @param array{tag: string, self_closing: bool, attribs: array<string, array{data: string}>, content: string} $element - * @return string - */ - public static function element_implode(array $element) - { - // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED); - - $full = "<{$element['tag']}"; - foreach ($element['attribs'] as $key => $value) { - $key = strtolower($key); - $full .= " $key=\"" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '"'; - } - if ($element['self_closing']) { - $full .= ' />'; - } else { - $full .= ">{$element['content']}</{$element['tag']}>"; - } - return $full; - } - - /** - * @param string $message - * @param int $level - * @param string $file - * @param int $line - * @return string - */ - public static function error(string $message, int $level, string $file, int $line) - { - if ((error_reporting() & $level) > 0) { - switch ($level) { - case E_USER_ERROR: - $note = 'PHP Error'; - break; - case E_USER_WARNING: - $note = 'PHP Warning'; - break; - case E_USER_NOTICE: - $note = 'PHP Notice'; - break; - default: - $note = 'Unknown Error'; - break; - } - - $log_error = true; - if (!function_exists('error_log')) { - $log_error = false; - } - - $log_file = @ini_get('error_log'); - if (!empty($log_file) && ('syslog' !== $log_file) && !@is_writable($log_file)) { - $log_error = false; - } - - if ($log_error) { - @error_log("$note: $message in $file on line $line", 0); - } - } - - return $message; - } - - /** - * @return string - */ - public static function fix_protocol(string $url, int $http = 1) - { - $url = Misc::normalize_url($url); - $parsed = Misc::parse_url($url); - if ($parsed['scheme'] !== '' && $parsed['scheme'] !== 'http' && $parsed['scheme'] !== 'https') { - return Misc::fix_protocol(Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http); - } - - if ($parsed['scheme'] === '' && $parsed['authority'] === '' && !file_exists($url)) { - return Misc::fix_protocol(Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http); - } - - if ($http === 2 && $parsed['scheme'] !== '') { - return "feed:$url"; - } elseif ($http === 3 && strtolower($parsed['scheme']) === 'http') { - return substr_replace($url, 'podcast', 0, 4); - } elseif ($http === 4 && strtolower($parsed['scheme']) === 'http') { - return substr_replace($url, 'itpc', 0, 4); - } - - return $url; - } - - /** - * @deprecated since SimplePie 1.8.0, use PHP native array_replace_recursive() instead. - * @param array<mixed> $array1 - * @param array<mixed> $array2 - * @return array<mixed> - */ - public static function array_merge_recursive(array $array1, array $array2) - { - foreach ($array2 as $key => $value) { - if (is_array($value)) { - $array1[$key] = Misc::array_merge_recursive($array1[$key], $value); - } else { - $array1[$key] = $value; - } - } - - return $array1; - } - - /** - * @return array<string, string> - */ - public static function parse_url(string $url) - { - $iri = new \SimplePie\IRI($url); - return [ - 'scheme' => (string) $iri->scheme, - 'authority' => (string) $iri->authority, - 'path' => (string) $iri->path, - 'query' => (string) $iri->query, - 'fragment' => (string) $iri->fragment - ]; - } - - /** - * @return string - */ - public static function compress_parse_url(string $scheme = '', string $authority = '', string $path = '', string $query = '', ?string $fragment = '') - { - $iri = new \SimplePie\IRI(''); - $iri->scheme = $scheme; - $iri->authority = $authority; - $iri->path = $path; - $iri->query = $query; - $iri->fragment = $fragment; - return $iri->get_uri(); - } - - /** - * @return string - */ - public static function normalize_url(string $url) - { - $iri = new \SimplePie\IRI($url); - return $iri->get_uri(); - } - - /** - * @deprecated since SimplePie 1.9.0. This functionality is part of `IRI` – if you need it standalone, consider copying the function to your codebase. - * @param array<int, string> $match - * @return string - */ - public static function percent_encoding_normalization(array $match) - { - $integer = hexdec($match[1]); - if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E) { - // Cast for PHPStan, the value would only be float when above PHP_INT_MAX, which would not go in this branch. - return chr((int) $integer); - } - - return strtoupper($match[0]); - } - - /** - * Converts a Windows-1252 encoded string to a UTF-8 encoded string - * - * @static - * @param string $string Windows-1252 encoded string - * @return string UTF-8 encoded string - */ - public static function windows_1252_to_utf8(string $string) - { - static $convert_table = ["\x80" => "\xE2\x82\xAC", "\x81" => "\xEF\xBF\xBD", "\x82" => "\xE2\x80\x9A", "\x83" => "\xC6\x92", "\x84" => "\xE2\x80\x9E", "\x85" => "\xE2\x80\xA6", "\x86" => "\xE2\x80\xA0", "\x87" => "\xE2\x80\xA1", "\x88" => "\xCB\x86", "\x89" => "\xE2\x80\xB0", "\x8A" => "\xC5\xA0", "\x8B" => "\xE2\x80\xB9", "\x8C" => "\xC5\x92", "\x8D" => "\xEF\xBF\xBD", "\x8E" => "\xC5\xBD", "\x8F" => "\xEF\xBF\xBD", "\x90" => "\xEF\xBF\xBD", "\x91" => "\xE2\x80\x98", "\x92" => "\xE2\x80\x99", "\x93" => "\xE2\x80\x9C", "\x94" => "\xE2\x80\x9D", "\x95" => "\xE2\x80\xA2", "\x96" => "\xE2\x80\x93", "\x97" => "\xE2\x80\x94", "\x98" => "\xCB\x9C", "\x99" => "\xE2\x84\xA2", "\x9A" => "\xC5\xA1", "\x9B" => "\xE2\x80\xBA", "\x9C" => "\xC5\x93", "\x9D" => "\xEF\xBF\xBD", "\x9E" => "\xC5\xBE", "\x9F" => "\xC5\xB8", "\xA0" => "\xC2\xA0", "\xA1" => "\xC2\xA1", "\xA2" => "\xC2\xA2", "\xA3" => "\xC2\xA3", "\xA4" => "\xC2\xA4", "\xA5" => "\xC2\xA5", "\xA6" => "\xC2\xA6", "\xA7" => "\xC2\xA7", "\xA8" => "\xC2\xA8", "\xA9" => "\xC2\xA9", "\xAA" => "\xC2\xAA", "\xAB" => "\xC2\xAB", "\xAC" => "\xC2\xAC", "\xAD" => "\xC2\xAD", "\xAE" => "\xC2\xAE", "\xAF" => "\xC2\xAF", "\xB0" => "\xC2\xB0", "\xB1" => "\xC2\xB1", "\xB2" => "\xC2\xB2", "\xB3" => "\xC2\xB3", "\xB4" => "\xC2\xB4", "\xB5" => "\xC2\xB5", "\xB6" => "\xC2\xB6", "\xB7" => "\xC2\xB7", "\xB8" => "\xC2\xB8", "\xB9" => "\xC2\xB9", "\xBA" => "\xC2\xBA", "\xBB" => "\xC2\xBB", "\xBC" => "\xC2\xBC", "\xBD" => "\xC2\xBD", "\xBE" => "\xC2\xBE", "\xBF" => "\xC2\xBF", "\xC0" => "\xC3\x80", "\xC1" => "\xC3\x81", "\xC2" => "\xC3\x82", "\xC3" => "\xC3\x83", "\xC4" => "\xC3\x84", "\xC5" => "\xC3\x85", "\xC6" => "\xC3\x86", "\xC7" => "\xC3\x87", "\xC8" => "\xC3\x88", "\xC9" => "\xC3\x89", "\xCA" => "\xC3\x8A", "\xCB" => "\xC3\x8B", "\xCC" => "\xC3\x8C", "\xCD" => "\xC3\x8D", "\xCE" => "\xC3\x8E", "\xCF" => "\xC3\x8F", "\xD0" => "\xC3\x90", "\xD1" => "\xC3\x91", "\xD2" => "\xC3\x92", "\xD3" => "\xC3\x93", "\xD4" => "\xC3\x94", "\xD5" => "\xC3\x95", "\xD6" => "\xC3\x96", "\xD7" => "\xC3\x97", "\xD8" => "\xC3\x98", "\xD9" => "\xC3\x99", "\xDA" => "\xC3\x9A", "\xDB" => "\xC3\x9B", "\xDC" => "\xC3\x9C", "\xDD" => "\xC3\x9D", "\xDE" => "\xC3\x9E", "\xDF" => "\xC3\x9F", "\xE0" => "\xC3\xA0", "\xE1" => "\xC3\xA1", "\xE2" => "\xC3\xA2", "\xE3" => "\xC3\xA3", "\xE4" => "\xC3\xA4", "\xE5" => "\xC3\xA5", "\xE6" => "\xC3\xA6", "\xE7" => "\xC3\xA7", "\xE8" => "\xC3\xA8", "\xE9" => "\xC3\xA9", "\xEA" => "\xC3\xAA", "\xEB" => "\xC3\xAB", "\xEC" => "\xC3\xAC", "\xED" => "\xC3\xAD", "\xEE" => "\xC3\xAE", "\xEF" => "\xC3\xAF", "\xF0" => "\xC3\xB0", "\xF1" => "\xC3\xB1", "\xF2" => "\xC3\xB2", "\xF3" => "\xC3\xB3", "\xF4" => "\xC3\xB4", "\xF5" => "\xC3\xB5", "\xF6" => "\xC3\xB6", "\xF7" => "\xC3\xB7", "\xF8" => "\xC3\xB8", "\xF9" => "\xC3\xB9", "\xFA" => "\xC3\xBA", "\xFB" => "\xC3\xBB", "\xFC" => "\xC3\xBC", "\xFD" => "\xC3\xBD", "\xFE" => "\xC3\xBE", "\xFF" => "\xC3\xBF"]; - - return strtr($string, $convert_table); - } - - /** - * Change a string from one encoding to another - * - * @param string $data Raw data in $input encoding - * @param string $input Encoding of $data - * @param string $output Encoding you want - * @return string|false False if we can't convert it - */ - public static function change_encoding(string $data, string $input, string $output) - { - $input = Misc::encoding($input); - $output = Misc::encoding($output); - - // We fail to fail on non US-ASCII bytes - if ($input === 'US-ASCII') { - static $non_ascii_octets = ''; - if (!$non_ascii_octets) { - for ($i = 0x80; $i <= 0xFF; $i++) { - $non_ascii_octets .= chr($i); - } - } - $data = substr($data, 0, strcspn($data, $non_ascii_octets)); - } - - // This is first, as behaviour of this is completely predictable - if ($input === 'windows-1252' && $output === 'UTF-8') { - return Misc::windows_1252_to_utf8($data); - } - // This is second, as behaviour of this varies only with PHP version (the middle part of this expression checks the encoding is supported). - elseif (function_exists('mb_convert_encoding') && ($return = Misc::change_encoding_mbstring($data, $input, $output))) { - return $return; - } - // This is third, as behaviour of this varies with OS userland and PHP version - elseif (function_exists('iconv') && ($return = Misc::change_encoding_iconv($data, $input, $output))) { - return $return; - } - // This is last, as behaviour of this varies with OS userland and PHP version - elseif (class_exists('\UConverter') && ($return = Misc::change_encoding_uconverter($data, $input, $output))) { - return $return; - } - - // If we can't do anything, just fail - return false; - } - - /** - * @return string|false - */ - protected static function change_encoding_mbstring(string $data, string $input, string $output) - { - if ($input === 'windows-949') { - $input = 'EUC-KR'; - } - if ($output === 'windows-949') { - $output = 'EUC-KR'; - } - if ($input === 'Windows-31J') { - $input = 'SJIS'; - } - if ($output === 'Windows-31J') { - $output = 'SJIS'; - } - - // Check that the encoding is supported - if (!in_array($input, mb_list_encodings())) { - return false; - } - - if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80") { - return false; - } - - // Let's do some conversion - if ($return = @mb_convert_encoding($data, $output, $input)) { - return $return; - } - - return false; - } - - /** - * @return string|false - */ - protected static function change_encoding_iconv(string $data, string $input, string $output) - { - return @iconv($input, $output, $data); - } - - /** - * @return string|false - */ - protected static function change_encoding_uconverter(string $data, string $input, string $output) - { - return @\UConverter::transcode($data, $output, $input); - } - - /** - * Normalize an encoding name - * - * This is automatically generated by create.php - * - * To generate it, run `php create.php` on the command line, and copy the - * output to replace this function. - * - * @param string $charset Character set to standardise - * @return string Standardised name - */ - public static function encoding(string $charset) - { - // Normalization from UTS #22 - // Cast for PHPStan, the regex should not fail. - switch (strtolower((string) preg_replace('/(?:[^a-zA-Z0-9]+|([^0-9])0+)/', '\1', $charset))) { - case 'adobestandardencoding': - case 'csadobestandardencoding': - return 'Adobe-Standard-Encoding'; - - case 'adobesymbolencoding': - case 'cshppsmath': - return 'Adobe-Symbol-Encoding'; - - case 'ami1251': - case 'amiga1251': - return 'Amiga-1251'; - - case 'ansix31101983': - case 'csat5001983': - case 'csiso99naplps': - case 'isoir99': - case 'naplps': - return 'ANSI_X3.110-1983'; - - case 'arabic7': - case 'asmo449': - case 'csiso89asmo449': - case 'iso9036': - case 'isoir89': - return 'ASMO_449'; - - case 'big5': - case 'csbig5': - return 'Big5'; - - case 'big5hkscs': - return 'Big5-HKSCS'; - - case 'bocu1': - case 'csbocu1': - return 'BOCU-1'; - - case 'brf': - case 'csbrf': - return 'BRF'; - - case 'bs4730': - case 'csiso4unitedkingdom': - case 'gb': - case 'iso646gb': - case 'isoir4': - case 'uk': - return 'BS_4730'; - - case 'bsviewdata': - case 'csiso47bsviewdata': - case 'isoir47': - return 'BS_viewdata'; - - case 'cesu8': - case 'cscesu8': - return 'CESU-8'; - - case 'ca': - case 'csa71': - case 'csaz243419851': - case 'csiso121canadian1': - case 'iso646ca': - case 'isoir121': - return 'CSA_Z243.4-1985-1'; - - case 'csa72': - case 'csaz243419852': - case 'csiso122canadian2': - case 'iso646ca2': - case 'isoir122': - return 'CSA_Z243.4-1985-2'; - - case 'csaz24341985gr': - case 'csiso123csaz24341985gr': - case 'isoir123': - return 'CSA_Z243.4-1985-gr'; - - case 'csiso139csn369103': - case 'csn369103': - case 'isoir139': - return 'CSN_369103'; - - case 'csdecmcs': - case 'dec': - case 'decmcs': - return 'DEC-MCS'; - - case 'csiso21german': - case 'de': - case 'din66003': - case 'iso646de': - case 'isoir21': - return 'DIN_66003'; - - case 'csdkus': - case 'dkus': - return 'dk-us'; - - case 'csiso646danish': - case 'dk': - case 'ds2089': - case 'iso646dk': - return 'DS_2089'; - - case 'csibmebcdicatde': - case 'ebcdicatde': - return 'EBCDIC-AT-DE'; - - case 'csebcdicatdea': - case 'ebcdicatdea': - return 'EBCDIC-AT-DE-A'; - - case 'csebcdiccafr': - case 'ebcdiccafr': - return 'EBCDIC-CA-FR'; - - case 'csebcdicdkno': - case 'ebcdicdkno': - return 'EBCDIC-DK-NO'; - - case 'csebcdicdknoa': - case 'ebcdicdknoa': - return 'EBCDIC-DK-NO-A'; - - case 'csebcdices': - case 'ebcdices': - return 'EBCDIC-ES'; - - case 'csebcdicesa': - case 'ebcdicesa': - return 'EBCDIC-ES-A'; - - case 'csebcdicess': - case 'ebcdicess': - return 'EBCDIC-ES-S'; - - case 'csebcdicfise': - case 'ebcdicfise': - return 'EBCDIC-FI-SE'; - - case 'csebcdicfisea': - case 'ebcdicfisea': - return 'EBCDIC-FI-SE-A'; - - case 'csebcdicfr': - case 'ebcdicfr': - return 'EBCDIC-FR'; - - case 'csebcdicit': - case 'ebcdicit': - return 'EBCDIC-IT'; - - case 'csebcdicpt': - case 'ebcdicpt': - return 'EBCDIC-PT'; - - case 'csebcdicuk': - case 'ebcdicuk': - return 'EBCDIC-UK'; - - case 'csebcdicus': - case 'ebcdicus': - return 'EBCDIC-US'; - - case 'csiso111ecmacyrillic': - case 'ecmacyrillic': - case 'isoir111': - case 'koi8e': - return 'ECMA-cyrillic'; - - case 'csiso17spanish': - case 'es': - case 'iso646es': - case 'isoir17': - return 'ES'; - - case 'csiso85spanish2': - case 'es2': - case 'iso646es2': - case 'isoir85': - return 'ES2'; - - case 'cseucpkdfmtjapanese': - case 'eucjp': - case 'extendedunixcodepackedformatforjapanese': - return 'EUC-JP'; - - case 'cseucfixwidjapanese': - case 'extendedunixcodefixedwidthforjapanese': - return 'Extended_UNIX_Code_Fixed_Width_for_Japanese'; - - case 'gb18030': - return 'GB18030'; - - case 'chinese': - case 'cp936': - case 'csgb2312': - case 'csiso58gb231280': - case 'gb2312': - case 'gb231280': - case 'gbk': - case 'isoir58': - case 'ms936': - case 'windows936': - return 'GBK'; - - case 'cn': - case 'csiso57gb1988': - case 'gb198880': - case 'iso646cn': - case 'isoir57': - return 'GB_1988-80'; - - case 'csiso153gost1976874': - case 'gost1976874': - case 'isoir153': - case 'stsev35888': - return 'GOST_19768-74'; - - case 'csiso150': - case 'csiso150greekccitt': - case 'greekccitt': - case 'isoir150': - return 'greek-ccitt'; - - case 'csiso88greek7': - case 'greek7': - case 'isoir88': - return 'greek7'; - - case 'csiso18greek7old': - case 'greek7old': - case 'isoir18': - return 'greek7-old'; - - case 'cshpdesktop': - case 'hpdesktop': - return 'HP-DeskTop'; - - case 'cshplegal': - case 'hplegal': - return 'HP-Legal'; - - case 'cshpmath8': - case 'hpmath8': - return 'HP-Math8'; - - case 'cshppifont': - case 'hppifont': - return 'HP-Pi-font'; - - case 'cshproman8': - case 'hproman8': - case 'r8': - case 'roman8': - return 'hp-roman8'; - - case 'hzgb2312': - return 'HZ-GB-2312'; - - case 'csibmsymbols': - case 'ibmsymbols': - return 'IBM-Symbols'; - - case 'csibmthai': - case 'ibmthai': - return 'IBM-Thai'; - - case 'cp37': - case 'csibm37': - case 'ebcdiccpca': - case 'ebcdiccpnl': - case 'ebcdiccpus': - case 'ebcdiccpwt': - case 'ibm37': - return 'IBM037'; - - case 'cp38': - case 'csibm38': - case 'ebcdicint': - case 'ibm38': - return 'IBM038'; - - case 'cp273': - case 'csibm273': - case 'ibm273': - return 'IBM273'; - - case 'cp274': - case 'csibm274': - case 'ebcdicbe': - case 'ibm274': - return 'IBM274'; - - case 'cp275': - case 'csibm275': - case 'ebcdicbr': - case 'ibm275': - return 'IBM275'; - - case 'csibm277': - case 'ebcdiccpdk': - case 'ebcdiccpno': - case 'ibm277': - return 'IBM277'; - - case 'cp278': - case 'csibm278': - case 'ebcdiccpfi': - case 'ebcdiccpse': - case 'ibm278': - return 'IBM278'; - - case 'cp280': - case 'csibm280': - case 'ebcdiccpit': - case 'ibm280': - return 'IBM280'; - - case 'cp281': - case 'csibm281': - case 'ebcdicjpe': - case 'ibm281': - return 'IBM281'; - - case 'cp284': - case 'csibm284': - case 'ebcdiccpes': - case 'ibm284': - return 'IBM284'; - - case 'cp285': - case 'csibm285': - case 'ebcdiccpgb': - case 'ibm285': - return 'IBM285'; - - case 'cp290': - case 'csibm290': - case 'ebcdicjpkana': - case 'ibm290': - return 'IBM290'; - - case 'cp297': - case 'csibm297': - case 'ebcdiccpfr': - case 'ibm297': - return 'IBM297'; - - case 'cp420': - case 'csibm420': - case 'ebcdiccpar1': - case 'ibm420': - return 'IBM420'; - - case 'cp423': - case 'csibm423': - case 'ebcdiccpgr': - case 'ibm423': - return 'IBM423'; - - case 'cp424': - case 'csibm424': - case 'ebcdiccphe': - case 'ibm424': - return 'IBM424'; - - case '437': - case 'cp437': - case 'cspc8codepage437': - case 'ibm437': - return 'IBM437'; - - case 'cp500': - case 'csibm500': - case 'ebcdiccpbe': - case 'ebcdiccpch': - case 'ibm500': - return 'IBM500'; - - case 'cp775': - case 'cspc775baltic': - case 'ibm775': - return 'IBM775'; - - case '850': - case 'cp850': - case 'cspc850multilingual': - case 'ibm850': - return 'IBM850'; - - case '851': - case 'cp851': - case 'csibm851': - case 'ibm851': - return 'IBM851'; - - case '852': - case 'cp852': - case 'cspcp852': - case 'ibm852': - return 'IBM852'; - - case '855': - case 'cp855': - case 'csibm855': - case 'ibm855': - return 'IBM855'; - - case '857': - case 'cp857': - case 'csibm857': - case 'ibm857': - return 'IBM857'; - - case 'ccsid858': - case 'cp858': - case 'ibm858': - case 'pcmultilingual850euro': - return 'IBM00858'; - - case '860': - case 'cp860': - case 'csibm860': - case 'ibm860': - return 'IBM860'; - - case '861': - case 'cp861': - case 'cpis': - case 'csibm861': - case 'ibm861': - return 'IBM861'; - - case '862': - case 'cp862': - case 'cspc862latinhebrew': - case 'ibm862': - return 'IBM862'; - - case '863': - case 'cp863': - case 'csibm863': - case 'ibm863': - return 'IBM863'; - - case 'cp864': - case 'csibm864': - case 'ibm864': - return 'IBM864'; - - case '865': - case 'cp865': - case 'csibm865': - case 'ibm865': - return 'IBM865'; - - case '866': - case 'cp866': - case 'csibm866': - case 'ibm866': - return 'IBM866'; - - case 'cp868': - case 'cpar': - case 'csibm868': - case 'ibm868': - return 'IBM868'; - - case '869': - case 'cp869': - case 'cpgr': - case 'csibm869': - case 'ibm869': - return 'IBM869'; - - case 'cp870': - case 'csibm870': - case 'ebcdiccproece': - case 'ebcdiccpyu': - case 'ibm870': - return 'IBM870'; - - case 'cp871': - case 'csibm871': - case 'ebcdiccpis': - case 'ibm871': - return 'IBM871'; - - case 'cp880': - case 'csibm880': - case 'ebcdiccyrillic': - case 'ibm880': - return 'IBM880'; - - case 'cp891': - case 'csibm891': - case 'ibm891': - return 'IBM891'; - - case 'cp903': - case 'csibm903': - case 'ibm903': - return 'IBM903'; - - case '904': - case 'cp904': - case 'csibbm904': - case 'ibm904': - return 'IBM904'; - - case 'cp905': - case 'csibm905': - case 'ebcdiccptr': - case 'ibm905': - return 'IBM905'; - - case 'cp918': - case 'csibm918': - case 'ebcdiccpar2': - case 'ibm918': - return 'IBM918'; - - case 'ccsid924': - case 'cp924': - case 'ebcdiclatin9euro': - case 'ibm924': - return 'IBM00924'; - - case 'cp1026': - case 'csibm1026': - case 'ibm1026': - return 'IBM1026'; - - case 'ibm1047': - return 'IBM1047'; - - case 'ccsid1140': - case 'cp1140': - case 'ebcdicus37euro': - case 'ibm1140': - return 'IBM01140'; - - case 'ccsid1141': - case 'cp1141': - case 'ebcdicde273euro': - case 'ibm1141': - return 'IBM01141'; - - case 'ccsid1142': - case 'cp1142': - case 'ebcdicdk277euro': - case 'ebcdicno277euro': - case 'ibm1142': - return 'IBM01142'; - - case 'ccsid1143': - case 'cp1143': - case 'ebcdicfi278euro': - case 'ebcdicse278euro': - case 'ibm1143': - return 'IBM01143'; - - case 'ccsid1144': - case 'cp1144': - case 'ebcdicit280euro': - case 'ibm1144': - return 'IBM01144'; - - case 'ccsid1145': - case 'cp1145': - case 'ebcdices284euro': - case 'ibm1145': - return 'IBM01145'; - - case 'ccsid1146': - case 'cp1146': - case 'ebcdicgb285euro': - case 'ibm1146': - return 'IBM01146'; - - case 'ccsid1147': - case 'cp1147': - case 'ebcdicfr297euro': - case 'ibm1147': - return 'IBM01147'; - - case 'ccsid1148': - case 'cp1148': - case 'ebcdicinternational500euro': - case 'ibm1148': - return 'IBM01148'; - - case 'ccsid1149': - case 'cp1149': - case 'ebcdicis871euro': - case 'ibm1149': - return 'IBM01149'; - - case 'csiso143iecp271': - case 'iecp271': - case 'isoir143': - return 'IEC_P27-1'; - - case 'csiso49inis': - case 'inis': - case 'isoir49': - return 'INIS'; - - case 'csiso50inis8': - case 'inis8': - case 'isoir50': - return 'INIS-8'; - - case 'csiso51iniscyrillic': - case 'iniscyrillic': - case 'isoir51': - return 'INIS-cyrillic'; - - case 'csinvariant': - case 'invariant': - return 'INVARIANT'; - - case 'iso2022cn': - return 'ISO-2022-CN'; - - case 'iso2022cnext': - return 'ISO-2022-CN-EXT'; - - case 'csiso2022jp': - case 'iso2022jp': - return 'ISO-2022-JP'; - - case 'csiso2022jp2': - case 'iso2022jp2': - return 'ISO-2022-JP-2'; - - case 'csiso2022kr': - case 'iso2022kr': - return 'ISO-2022-KR'; - - case 'cswindows30latin1': - case 'iso88591windows30latin1': - return 'ISO-8859-1-Windows-3.0-Latin-1'; - - case 'cswindows31latin1': - case 'iso88591windows31latin1': - return 'ISO-8859-1-Windows-3.1-Latin-1'; - - case 'csisolatin2': - case 'iso88592': - case 'iso885921987': - case 'isoir101': - case 'l2': - case 'latin2': - return 'ISO-8859-2'; - - case 'cswindows31latin2': - case 'iso88592windowslatin2': - return 'ISO-8859-2-Windows-Latin-2'; - - case 'csisolatin3': - case 'iso88593': - case 'iso885931988': - case 'isoir109': - case 'l3': - case 'latin3': - return 'ISO-8859-3'; - - case 'csisolatin4': - case 'iso88594': - case 'iso885941988': - case 'isoir110': - case 'l4': - case 'latin4': - return 'ISO-8859-4'; - - case 'csisolatincyrillic': - case 'cyrillic': - case 'iso88595': - case 'iso885951988': - case 'isoir144': - return 'ISO-8859-5'; - - case 'arabic': - case 'asmo708': - case 'csisolatinarabic': - case 'ecma114': - case 'iso88596': - case 'iso885961987': - case 'isoir127': - return 'ISO-8859-6'; - - case 'csiso88596e': - case 'iso88596e': - return 'ISO-8859-6-E'; - - case 'csiso88596i': - case 'iso88596i': - return 'ISO-8859-6-I'; - - case 'csisolatingreek': - case 'ecma118': - case 'elot928': - case 'greek': - case 'greek8': - case 'iso88597': - case 'iso885971987': - case 'isoir126': - return 'ISO-8859-7'; - - case 'csisolatinhebrew': - case 'hebrew': - case 'iso88598': - case 'iso885981988': - case 'isoir138': - return 'ISO-8859-8'; - - case 'csiso88598e': - case 'iso88598e': - return 'ISO-8859-8-E'; - - case 'csiso88598i': - case 'iso88598i': - return 'ISO-8859-8-I'; - - case 'cswindows31latin5': - case 'iso88599windowslatin5': - return 'ISO-8859-9-Windows-Latin-5'; - - case 'csisolatin6': - case 'iso885910': - case 'iso8859101992': - case 'isoir157': - case 'l6': - case 'latin6': - return 'ISO-8859-10'; - - case 'iso885913': - return 'ISO-8859-13'; - - case 'iso885914': - case 'iso8859141998': - case 'isoceltic': - case 'isoir199': - case 'l8': - case 'latin8': - return 'ISO-8859-14'; - - case 'iso885915': - case 'latin9': - return 'ISO-8859-15'; - - case 'iso885916': - case 'iso8859162001': - case 'isoir226': - case 'l10': - case 'latin10': - return 'ISO-8859-16'; - - case 'iso10646j1': - return 'ISO-10646-J-1'; - - case 'csunicode': - case 'iso10646ucs2': - return 'ISO-10646-UCS-2'; - - case 'csucs4': - case 'iso10646ucs4': - return 'ISO-10646-UCS-4'; - - case 'csunicodeascii': - case 'iso10646ucsbasic': - return 'ISO-10646-UCS-Basic'; - - case 'csunicodelatin1': - case 'iso10646': - case 'iso10646unicodelatin1': - return 'ISO-10646-Unicode-Latin1'; - - case 'csiso10646utf1': - case 'iso10646utf1': - return 'ISO-10646-UTF-1'; - - case 'csiso115481': - case 'iso115481': - case 'isotr115481': - return 'ISO-11548-1'; - - case 'csiso90': - case 'isoir90': - return 'iso-ir-90'; - - case 'csunicodeibm1261': - case 'isounicodeibm1261': - return 'ISO-Unicode-IBM-1261'; - - case 'csunicodeibm1264': - case 'isounicodeibm1264': - return 'ISO-Unicode-IBM-1264'; - - case 'csunicodeibm1265': - case 'isounicodeibm1265': - return 'ISO-Unicode-IBM-1265'; - - case 'csunicodeibm1268': - case 'isounicodeibm1268': - return 'ISO-Unicode-IBM-1268'; - - case 'csunicodeibm1276': - case 'isounicodeibm1276': - return 'ISO-Unicode-IBM-1276'; - - case 'csiso646basic1983': - case 'iso646basic1983': - case 'ref': - return 'ISO_646.basic:1983'; - - case 'csiso2intlrefversion': - case 'irv': - case 'iso646irv1983': - case 'isoir2': - return 'ISO_646.irv:1983'; - - case 'csiso2033': - case 'e13b': - case 'iso20331983': - case 'isoir98': - return 'ISO_2033-1983'; - - case 'csiso5427cyrillic': - case 'iso5427': - case 'isoir37': - return 'ISO_5427'; - - case 'iso5427cyrillic1981': - case 'iso54271981': - case 'isoir54': - return 'ISO_5427:1981'; - - case 'csiso5428greek': - case 'iso54281980': - case 'isoir55': - return 'ISO_5428:1980'; - - case 'csiso6937add': - case 'iso6937225': - case 'isoir152': - return 'ISO_6937-2-25'; - - case 'csisotextcomm': - case 'iso69372add': - case 'isoir142': - return 'ISO_6937-2-add'; - - case 'csiso8859supp': - case 'iso8859supp': - case 'isoir154': - case 'latin125': - return 'ISO_8859-supp'; - - case 'csiso10367box': - case 'iso10367box': - case 'isoir155': - return 'ISO_10367-box'; - - case 'csiso15italian': - case 'iso646it': - case 'isoir15': - case 'it': - return 'IT'; - - case 'csiso13jisc6220jp': - case 'isoir13': - case 'jisc62201969': - case 'jisc62201969jp': - case 'katakana': - case 'x2017': - return 'JIS_C6220-1969-jp'; - - case 'csiso14jisc6220ro': - case 'iso646jp': - case 'isoir14': - case 'jisc62201969ro': - case 'jp': - return 'JIS_C6220-1969-ro'; - - case 'csiso42jisc62261978': - case 'isoir42': - case 'jisc62261978': - return 'JIS_C6226-1978'; - - case 'csiso87jisx208': - case 'isoir87': - case 'jisc62261983': - case 'jisx2081983': - case 'x208': - return 'JIS_C6226-1983'; - - case 'csiso91jisc62291984a': - case 'isoir91': - case 'jisc62291984a': - case 'jpocra': - return 'JIS_C6229-1984-a'; - - case 'csiso92jisc62991984b': - case 'iso646jpocrb': - case 'isoir92': - case 'jisc62291984b': - case 'jpocrb': - return 'JIS_C6229-1984-b'; - - case 'csiso93jis62291984badd': - case 'isoir93': - case 'jisc62291984badd': - case 'jpocrbadd': - return 'JIS_C6229-1984-b-add'; - - case 'csiso94jis62291984hand': - case 'isoir94': - case 'jisc62291984hand': - case 'jpocrhand': - return 'JIS_C6229-1984-hand'; - - case 'csiso95jis62291984handadd': - case 'isoir95': - case 'jisc62291984handadd': - case 'jpocrhandadd': - return 'JIS_C6229-1984-hand-add'; - - case 'csiso96jisc62291984kana': - case 'isoir96': - case 'jisc62291984kana': - return 'JIS_C6229-1984-kana'; - - case 'csjisencoding': - case 'jisencoding': - return 'JIS_Encoding'; - - case 'cshalfwidthkatakana': - case 'jisx201': - case 'x201': - return 'JIS_X0201'; - - case 'csiso159jisx2121990': - case 'isoir159': - case 'jisx2121990': - case 'x212': - return 'JIS_X0212-1990'; - - case 'csiso141jusib1002': - case 'iso646yu': - case 'isoir141': - case 'js': - case 'jusib1002': - case 'yu': - return 'JUS_I.B1.002'; - - case 'csiso147macedonian': - case 'isoir147': - case 'jusib1003mac': - case 'macedonian': - return 'JUS_I.B1.003-mac'; - - case 'csiso146serbian': - case 'isoir146': - case 'jusib1003serb': - case 'serbian': - return 'JUS_I.B1.003-serb'; - - case 'koi7switched': - return 'KOI7-switched'; - - case 'cskoi8r': - case 'koi8r': - return 'KOI8-R'; - - case 'koi8u': - return 'KOI8-U'; - - case 'csksc5636': - case 'iso646kr': - case 'ksc5636': - return 'KSC5636'; - - case 'cskz1048': - case 'kz1048': - case 'rk1048': - case 'strk10482002': - return 'KZ-1048'; - - case 'csiso19latingreek': - case 'isoir19': - case 'latingreek': - return 'latin-greek'; - - case 'csiso27latingreek1': - case 'isoir27': - case 'latingreek1': - return 'Latin-greek-1'; - - case 'csiso158lap': - case 'isoir158': - case 'lap': - case 'latinlap': - return 'latin-lap'; - - case 'csmacintosh': - case 'mac': - case 'macintosh': - return 'macintosh'; - - case 'csmicrosoftpublishing': - case 'microsoftpublishing': - return 'Microsoft-Publishing'; - - case 'csmnem': - case 'mnem': - return 'MNEM'; - - case 'csmnemonic': - case 'mnemonic': - return 'MNEMONIC'; - - case 'csiso86hungarian': - case 'hu': - case 'iso646hu': - case 'isoir86': - case 'msz77953': - return 'MSZ_7795.3'; - - case 'csnatsdano': - case 'isoir91': - case 'natsdano': - return 'NATS-DANO'; - - case 'csnatsdanoadd': - case 'isoir92': - case 'natsdanoadd': - return 'NATS-DANO-ADD'; - - case 'csnatssefi': - case 'isoir81': - case 'natssefi': - return 'NATS-SEFI'; - - case 'csnatssefiadd': - case 'isoir82': - case 'natssefiadd': - return 'NATS-SEFI-ADD'; - - case 'csiso151cuba': - case 'cuba': - case 'iso646cu': - case 'isoir151': - case 'ncnc1081': - return 'NC_NC00-10:81'; - - case 'csiso69french': - case 'fr': - case 'iso646fr': - case 'isoir69': - case 'nfz62010': - return 'NF_Z_62-010'; - - case 'csiso25french': - case 'iso646fr1': - case 'isoir25': - case 'nfz620101973': - return 'NF_Z_62-010_(1973)'; - - case 'csiso60danishnorwegian': - case 'csiso60norwegian1': - case 'iso646no': - case 'isoir60': - case 'no': - case 'ns45511': - return 'NS_4551-1'; - - case 'csiso61norwegian2': - case 'iso646no2': - case 'isoir61': - case 'no2': - case 'ns45512': - return 'NS_4551-2'; - - case 'osdebcdicdf3irv': - return 'OSD_EBCDIC_DF03_IRV'; - - case 'osdebcdicdf41': - return 'OSD_EBCDIC_DF04_1'; - - case 'osdebcdicdf415': - return 'OSD_EBCDIC_DF04_15'; - - case 'cspc8danishnorwegian': - case 'pc8danishnorwegian': - return 'PC8-Danish-Norwegian'; - - case 'cspc8turkish': - case 'pc8turkish': - return 'PC8-Turkish'; - - case 'csiso16portuguese': - case 'iso646pt': - case 'isoir16': - case 'pt': - return 'PT'; - - case 'csiso84portuguese2': - case 'iso646pt2': - case 'isoir84': - case 'pt2': - return 'PT2'; - - case 'cp154': - case 'csptcp154': - case 'cyrillicasian': - case 'pt154': - case 'ptcp154': - return 'PTCP154'; - - case 'scsu': - return 'SCSU'; - - case 'csiso10swedish': - case 'fi': - case 'iso646fi': - case 'iso646se': - case 'isoir10': - case 'se': - case 'sen850200b': - return 'SEN_850200_B'; - - case 'csiso11swedishfornames': - case 'iso646se2': - case 'isoir11': - case 'se2': - case 'sen850200c': - return 'SEN_850200_C'; - - case 'csiso102t617bit': - case 'isoir102': - case 't617bit': - return 'T.61-7bit'; - - case 'csiso103t618bit': - case 'isoir103': - case 't61': - case 't618bit': - return 'T.61-8bit'; - - case 'csiso128t101g2': - case 'isoir128': - case 't101g2': - return 'T.101-G2'; - - case 'cstscii': - case 'tscii': - return 'TSCII'; - - case 'csunicode11': - case 'unicode11': - return 'UNICODE-1-1'; - - case 'csunicode11utf7': - case 'unicode11utf7': - return 'UNICODE-1-1-UTF-7'; - - case 'csunknown8bit': - case 'unknown8bit': - return 'UNKNOWN-8BIT'; - - case 'ansix341968': - case 'ansix341986': - case 'ascii': - case 'cp367': - case 'csascii': - case 'ibm367': - case 'iso646irv1991': - case 'iso646us': - case 'isoir6': - case 'us': - case 'usascii': - return 'US-ASCII'; - - case 'csusdk': - case 'usdk': - return 'us-dk'; - - case 'utf7': - return 'UTF-7'; - - case 'utf8': - return 'UTF-8'; - - case 'utf16': - return 'UTF-16'; - - case 'utf16be': - return 'UTF-16BE'; - - case 'utf16le': - return 'UTF-16LE'; - - case 'utf32': - return 'UTF-32'; - - case 'utf32be': - return 'UTF-32BE'; - - case 'utf32le': - return 'UTF-32LE'; - - case 'csventurainternational': - case 'venturainternational': - return 'Ventura-International'; - - case 'csventuramath': - case 'venturamath': - return 'Ventura-Math'; - - case 'csventuraus': - case 'venturaus': - return 'Ventura-US'; - - case 'csiso70videotexsupp1': - case 'isoir70': - case 'videotexsuppl': - return 'videotex-suppl'; - - case 'csviqr': - case 'viqr': - return 'VIQR'; - - case 'csviscii': - case 'viscii': - return 'VISCII'; - - case 'csshiftjis': - case 'cswindows31j': - case 'mskanji': - case 'shiftjis': - case 'windows31j': - return 'Windows-31J'; - - case 'iso885911': - case 'tis620': - return 'windows-874'; - - case 'cseuckr': - case 'csksc56011987': - case 'euckr': - case 'isoir149': - case 'korean': - case 'ksc5601': - case 'ksc56011987': - case 'ksc56011989': - case 'windows949': - return 'windows-949'; - - case 'windows1250': - return 'windows-1250'; - - case 'windows1251': - return 'windows-1251'; - - case 'cp819': - case 'csisolatin1': - case 'ibm819': - case 'iso88591': - case 'iso885911987': - case 'isoir100': - case 'l1': - case 'latin1': - case 'windows1252': - return 'windows-1252'; - - case 'windows1253': - return 'windows-1253'; - - case 'csisolatin5': - case 'iso88599': - case 'iso885991989': - case 'isoir148': - case 'l5': - case 'latin5': - case 'windows1254': - return 'windows-1254'; - - case 'windows1255': - return 'windows-1255'; - - case 'windows1256': - return 'windows-1256'; - - case 'windows1257': - return 'windows-1257'; - - case 'windows1258': - return 'windows-1258'; - - default: - return $charset; - } - } - - /** - * @return string - */ - public static function get_curl_version() - { - if (is_array($curl = curl_version())) { - $curl = $curl['version']; - } else { - $curl = '0'; - } - return $curl; - } - - /** - * Strip HTML comments - * - * @deprecated since SimplePie 1.9.0. If you need it, you can copy the function to your codebase. But you should consider using `DOMDocument` for any DOM wrangling. - * @param string $data Data to strip comments from - * @return string Comment stripped string - */ - public static function strip_comments(string $data) - { - // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED); - - $output = ''; - while (($start = strpos($data, '<!--')) !== false) { - $output .= substr($data, 0, $start); - if (($end = strpos($data, '-->', $start)) !== false) { - $data = substr_replace($data, '', 0, $end + 3); - } else { - $data = ''; - } - } - return $output . $data; - } - - /** - * @return int|false - */ - public static function parse_date(string $dt) - { - $parser = \SimplePie\Parse\Date::get(); - return $parser->parse($dt); - } - - /** - * Decode HTML entities - * - * @deprecated since SimplePie 1.3, use DOMDocument instead - * @param string $data Input data - * @return string Output data - */ - public static function entities_decode(string $data) - { - // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.3, use "DOMDocument" instead.'), \E_USER_DEPRECATED); - - $decoder = new \SimplePie_Decode_HTML_Entities($data); - return $decoder->parse(); - } - - /** - * Remove RFC822 comments - * - * @deprecated since SimplePie 1.9.0. If you need it, consider copying the function to your codebase. - * @param string $string Data to strip comments from - * @return string Comment stripped string - */ - public static function uncomment_rfc822(string $string) - { - // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED); - - $position = 0; - $length = strlen($string); - $depth = 0; - - $output = ''; - - while ($position < $length && ($pos = strpos($string, '(', $position)) !== false) { - $output .= substr($string, $position, $pos - $position); - $position = $pos + 1; - if ($string[$pos - 1] !== '\\') { - $depth++; - while ($depth && $position < $length) { - $position += strcspn($string, '()', $position); - if ($string[$position - 1] === '\\') { - $position++; - continue; - } elseif (isset($string[$position])) { - switch ($string[$position]) { - case '(': - $depth++; - break; - - case ')': - $depth--; - break; - } - $position++; - } else { - break; - } - } - } else { - $output .= '('; - } - } - $output .= substr($string, $position); - - return $output; - } - - /** - * @return string - */ - public static function parse_mime(string $mime) - { - if (($pos = strpos($mime, ';')) === false) { - return trim($mime); - } - - return trim(substr($mime, 0, $pos)); - } - - /** - * @param array<string, array<string, string>> $attribs - * @return int-mask-of<SimplePie::CONSTRUCT_*> - */ - public static function atom_03_construct_type(array $attribs) - { - if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode'])) === 'base64') { - $mode = \SimplePie\SimplePie::CONSTRUCT_BASE64; - } else { - $mode = \SimplePie\SimplePie::CONSTRUCT_NONE; - } - if (isset($attribs['']['type'])) { - switch (strtolower(trim($attribs['']['type']))) { - case 'text': - case 'text/plain': - return \SimplePie\SimplePie::CONSTRUCT_TEXT | $mode; - - case 'html': - case 'text/html': - return \SimplePie\SimplePie::CONSTRUCT_HTML | $mode; - - case 'xhtml': - case 'application/xhtml+xml': - return \SimplePie\SimplePie::CONSTRUCT_XHTML | $mode; - - default: - return \SimplePie\SimplePie::CONSTRUCT_NONE | $mode; - } - } - - return \SimplePie\SimplePie::CONSTRUCT_TEXT | $mode; - } - - /** - * @param array<string, array<string, string>> $attribs - * @return int-mask-of<SimplePie::CONSTRUCT_*> - */ - public static function atom_10_construct_type(array $attribs) - { - if (isset($attribs['']['type'])) { - switch (strtolower(trim($attribs['']['type']))) { - case 'text': - return \SimplePie\SimplePie::CONSTRUCT_TEXT; - - case 'html': - return \SimplePie\SimplePie::CONSTRUCT_HTML; - - case 'xhtml': - return \SimplePie\SimplePie::CONSTRUCT_XHTML; - - default: - return \SimplePie\SimplePie::CONSTRUCT_NONE; - } - } - return \SimplePie\SimplePie::CONSTRUCT_TEXT; - } - - /** - * @param array<string, array<string, string>> $attribs - * @return int-mask-of<SimplePie::CONSTRUCT_*> - */ - public static function atom_10_content_construct_type(array $attribs) - { - if (isset($attribs['']['type'])) { - $type = strtolower(trim($attribs['']['type'])); - switch ($type) { - case 'text': - return \SimplePie\SimplePie::CONSTRUCT_TEXT; - - case 'html': - return \SimplePie\SimplePie::CONSTRUCT_HTML; - - case 'xhtml': - return \SimplePie\SimplePie::CONSTRUCT_XHTML; - } - if (in_array(substr($type, -4), ['+xml', '/xml']) || substr($type, 0, 5) === 'text/') { - return \SimplePie\SimplePie::CONSTRUCT_NONE; - } else { - return \SimplePie\SimplePie::CONSTRUCT_BASE64; - } - } - - return \SimplePie\SimplePie::CONSTRUCT_TEXT; - } - - /** - * @return bool - */ - public static function is_isegment_nz_nc(string $string) - { - return (bool) preg_match('/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string); - } - - /** - * @return string[] - */ - public static function space_separated_tokens(string $string) - { - $space_characters = "\x20\x09\x0A\x0B\x0C\x0D"; - $string_length = strlen($string); - - $position = strspn($string, $space_characters); - $tokens = []; - - while ($position < $string_length) { - $len = strcspn($string, $space_characters, $position); - $tokens[] = substr($string, $position, $len); - $position += $len; - $position += strspn($string, $space_characters, $position); - } - - return $tokens; - } - - /** - * Converts a unicode codepoint to a UTF-8 character - * - * @static - * @param int $codepoint Unicode codepoint - * @return string|false UTF-8 character - */ - public static function codepoint_to_utf8(int $codepoint) - { - if ($codepoint < 0) { - return false; - } elseif ($codepoint <= 0x7f) { - return chr($codepoint); - } elseif ($codepoint <= 0x7ff) { - return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f)); - } elseif ($codepoint <= 0xffff) { - return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); - } elseif ($codepoint <= 0x10ffff) { - return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); - } - - // U+FFFD REPLACEMENT CHARACTER - return "\xEF\xBF\xBD"; - } - - /** - * Similar to parse_str() - * - * Returns an associative array of name/value pairs, where the value is an - * array of values that have used the same name - * - * @deprecated since SimplePie 1.9.0. If you need it, consider copying the function to your codebase. - * @static - * @param string $str The input string. - * @return array<string, array<string|null>> - */ - public static function parse_str(string $str) - { - // trigger_error(sprintf('Using method "' . __METHOD__ . '" is deprecated since SimplePie 1.9.'), \E_USER_DEPRECATED); - - $return = []; - $str = explode('&', $str); - - foreach ($str as $section) { - if (strpos($section, '=') !== false) { - [$name, $value] = explode('=', $section, 2); - $return[urldecode($name)][] = urldecode($value); - } else { - $return[urldecode($section)][] = null; - } - } - - return $return; - } - - /** - * Detect XML encoding, as per XML 1.0 Appendix F.1 - * - * @todo Add support for EBCDIC - * @param string $data XML data - * @param \SimplePie\Registry $registry Class registry - * @return array<string> Possible encodings - */ - public static function xml_encoding(string $data, \SimplePie\Registry $registry) - { - // UTF-32 Big Endian BOM - if (substr($data, 0, 4) === "\x00\x00\xFE\xFF") { - $encoding[] = 'UTF-32BE'; - } - // UTF-32 Little Endian BOM - elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00") { - $encoding[] = 'UTF-32LE'; - } - // UTF-16 Big Endian BOM - elseif (substr($data, 0, 2) === "\xFE\xFF") { - $encoding[] = 'UTF-16BE'; - } - // UTF-16 Little Endian BOM - elseif (substr($data, 0, 2) === "\xFF\xFE") { - $encoding[] = 'UTF-16LE'; - } - // UTF-8 BOM - elseif (substr($data, 0, 3) === "\xEF\xBB\xBF") { - $encoding[] = 'UTF-8'; - } - // UTF-32 Big Endian Without BOM - elseif (substr($data, 0, 20) === "\x00\x00\x00\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C") { - if ($pos = strpos($data, "\x00\x00\x00\x3F\x00\x00\x00\x3E")) { - $parser = $registry->create(Parser::class, [Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32BE', 'UTF-8')]); - if ($parser->parse()) { - $encoding[] = $parser->encoding; - } - } - $encoding[] = 'UTF-32BE'; - } - // UTF-32 Little Endian Without BOM - elseif (substr($data, 0, 20) === "\x3C\x00\x00\x00\x3F\x00\x00\x00\x78\x00\x00\x00\x6D\x00\x00\x00\x6C\x00\x00\x00") { - if ($pos = strpos($data, "\x3F\x00\x00\x00\x3E\x00\x00\x00")) { - $parser = $registry->create(Parser::class, [Misc::change_encoding(substr($data, 20, $pos - 20), 'UTF-32LE', 'UTF-8')]); - if ($parser->parse()) { - $encoding[] = $parser->encoding; - } - } - $encoding[] = 'UTF-32LE'; - } - // UTF-16 Big Endian Without BOM - elseif (substr($data, 0, 10) === "\x00\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C") { - if ($pos = strpos($data, "\x00\x3F\x00\x3E")) { - $parser = $registry->create(Parser::class, [Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16BE', 'UTF-8')]); - if ($parser->parse()) { - $encoding[] = $parser->encoding; - } - } - $encoding[] = 'UTF-16BE'; - } - // UTF-16 Little Endian Without BOM - elseif (substr($data, 0, 10) === "\x3C\x00\x3F\x00\x78\x00\x6D\x00\x6C\x00") { - if ($pos = strpos($data, "\x3F\x00\x3E\x00")) { - $parser = $registry->create(Parser::class, [Misc::change_encoding(substr($data, 20, $pos - 10), 'UTF-16LE', 'UTF-8')]); - if ($parser->parse()) { - $encoding[] = $parser->encoding; - } - } - $encoding[] = 'UTF-16LE'; - } - // US-ASCII (or superset) - elseif (substr($data, 0, 5) === "\x3C\x3F\x78\x6D\x6C") { - if ($pos = strpos($data, "\x3F\x3E")) { - $parser = $registry->create(Parser::class, [substr($data, 5, $pos - 5)]); - if ($parser->parse()) { - $encoding[] = $parser->encoding; - } - } - $encoding[] = 'UTF-8'; - } - // Fallback to UTF-8 - else { - $encoding[] = 'UTF-8'; - } - return $encoding; - } - - /** - * @return void - */ - public static function output_javascript() - { - if (function_exists('ob_gzhandler')) { - ob_start('ob_gzhandler'); - } - header('Content-type: text/javascript; charset: UTF-8'); - header('Cache-Control: must-revalidate'); - header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days - - $body = <<<JS -function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) { - if (placeholder != '') { - document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>'); - } - else { - document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" src="'+link+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="true" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>'); - } -} - -function embed_flash(bgcolor, width, height, link, loop, type) { - document.writeln('<embed src="'+link+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+'" quality="high" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" loop="'+loop+'"></embed>'); -} - -function embed_flv(width, height, link, placeholder, loop, player) { - document.writeln('<embed src="'+player+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+'" height="'+height+'" wmode="transparent" flashvars="file='+link+'&autostart=false&repeat='+loop+'&showdigits=true&showfsbutton=false"></embed>'); -} - -function embed_wmedia(width, height, link) { - document.writeln('<embed type="application/x-mplayer2" src="'+link+'" autosize="1" width="'+width+'" height="'+height+'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>'); -} -JS; - echo $body; - } - - /** - * Get the SimplePie build timestamp - * - * Uses the git index if it exists, otherwise uses the modification time - * of the newest file. - * - * @return int - */ - public static function get_build() - { - if (self::$SIMPLEPIE_BUILD !== null) { - return self::$SIMPLEPIE_BUILD; - } - - $root = dirname(__FILE__, 2); - if (file_exists($root . '/.git/index')) { - self::$SIMPLEPIE_BUILD = (int) filemtime($root . '/.git/index'); - - return self::$SIMPLEPIE_BUILD; - } elseif (file_exists($root . '/src')) { - $time = 0; - foreach (glob($root . '/src/*.php') ?: [] as $file) { - if (($mtime = filemtime($file)) > $time) { - $time = $mtime; - } - } - - self::$SIMPLEPIE_BUILD = $time; - - return self::$SIMPLEPIE_BUILD; - } - - self::$SIMPLEPIE_BUILD = (int) filemtime(__FILE__); - - return self::$SIMPLEPIE_BUILD; - } - - /** - * Get the default user agent string - * - * @return string - */ - public static function get_default_useragent() - { - return \SimplePie\SimplePie::NAME . '/' . \SimplePie\SimplePie::VERSION . ' (Feed Parser; ' . \SimplePie\SimplePie::URL . '; Allow like Gecko) Build/' . static::get_build(); - } - - /** - * Format debugging information - * - * @return string - */ - public static function debug(SimplePie &$sp) - { - $info = 'SimplePie ' . \SimplePie\SimplePie::VERSION . ' Build ' . static::get_build() . "\n"; - $info .= 'PHP ' . PHP_VERSION . "\n"; - if ($sp->error() !== null) { - // TODO: Remove cast with multifeeds. - $info .= 'Error occurred: ' . implode(', ', (array) $sp->error()) . "\n"; - } else { - $info .= "No error found.\n"; - } - $info .= "Extensions:\n"; - $extensions = ['pcre', 'curl', 'zlib', 'mbstring', 'iconv', 'xmlreader', 'xml']; - foreach ($extensions as $ext) { - if (extension_loaded($ext)) { - $info .= " $ext loaded\n"; - switch ($ext) { - case 'pcre': - $info .= ' Version ' . PCRE_VERSION . "\n"; - break; - case 'curl': - $version = (array) curl_version(); - $info .= ' Version ' . $version['version'] . "\n"; - break; - case 'iconv': - $info .= ' Version ' . ICONV_VERSION . "\n"; - break; - case 'xml': - $info .= ' Version ' . LIBXML_DOTTED_VERSION . "\n"; - break; - } - } else { - $info .= " $ext not loaded\n"; - } - } - return $info; - } - - /** - * @return bool - */ - public static function silence_errors(int $num, string $str) - { - // No-op - return true; - } - - /** - * Sanitize a URL by removing HTTP credentials. - * @param string $url the URL to sanitize. - * @return string the same URL without HTTP credentials. - */ - public static function url_remove_credentials(string $url) - { - // Cast for PHPStan: I do not think this can fail. - // The regex is valid and there should be no backtracking. - // https://github.com/phpstan/phpstan/issues/11547 - return (string) preg_replace('#^(https?://)[^/:@]+:[^/:@]+@#i', '$1', $url); - } -} - -class_alias('SimplePie\Misc', 'SimplePie_Misc', false); diff --git a/core/vendor/simplepie/simplepie/src/Net/IPv6.php b/core/vendor/simplepie/simplepie/src/Net/IPv6.php deleted file mode 100644 index db931529f1..0000000000 --- a/core/vendor/simplepie/simplepie/src/Net/IPv6.php +++ /dev/null @@ -1,224 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie\Net; - -/** - * Class to validate and to work with IPv6 addresses. - * - * @copyright 2003-2005 The PHP Group - * @license http://www.opensource.org/licenses/bsd-license.php - * @link http://pear.php.net/package/Net_IPv6 - * @author Alexander Merz <alexander.merz@web.de> - * @author elfrink at introweb dot nl - * @author Josh Peck <jmp at joshpeck dot org> - * @author Sam Sneddon <geoffers@gmail.com> - */ -class IPv6 -{ - /** - * Uncompresses an IPv6 address - * - * RFC 4291 allows you to compress consecutive zero pieces in an address to - * '::'. This method expects a valid IPv6 address and expands the '::' to - * the required number of zero pieces. - * - * Example: FF01::101 -> FF01:0:0:0:0:0:0:101 - * ::1 -> 0:0:0:0:0:0:0:1 - * - * @author Alexander Merz <alexander.merz@web.de> - * @author elfrink at introweb dot nl - * @author Josh Peck <jmp at joshpeck dot org> - * @copyright 2003-2005 The PHP Group - * @license http://www.opensource.org/licenses/bsd-license.php - * @param string $ip An IPv6 address - * @return string The uncompressed IPv6 address - */ - public static function uncompress(string $ip) - { - $c1 = -1; - $c2 = -1; - if (substr_count($ip, '::') === 1) { - [$ip1, $ip2] = explode('::', $ip); - if ($ip1 === '') { - $c1 = -1; - } else { - $c1 = substr_count($ip1, ':'); - } - if ($ip2 === '') { - $c2 = -1; - } else { - $c2 = substr_count($ip2, ':'); - } - if (strpos($ip2, '.') !== false) { - $c2++; - } - // :: - if ($c1 === -1 && $c2 === -1) { - $ip = '0:0:0:0:0:0:0:0'; - } - // ::xxx - elseif ($c1 === -1) { - $fill = str_repeat('0:', 7 - $c2); - $ip = str_replace('::', $fill, $ip); - } - // xxx:: - elseif ($c2 === -1) { - $fill = str_repeat(':0', 7 - $c1); - $ip = str_replace('::', $fill, $ip); - } - // xxx::xxx - else { - $fill = ':' . str_repeat('0:', 6 - $c2 - $c1); - $ip = str_replace('::', $fill, $ip); - } - } - return $ip; - } - - /** - * Compresses an IPv6 address - * - * RFC 4291 allows you to compress consecutive zero pieces in an address to - * '::'. This method expects a valid IPv6 address and compresses consecutive - * zero pieces to '::'. - * - * Example: FF01:0:0:0:0:0:0:101 -> FF01::101 - * 0:0:0:0:0:0:0:1 -> ::1 - * - * @see uncompress() - * @param string $ip An IPv6 address - * @return string The compressed IPv6 address - */ - public static function compress(string $ip) - { - // Prepare the IP to be compressed - $ip = self::uncompress($ip); - $ip_parts = self::split_v6_v4($ip); - - // Replace all leading zeros - $ip_parts[0] = (string) preg_replace('/(^|:)0+([0-9])/', '\1\2', $ip_parts[0]); - - // Find bunches of zeros - if (preg_match_all('/(?:^|:)(?:0(?::|$))+/', $ip_parts[0], $matches, PREG_OFFSET_CAPTURE)) { - $max = 0; - $pos = null; - foreach ($matches[0] as $match) { - if (strlen($match[0]) > $max) { - $max = strlen($match[0]); - $pos = $match[1]; - } - } - - assert($pos !== null, 'For PHPStan: Since the regex matched, there is at least one match. And because the pattern is non-empty, the loop will always end with $pos ≥ 1.'); - $ip_parts[0] = substr_replace($ip_parts[0], '::', $pos, $max); - } - - if ($ip_parts[1] !== '') { - return implode(':', $ip_parts); - } - - return $ip_parts[0]; - } - - /** - * Splits an IPv6 address into the IPv6 and IPv4 representation parts - * - * RFC 4291 allows you to represent the last two parts of an IPv6 address - * using the standard IPv4 representation - * - * Example: 0:0:0:0:0:0:13.1.68.3 - * 0:0:0:0:0:FFFF:129.144.52.38 - * - * @param string $ip An IPv6 address - * @return array{string, string} [0] contains the IPv6 represented part, and [1] the IPv4 represented part - */ - private static function split_v6_v4(string $ip): array - { - if (strpos($ip, '.') !== false) { - $pos = strrpos($ip, ':'); - assert($pos !== false, 'For PHPStan: IPv6 address must contain colon, since split_v6_v4 is only ever called after uncompress.'); - $ipv6_part = substr($ip, 0, $pos); - $ipv4_part = substr($ip, $pos + 1); - return [$ipv6_part, $ipv4_part]; - } - - return [$ip, '']; - } - - /** - * Checks an IPv6 address - * - * Checks if the given IP is a valid IPv6 address - * - * @param string $ip An IPv6 address - * @return bool true if $ip is a valid IPv6 address - */ - public static function check_ipv6(string $ip) - { - $ip = self::uncompress($ip); - [$ipv6, $ipv4] = self::split_v6_v4($ip); - $ipv6 = explode(':', $ipv6); - $ipv4 = explode('.', $ipv4); - if (count($ipv6) === 8 && count($ipv4) === 1 || count($ipv6) === 6 && count($ipv4) === 4) { - foreach ($ipv6 as $ipv6_part) { - // The section can't be empty - if ($ipv6_part === '') { - return false; - } - - // Nor can it be over four characters - if (strlen($ipv6_part) > 4) { - return false; - } - - // Remove leading zeros (this is safe because of the above) - $ipv6_part = ltrim($ipv6_part, '0'); - if ($ipv6_part === '') { - $ipv6_part = '0'; - } - - // Check the value is valid - $value = hexdec($ipv6_part); - if ($value < 0 || $value > 0xFFFF) { - return false; - } - assert(is_int($value), 'For PHPStan: $value is only float when $ipv6_part > PHP_INT_MAX'); - if (dechex($value) !== strtolower($ipv6_part)) { - return false; - } - } - if (count($ipv4) === 4) { - foreach ($ipv4 as $ipv4_part) { - $value = (int) $ipv4_part; - if ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF) { - return false; - } - } - } - return true; - } - - return false; - } - - /** - * Checks if the given IP is a valid IPv6 address - * - * @codeCoverageIgnore - * @deprecated Use {@see IPv6::check_ipv6()} instead - * @see check_ipv6 - * @param string $ip An IPv6 address - * @return bool true if $ip is a valid IPv6 address - */ - public static function checkIPv6(string $ip) - { - return self::check_ipv6($ip); - } -} - -class_alias('SimplePie\Net\IPv6', 'SimplePie_Net_IPv6'); diff --git a/core/vendor/simplepie/simplepie/src/Parse/Date.php b/core/vendor/simplepie/simplepie/src/Parse/Date.php deleted file mode 100644 index 57318e0b46..0000000000 --- a/core/vendor/simplepie/simplepie/src/Parse/Date.php +++ /dev/null @@ -1,965 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie\Parse; - -/** - * Date Parser - */ -class Date -{ - /** - * Input data - * - * @access protected - * @var string - */ - public $date; - - /** - * List of days, calendar day name => ordinal day number in the week - * - * @access protected - * @var array<string, int<1,7>> - */ - public $day = [ - // English - 'mon' => 1, - 'monday' => 1, - 'tue' => 2, - 'tuesday' => 2, - 'wed' => 3, - 'wednesday' => 3, - 'thu' => 4, - 'thursday' => 4, - 'fri' => 5, - 'friday' => 5, - 'sat' => 6, - 'saturday' => 6, - 'sun' => 7, - 'sunday' => 7, - // Dutch - 'maandag' => 1, - 'dinsdag' => 2, - 'woensdag' => 3, - 'donderdag' => 4, - 'vrijdag' => 5, - 'zaterdag' => 6, - 'zondag' => 7, - // French - 'lundi' => 1, - 'mardi' => 2, - 'mercredi' => 3, - 'jeudi' => 4, - 'vendredi' => 5, - 'samedi' => 6, - 'dimanche' => 7, - // German - 'montag' => 1, - 'mo' => 1, - 'dienstag' => 2, - 'di' => 2, - 'mittwoch' => 3, - 'mi' => 3, - 'donnerstag' => 4, - 'do' => 4, - 'freitag' => 5, - 'fr' => 5, - 'samstag' => 6, - 'sa' => 6, - 'sonnabend' => 6, - // AFAIK no short form for sonnabend - 'so' => 7, - 'sonntag' => 7, - // Italian - 'lunedì' => 1, - 'martedì' => 2, - 'mercoledì' => 3, - 'giovedì' => 4, - 'venerdì' => 5, - 'sabato' => 6, - 'domenica' => 7, - // Spanish - 'lunes' => 1, - 'martes' => 2, - 'miércoles' => 3, - 'jueves' => 4, - 'viernes' => 5, - 'sábado' => 6, - 'domingo' => 7, - // Finnish - 'maanantai' => 1, - 'tiistai' => 2, - 'keskiviikko' => 3, - 'torstai' => 4, - 'perjantai' => 5, - 'lauantai' => 6, - 'sunnuntai' => 7, - // Hungarian - 'hétfő' => 1, - 'kedd' => 2, - 'szerda' => 3, - 'csütörtok' => 4, - 'péntek' => 5, - 'szombat' => 6, - 'vasárnap' => 7, - // Greek - 'Δευ' => 1, - 'Τρι' => 2, - 'Τετ' => 3, - 'Πεμ' => 4, - 'Παρ' => 5, - 'Σαβ' => 6, - 'Κυρ' => 7, - // Russian - 'Пн.' => 1, - 'Вт.' => 2, - 'Ср.' => 3, - 'Чт.' => 4, - 'Пт.' => 5, - 'Сб.' => 6, - 'Вс.' => 7, - ]; - - /** - * List of months, calendar month name => calendar month number - * - * @access protected - * @var array<string, int<1,12>> - */ - public $month = [ - // English - 'jan' => 1, - 'january' => 1, - 'feb' => 2, - 'february' => 2, - 'mar' => 3, - 'march' => 3, - 'apr' => 4, - 'april' => 4, - 'may' => 5, - // No long form of May - 'jun' => 6, - 'june' => 6, - 'jul' => 7, - 'july' => 7, - 'aug' => 8, - 'august' => 8, - 'sep' => 9, - 'september' => 9, - 'oct' => 10, - 'october' => 10, - 'nov' => 11, - 'november' => 11, - 'dec' => 12, - 'december' => 12, - // Dutch - 'januari' => 1, - 'februari' => 2, - 'maart' => 3, - // 'april' => 4, - 'mei' => 5, - 'juni' => 6, - 'juli' => 7, - 'augustus' => 8, - // 'september' => 9, - 'oktober' => 10, - // 'november' => 11, - // 'december' => 12, - // French - 'janvier' => 1, - 'février' => 2, - 'mars' => 3, - 'avril' => 4, - 'mai' => 5, - 'juin' => 6, - 'juillet' => 7, - 'août' => 8, - 'septembre' => 9, - 'octobre' => 10, - 'novembre' => 11, - 'décembre' => 12, - // German - 'januar' => 1, - // 'jan' => 1, - 'februar' => 2, - // 'feb' => 2, - 'märz' => 3, - 'mär' => 3, - // 'april' => 4, - // 'apr' => 4, - // 'mai' => 5, // no short form for may - // 'juni' => 6, - // 'jun' => 6, - // 'juli' => 7, - // 'jul' => 7, - // 'august' => 8, - // 'aug' => 8, - // 'september' => 9, - // 'sep' => 9, - // 'oktober' => 10, - 'okt' => 10, - // 'november' => 11, - // 'nov' => 11, - 'dezember' => 12, - 'dez' => 12, - // Italian - 'gennaio' => 1, - 'febbraio' => 2, - 'marzo' => 3, - 'aprile' => 4, - 'maggio' => 5, - 'giugno' => 6, - 'luglio' => 7, - 'agosto' => 8, - 'settembre' => 9, - 'ottobre' => 10, - // 'novembre' => 11, - 'dicembre' => 12, - // Spanish - 'enero' => 1, - 'febrero' => 2, - // 'marzo' => 3, - 'abril' => 4, - 'mayo' => 5, - 'junio' => 6, - 'julio' => 7, - // 'agosto' => 8, - 'septiembre' => 9, - 'setiembre' => 9, - 'octubre' => 10, - 'noviembre' => 11, - 'diciembre' => 12, - // Finnish - 'tammikuu' => 1, - 'helmikuu' => 2, - 'maaliskuu' => 3, - 'huhtikuu' => 4, - 'toukokuu' => 5, - 'kesäkuu' => 6, - 'heinäkuu' => 7, - 'elokuu' => 8, - 'suuskuu' => 9, - 'lokakuu' => 10, - 'marras' => 11, - 'joulukuu' => 12, - // Hungarian - 'január' => 1, - 'február' => 2, - 'március' => 3, - 'április' => 4, - 'május' => 5, - 'június' => 6, - 'július' => 7, - 'augusztus' => 8, - 'szeptember' => 9, - 'október' => 10, - // 'november' => 11, - // 'december' => 12, - // Greek - 'Ιαν' => 1, - 'Φεβ' => 2, - 'Μάώ' => 3, - 'Μαώ' => 3, - 'Απρ' => 4, - 'Μάι' => 5, - 'Μαϊ' => 5, - 'Μαι' => 5, - 'Ιούν' => 6, - 'Ιον' => 6, - 'Ιούλ' => 7, - 'Ιολ' => 7, - 'Αύγ' => 8, - 'Αυγ' => 8, - 'Σεπ' => 9, - 'Οκτ' => 10, - 'Νοέ' => 11, - 'Δεκ' => 12, - // Russian - 'Янв' => 1, - 'января' => 1, - 'Фев' => 2, - 'февраля' => 2, - 'Мар' => 3, - 'марта' => 3, - 'Апр' => 4, - 'апреля' => 4, - 'Май' => 5, - 'мая' => 5, - 'Июн' => 6, - 'июня' => 6, - 'Июл' => 7, - 'июля' => 7, - 'Авг' => 8, - 'августа' => 8, - 'Сен' => 9, - 'сентября' => 9, - 'Окт' => 10, - 'октября' => 10, - 'Ноя' => 11, - 'ноября' => 11, - 'Дек' => 12, - 'декабря' => 12, - - ]; - - /** - * List of timezones, abbreviation => offset from UTC - * - * @access protected - * @var array<string, int> - */ - public $timezone = [ - 'ACDT' => 37800, - 'ACIT' => 28800, - 'ACST' => 34200, - 'ACT' => -18000, - 'ACWDT' => 35100, - 'ACWST' => 31500, - 'AEDT' => 39600, - 'AEST' => 36000, - 'AFT' => 16200, - 'AKDT' => -28800, - 'AKST' => -32400, - 'AMDT' => 18000, - 'AMT' => -14400, - 'ANAST' => 46800, - 'ANAT' => 43200, - 'ART' => -10800, - 'AZOST' => -3600, - 'AZST' => 18000, - 'AZT' => 14400, - 'BIOT' => 21600, - 'BIT' => -43200, - 'BOT' => -14400, - 'BRST' => -7200, - 'BRT' => -10800, - 'BST' => 3600, - 'BTT' => 21600, - 'CAST' => 18000, - 'CAT' => 7200, - 'CCT' => 23400, - 'CDT' => -18000, - 'CEDT' => 7200, - 'CEST' => 7200, - 'CET' => 3600, - 'CGST' => -7200, - 'CGT' => -10800, - 'CHADT' => 49500, - 'CHAST' => 45900, - 'CIST' => -28800, - 'CKT' => -36000, - 'CLDT' => -10800, - 'CLST' => -14400, - 'COT' => -18000, - 'CST' => -21600, - 'CVT' => -3600, - 'CXT' => 25200, - 'DAVT' => 25200, - 'DTAT' => 36000, - 'EADT' => -18000, - 'EAST' => -21600, - 'EAT' => 10800, - 'ECT' => -18000, - 'EDT' => -14400, - 'EEST' => 10800, - 'EET' => 7200, - 'EGT' => -3600, - 'EKST' => 21600, - 'EST' => -18000, - 'FJT' => 43200, - 'FKDT' => -10800, - 'FKST' => -14400, - 'FNT' => -7200, - 'GALT' => -21600, - 'GEDT' => 14400, - 'GEST' => 10800, - 'GFT' => -10800, - 'GILT' => 43200, - 'GIT' => -32400, - 'GST' => 14400, - // 'GST' => -7200, - 'GYT' => -14400, - 'HAA' => -10800, - 'HAC' => -18000, - 'HADT' => -32400, - 'HAE' => -14400, - 'HAP' => -25200, - 'HAR' => -21600, - 'HAST' => -36000, - 'HAT' => -9000, - 'HAY' => -28800, - 'HKST' => 28800, - 'HMT' => 18000, - 'HNA' => -14400, - 'HNC' => -21600, - 'HNE' => -18000, - 'HNP' => -28800, - 'HNR' => -25200, - 'HNT' => -12600, - 'HNY' => -32400, - 'IRDT' => 16200, - 'IRKST' => 32400, - 'IRKT' => 28800, - 'IRST' => 12600, - 'JFDT' => -10800, - 'JFST' => -14400, - 'JST' => 32400, - 'KGST' => 21600, - 'KGT' => 18000, - 'KOST' => 39600, - 'KOVST' => 28800, - 'KOVT' => 25200, - 'KRAST' => 28800, - 'KRAT' => 25200, - 'KST' => 32400, - 'LHDT' => 39600, - 'LHST' => 37800, - 'LINT' => 50400, - 'LKT' => 21600, - 'MAGST' => 43200, - 'MAGT' => 39600, - 'MAWT' => 21600, - 'MDT' => -21600, - 'MESZ' => 7200, - 'MEZ' => 3600, - 'MHT' => 43200, - 'MIT' => -34200, - 'MNST' => 32400, - 'MSDT' => 14400, - 'MSST' => 10800, - 'MST' => -25200, - 'MUT' => 14400, - 'MVT' => 18000, - 'MYT' => 28800, - 'NCT' => 39600, - 'NDT' => -9000, - 'NFT' => 41400, - 'NMIT' => 36000, - 'NOVST' => 25200, - 'NOVT' => 21600, - 'NPT' => 20700, - 'NRT' => 43200, - 'NST' => -12600, - 'NUT' => -39600, - 'NZDT' => 46800, - 'NZST' => 43200, - 'OMSST' => 25200, - 'OMST' => 21600, - 'PDT' => -25200, - 'PET' => -18000, - 'PETST' => 46800, - 'PETT' => 43200, - 'PGT' => 36000, - 'PHOT' => 46800, - 'PHT' => 28800, - 'PKT' => 18000, - 'PMDT' => -7200, - 'PMST' => -10800, - 'PONT' => 39600, - 'PST' => -28800, - 'PWT' => 32400, - 'PYST' => -10800, - 'PYT' => -14400, - 'RET' => 14400, - 'ROTT' => -10800, - 'SAMST' => 18000, - 'SAMT' => 14400, - 'SAST' => 7200, - 'SBT' => 39600, - 'SCDT' => 46800, - 'SCST' => 43200, - 'SCT' => 14400, - 'SEST' => 3600, - 'SGT' => 28800, - 'SIT' => 28800, - 'SRT' => -10800, - 'SST' => -39600, - 'SYST' => 10800, - 'SYT' => 7200, - 'TFT' => 18000, - 'THAT' => -36000, - 'TJT' => 18000, - 'TKT' => -36000, - 'TMT' => 18000, - 'TOT' => 46800, - 'TPT' => 32400, - 'TRUT' => 36000, - 'TVT' => 43200, - 'TWT' => 28800, - 'UYST' => -7200, - 'UYT' => -10800, - 'UZT' => 18000, - 'VET' => -14400, - 'VLAST' => 39600, - 'VLAT' => 36000, - 'VOST' => 21600, - 'VUT' => 39600, - 'WAST' => 7200, - 'WAT' => 3600, - 'WDT' => 32400, - 'WEST' => 3600, - 'WFT' => 43200, - 'WIB' => 25200, - 'WIT' => 32400, - 'WITA' => 28800, - 'WKST' => 18000, - 'WST' => 28800, - 'YAKST' => 36000, - 'YAKT' => 32400, - 'YAPT' => 36000, - 'YEKST' => 21600, - 'YEKT' => 18000, - ]; - - /** - * Cached PCRE for Date::$day - * - * @access protected - * @var string - */ - public $day_pcre; - - /** - * Cached PCRE for Date::$month - * - * @access protected - * @var string - */ - public $month_pcre; - - /** - * Array of user-added callback methods - * - * @access private - * @var array<string> - */ - public $built_in = []; - - /** - * Array of user-added callback methods - * - * @access private - * @var array<callable(string): (int|false)> - */ - public $user = []; - - /** - * Create new Date object, and set self::day_pcre, - * self::month_pcre, and self::built_in - * - * @access private - */ - public function __construct() - { - $this->day_pcre = '(' . implode('|', array_keys($this->day)) . ')'; - $this->month_pcre = '(' . implode('|', array_keys($this->month)) . ')'; - - static $cache; - if (!isset($cache[get_class($this)])) { - $all_methods = get_class_methods($this); - - foreach ($all_methods as $method) { - if (strtolower(substr($method, 0, 5)) === 'date_') { - $cache[get_class($this)][] = $method; - } - } - } - - foreach ($cache[get_class($this)] as $method) { - $this->built_in[] = $method; - } - } - - /** - * Get the object - * - * @access public - * @return Date - */ - public static function get() - { - static $object; - if (!$object) { - $object = new Date(); - } - return $object; - } - - /** - * Parse a date - * - * @final - * @access public - * @param string $date Date to parse - * @return int|false Timestamp corresponding to date string, or false on failure - */ - public function parse(string $date) - { - foreach ($this->user as $method) { - if (($returned = call_user_func($method, $date)) !== false) { - return (int) $returned; - } - } - - foreach ($this->built_in as $method) { - // TODO: we should really check this in constructor but that would require private properties. - /** @var callable(string): (int|false) */ - $callable = [$this, $method]; - if (($returned = call_user_func($callable, $date)) !== false) { - return $returned; - } - } - - return false; - } - - /** - * Add a callback method to parse a date - * - * @final - * @access public - * @param callable $callback - * @return void - */ - public function add_callback(callable $callback) - { - $this->user[] = $callback; - } - - /** - * Parse a superset of W3C-DTF (allows hyphens and colons to be omitted, as - * well as allowing any of upper or lower case "T", horizontal tabs, or - * spaces to be used as the time separator (including more than one)) - * - * @access protected - * @param string $date - * @return int|false Timestamp - */ - public function date_w3cdtf(string $date) - { - $pcre = <<<'PCRE' - / - ^ - (?P<year>[0-9]{4}) - (?: - -? - (?P<month>[0-9]{2}) - (?: - -? - (?P<day>[0-9]{2}) - (?: - [Tt\x09\x20]+ - (?P<hour>[0-9]{2}) - (?: - :? - (?P<minute>[0-9]{2}) - (?: - :? - (?P<second>[0-9]{2}) - (?: - . - (?P<second_fraction>[0-9]*) - )? - )? - )? - (?: - (?P<zulu>Z) - | (?P<tz_sign>[+\-]) - (?P<tz_hour>[0-9]{1,2}) - :? - (?P<tz_minute>[0-9]{1,2}) - ) - )? - )? - )? - $ - /x -PCRE; - if (preg_match($pcre, $date, $match)) { - // Fill in empty matches and convert to proper types. - $year = (int) $match['year']; - $month = isset($match['month']) ? (int) $match['month'] : 1; - $day = isset($match['day']) ? (int) $match['day'] : 1; - $hour = isset($match['hour']) ? (int) $match['hour'] : 0; - $minute = isset($match['minute']) ? (int) $match['minute'] : 0; - $second = isset($match['second']) ? (int) $match['second'] : 0; - $second_fraction = isset($match['second_fraction']) ? ((int) $match['second_fraction']) / (10 ** strlen($match['second_fraction'])) : 0; - $tz_sign = ($match['tz_sign'] ?? '') === '-' ? -1 : 1; - $tz_hour = isset($match['tz_hour']) ? (int) $match['tz_hour'] : 0; - $tz_minute = isset($match['tz_minute']) ? (int) $match['tz_minute'] : 0; - - // Numeric timezone - $timezone = $tz_hour * 3600; - $timezone += $tz_minute * 60; - $timezone *= $tz_sign; - - // Convert the number of seconds to an integer, taking decimals into account - $second = (int) round($second + $second_fraction); - - return gmmktime($hour, $minute, $second, $month, $day, $year) - $timezone; - } - - return false; - } - - /** - * Remove RFC822 comments - * - * @access protected - * @param string $string Data to strip comments from - * @return string Comment stripped string - */ - public function remove_rfc2822_comments(string $string) - { - $position = 0; - $length = strlen($string); - $depth = 0; - - $output = ''; - - while ($position < $length && ($pos = strpos($string, '(', $position)) !== false) { - $output .= substr($string, $position, $pos - $position); - $position = $pos + 1; - if ($pos === 0 || $string[$pos - 1] !== '\\') { - $depth++; - while ($depth && $position < $length) { - $position += strcspn($string, '()', $position); - if ($string[$position - 1] === '\\') { - $position++; - continue; - } elseif (isset($string[$position])) { - switch ($string[$position]) { - case '(': - $depth++; - break; - - case ')': - $depth--; - break; - } - $position++; - } else { - break; - } - } - } else { - $output .= '('; - } - } - $output .= substr($string, $position); - - return $output; - } - - /** - * Parse RFC2822's date format - * - * @access protected - * @param string $date - * @return int|false Timestamp - */ - public function date_rfc2822(string $date) - { - static $pcre; - if (!$pcre) { - $wsp = '[\x09\x20]'; - $fws = '(?:' . $wsp . '+|' . $wsp . '*(?:\x0D\x0A' . $wsp . '+)+)'; - $optional_fws = $fws . '?'; - $day_name = $this->day_pcre; - $month = $this->month_pcre; - $day = '([0-9]{1,2})'; - $hour = $minute = $second = '([0-9]{2})'; - $year = '([0-9]{2,4})'; - $num_zone = '([+\-])([0-9]{2})([0-9]{2})'; - $character_zone = '([A-Z]{1,5})'; - $zone = '(?:' . $num_zone . '|' . $character_zone . ')'; - $pcre = '/(?:' . $optional_fws . $day_name . $optional_fws . ',)?' . $optional_fws . $day . $fws . $month . $fws . $year . $fws . $hour . $optional_fws . ':' . $optional_fws . $minute . '(?:' . $optional_fws . ':' . $optional_fws . $second . ')?' . $fws . $zone . '/i'; - } - if (preg_match($pcre, $this->remove_rfc2822_comments($date), $match)) { - /* - Capturing subpatterns: - 1: Day name - 2: Day - 3: Month - 4: Year - 5: Hour - 6: Minute - 7: Second - 8: Timezone ± - 9: Timezone hours - 10: Timezone minutes - 11: Alphabetic timezone - */ - - $day = (int) $match[2]; - // Find the month number - $month = $this->month[strtolower($match[3])]; - $year = (int) $match[4]; - $hour = (int) $match[5]; - $minute = (int) $match[6]; - // Second is optional, if it is empty set it to zero - $second = (int) $match[7]; - - $tz_sign = $match[8]; - $tz_hour = (int) $match[9]; - $tz_minute = (int) $match[10]; - $tz_code = isset($match[11]) ? strtoupper($match[11]) : ''; - - // Numeric timezone - if ($tz_sign !== '') { - $timezone = $tz_hour * 3600; - $timezone += $tz_minute * 60; - if ($tz_sign === '-') { - $timezone = 0 - $timezone; - } - } - // Character timezone - elseif (isset($this->timezone[$tz_code])) { - $timezone = $this->timezone[$tz_code]; - } - // Assume everything else to be -0000 - else { - $timezone = 0; - } - - // Deal with 2/3 digit years - if ($year < 50) { - $year += 2000; - } elseif ($year < 1000) { - $year += 1900; - } - - return gmmktime($hour, $minute, $second, $month, $day, $year) - $timezone; - } - - return false; - } - - /** - * Parse RFC850's date format - * - * @access protected - * @param string $date - * @return int|false Timestamp - */ - public function date_rfc850(string $date) - { - static $pcre; - if (!$pcre) { - $space = '[\x09\x20]+'; - $day_name = $this->day_pcre; - $month = $this->month_pcre; - $day = '([0-9]{1,2})'; - $year = $hour = $minute = $second = '([0-9]{2})'; - $zone = '([A-Z]{1,5})'; - $pcre = '/^' . $day_name . ',' . $space . $day . '-' . $month . '-' . $year . $space . $hour . ':' . $minute . ':' . $second . $space . $zone . '$/i'; - } - if (preg_match($pcre, $date, $match)) { - /* - Capturing subpatterns: - 1: Day name - 2: Day - 3: Month - 4: Year - 5: Hour - 6: Minute - 7: Second - 8: Timezone - */ - - $day = (int) $match[2]; - // Month - $month = $this->month[strtolower($match[3])]; - $year = (int) $match[4]; - $hour = (int) $match[5]; - $minute = (int) $match[6]; - // Second is optional, if it is empty set it to zero - $second = (int) $match[7]; - - $tz_code = strtoupper($match[8]); - - // Character timezone - if (isset($this->timezone[$tz_code])) { - $timezone = $this->timezone[$tz_code]; - } - // Assume everything else to be -0000 - else { - $timezone = 0; - } - - // Deal with 2 digit year - if ($year < 50) { - $year += 2000; - } else { - $year += 1900; - } - - return gmmktime($hour, $minute, $second, $month, $day, $year) - $timezone; - } - - return false; - } - - /** - * Parse C99's asctime()'s date format - * - * @access protected - * @param string $date - * @return int|false Timestamp - */ - public function date_asctime(string $date) - { - static $pcre; - if (!$pcre) { - $space = '[\x09\x20]+'; - $wday_name = $this->day_pcre; - $mon_name = $this->month_pcre; - $day = '([0-9]{1,2})'; - $hour = $sec = $min = '([0-9]{2})'; - $year = '([0-9]{4})'; - $terminator = '\x0A?\x00?'; - $pcre = '/^' . $wday_name . $space . $mon_name . $space . $day . $space . $hour . ':' . $min . ':' . $sec . $space . $year . $terminator . '$/i'; - } - if (preg_match($pcre, $date, $match)) { - /* - Capturing subpatterns: - 1: Day name - 2: Month - 3: Day - 4: Hour - 5: Minute - 6: Second - 7: Year - */ - - $month = $this->month[strtolower($match[2])]; - return gmmktime((int) $match[4], (int) $match[5], (int) $match[6], $month, (int) $match[3], (int) $match[7]); - } - - return false; - } - - /** - * Parse dates using strtotime() - * - * @access protected - * @param string $date - * @return int|false Timestamp - */ - public function date_strtotime(string $date) - { - $strtotime = strtotime($date); - if ($strtotime === -1 || $strtotime === false) { - return false; - } - - return $strtotime; - } -} - -class_alias('SimplePie\Parse\Date', 'SimplePie_Parse_Date'); diff --git a/core/vendor/simplepie/simplepie/src/Parser.php b/core/vendor/simplepie/simplepie/src/Parser.php deleted file mode 100644 index fc93996eb7..0000000000 --- a/core/vendor/simplepie/simplepie/src/Parser.php +++ /dev/null @@ -1,675 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -use SimplePie\XML\Declaration\Parser as DeclarationParser; -use XMLParser; - -/** - * Parses XML into something sane - * - * - * This class can be overloaded with {@see \SimplePie\SimplePie::set_parser_class()} - */ -class Parser implements RegistryAware -{ - /** @var int */ - public $error_code; - /** @var string */ - public $error_string; - /** @var int */ - public $current_line; - /** @var int */ - public $current_column; - /** @var int */ - public $current_byte; - /** @var string */ - public $separator = ' '; - /** @var string[] */ - public $namespace = ['']; - /** @var string[] */ - public $element = ['']; - /** @var string[] */ - public $xml_base = ['']; - /** @var bool[] */ - public $xml_base_explicit = [false]; - /** @var string[] */ - public $xml_lang = ['']; - /** @var array<string, mixed> */ - public $data = []; - /** @var array<array<string, mixed>> */ - public $datas = [[]]; - /** @var int */ - public $current_xhtml_construct = -1; - /** @var string */ - public $encoding; - /** @var Registry */ - protected $registry; - - /** - * @return void - */ - public function set_registry(\SimplePie\Registry $registry) - { - $this->registry = $registry; - } - - /** - * @return bool - */ - public function parse(string &$data, string $encoding, string $url = '') - { - if (class_exists('DOMXpath') && function_exists('Mf2\parse')) { - $doc = new \DOMDocument(); - @$doc->loadHTML($data); - $xpath = new \DOMXpath($doc); - // Check for both h-feed and h-entry, as both a feed with no entries - // and a list of entries without an h-feed wrapper are both valid. - $query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '. - 'contains(concat(" ", @class, " "), " h-entry ")]'; - /** @var \DOMNodeList<\DOMElement> $result */ - $result = $xpath->query($query); - if ($result->length !== 0) { - return $this->parse_microformats($data, $url); - } - } - - // Use UTF-8 if we get passed US-ASCII, as every US-ASCII character is a UTF-8 character - if (strtoupper($encoding) === 'US-ASCII') { - $this->encoding = 'UTF-8'; - } else { - $this->encoding = $encoding; - } - - // Strip BOM: - // UTF-32 Big Endian BOM - if (substr($data, 0, 4) === "\x00\x00\xFE\xFF") { - $data = substr($data, 4); - } - // UTF-32 Little Endian BOM - elseif (substr($data, 0, 4) === "\xFF\xFE\x00\x00") { - $data = substr($data, 4); - } - // UTF-16 Big Endian BOM - elseif (substr($data, 0, 2) === "\xFE\xFF") { - $data = substr($data, 2); - } - // UTF-16 Little Endian BOM - elseif (substr($data, 0, 2) === "\xFF\xFE") { - $data = substr($data, 2); - } - // UTF-8 BOM - elseif (substr($data, 0, 3) === "\xEF\xBB\xBF") { - $data = substr($data, 3); - } - - if (substr($data, 0, 5) === '<?xml' && strspn(substr($data, 5, 1), "\x09\x0A\x0D\x20") && ($pos = strpos($data, '?>')) !== false) { - $declaration = $this->registry->create(DeclarationParser::class, [substr($data, 5, $pos - 5)]); - if ($declaration->parse()) { - $data = substr($data, $pos + 2); - $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' . "\n" . - self::set_doctype($data); - } else { - $this->error_string = 'SimplePie bug! Please report this!'; - return false; - } - } else { - $data = self::set_doctype($data); - } - - $return = true; - - static $xml_is_sane = null; - if ($xml_is_sane === null) { - $parser_check = xml_parser_create(); - xml_parse_into_struct($parser_check, '<foo>&</foo>', $values); - if (\PHP_VERSION_ID < 80000) { - xml_parser_free($parser_check); - } - $xml_is_sane = isset($values[0]['value']); - } - - // Create the parser - if ($xml_is_sane) { - $xml = xml_parser_create_ns($this->encoding, $this->separator); - xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1); - xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0); - xml_set_character_data_handler($xml, [$this, 'cdata']); - xml_set_element_handler($xml, [$this, 'tag_open'], [$this, 'tag_close']); - - // Parse! - $wrapper = @is_writable(sys_get_temp_dir()) ? 'php://temp' : 'php://memory'; - if (($stream = fopen($wrapper, 'r+')) && - fwrite($stream, $data) && - rewind($stream)) { - //Parse by chunks not to use too much memory - do { - $stream_data = (string) fread($stream, 1048576); - - if (!xml_parse($xml, $stream_data, feof($stream))) { - $this->error_code = xml_get_error_code($xml); - $this->error_string = xml_error_string($this->error_code) ?: "Unknown"; - $return = false; - break; - } - } while (!feof($stream)); - fclose($stream); - } else { - $return = false; - } - - $this->current_line = xml_get_current_line_number($xml); - $this->current_column = xml_get_current_column_number($xml); - $this->current_byte = xml_get_current_byte_index($xml); - if (\PHP_VERSION_ID < 80000) { - xml_parser_free($xml); - } - return $return; - } - - libxml_clear_errors(); - $xml = new \XMLReader(); - $xml->xml($data); - while (@$xml->read()) { - switch ($xml->nodeType) { - case \XMLReader::END_ELEMENT: - if ($xml->namespaceURI !== '') { - $tagName = $xml->namespaceURI . $this->separator . $xml->localName; - } else { - $tagName = $xml->localName; - } - $this->tag_close(null, $tagName); - break; - case \XMLReader::ELEMENT: - $empty = $xml->isEmptyElement; - if ($xml->namespaceURI !== '') { - $tagName = $xml->namespaceURI . $this->separator . $xml->localName; - } else { - $tagName = $xml->localName; - } - $attributes = []; - while ($xml->moveToNextAttribute()) { - if ($xml->namespaceURI !== '') { - $attrName = $xml->namespaceURI . $this->separator . $xml->localName; - } else { - $attrName = $xml->localName; - } - $attributes[$attrName] = $xml->value; - } - $this->tag_open(null, $tagName, $attributes); - if ($empty) { - $this->tag_close(null, $tagName); - } - break; - case \XMLReader::TEXT: - - case \XMLReader::CDATA: - $this->cdata(null, $xml->value); - break; - } - } - if ($error = libxml_get_last_error()) { - $this->error_code = $error->code; - $this->error_string = $error->message; - $this->current_line = $error->line; - $this->current_column = $error->column; - return false; - } - - return true; - } - - /** - * @return int - */ - public function get_error_code() - { - return $this->error_code; - } - - /** - * @return string - */ - public function get_error_string() - { - return $this->error_string; - } - - /** - * @return int - */ - public function get_current_line() - { - return $this->current_line; - } - - /** - * @return int - */ - public function get_current_column() - { - return $this->current_column; - } - - /** - * @return int - */ - public function get_current_byte() - { - return $this->current_byte; - } - - /** - * @return array<string, mixed> - */ - public function get_data() - { - return $this->data; - } - - /** - * @param XMLParser|resource|null $parser - * @param array<string, string> $attributes - * @return void - */ - public function tag_open($parser, string $tag, array $attributes) - { - [$this->namespace[], $this->element[]] = $this->split_ns($tag); - - $attribs = []; - foreach ($attributes as $name => $value) { - [$attrib_namespace, $attribute] = $this->split_ns($name); - $attribs[$attrib_namespace][$attribute] = $value; - } - - if (isset($attribs[\SimplePie\SimplePie::NAMESPACE_XML]['base'])) { - $base = $this->registry->call(Misc::class, 'absolutize_url', [$attribs[\SimplePie\SimplePie::NAMESPACE_XML]['base'], end($this->xml_base)]); - if ($base !== false) { - $this->xml_base[] = $base; - $this->xml_base_explicit[] = true; - } - } else { - $this->xml_base[] = end($this->xml_base) ?: ''; - $this->xml_base_explicit[] = end($this->xml_base_explicit); - } - - if (isset($attribs[\SimplePie\SimplePie::NAMESPACE_XML]['lang'])) { - $this->xml_lang[] = $attribs[\SimplePie\SimplePie::NAMESPACE_XML]['lang']; - } else { - $this->xml_lang[] = end($this->xml_lang) ?: ''; - } - - if ($this->current_xhtml_construct >= 0) { - $this->current_xhtml_construct++; - if (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_XHTML) { - $this->data['data'] .= '<' . end($this->element); - if (isset($attribs[''])) { - foreach ($attribs[''] as $name => $value) { - $this->data['data'] .= ' ' . $name . '="' . htmlspecialchars($value, ENT_COMPAT, $this->encoding) . '"'; - } - } - $this->data['data'] .= '>'; - } - } else { - $this->datas[] = &$this->data; - $this->data = &$this->data['child'][end($this->namespace)][end($this->element)][]; - $this->data = ['data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang)]; - if ((end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_ATOM_03 && in_array(end($this->element), ['title', 'tagline', 'copyright', 'info', 'summary', 'content']) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml') - || (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_ATOM_10 && in_array(end($this->element), ['rights', 'subtitle', 'summary', 'info', 'title', 'content']) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml') - || (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_RSS_20 && in_array(end($this->element), ['title'])) - || (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_RSS_090 && in_array(end($this->element), ['title'])) - || (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_RSS_10 && in_array(end($this->element), ['title']))) { - $this->current_xhtml_construct = 0; - } - } - } - - /** - * @param XMLParser|resource|null $parser - * @return void - */ - public function cdata($parser, string $cdata) - { - if ($this->current_xhtml_construct >= 0) { - $this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding); - } else { - $this->data['data'] .= $cdata; - } - } - - /** - * @param XMLParser|resource|null $parser - * @return void - */ - public function tag_close($parser, string $tag) - { - if ($this->current_xhtml_construct >= 0) { - $this->current_xhtml_construct--; - if (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_XHTML && !in_array(end($this->element), ['area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'])) { - $this->data['data'] .= '</' . end($this->element) . '>'; - } - } - if ($this->current_xhtml_construct === -1) { - $this->data = &$this->datas[count($this->datas) - 1]; - array_pop($this->datas); - } - - array_pop($this->element); - array_pop($this->namespace); - array_pop($this->xml_base); - array_pop($this->xml_base_explicit); - array_pop($this->xml_lang); - } - - /** - * @return array{string, string} - */ - public function split_ns(string $string) - { - static $cache = []; - if (!isset($cache[$string])) { - if ($pos = strpos($string, $this->separator)) { - static $separator_length; - if (!$separator_length) { - $separator_length = strlen($this->separator); - } - $namespace = substr($string, 0, $pos); - $local_name = substr($string, $pos + $separator_length); - if (strtolower($namespace) === \SimplePie\SimplePie::NAMESPACE_ITUNES) { - $namespace = \SimplePie\SimplePie::NAMESPACE_ITUNES; - } - - // Normalize the Media RSS namespaces - if ($namespace === \SimplePie\SimplePie::NAMESPACE_MEDIARSS_WRONG || - $namespace === \SimplePie\SimplePie::NAMESPACE_MEDIARSS_WRONG2 || - $namespace === \SimplePie\SimplePie::NAMESPACE_MEDIARSS_WRONG3 || - $namespace === \SimplePie\SimplePie::NAMESPACE_MEDIARSS_WRONG4 || - $namespace === \SimplePie\SimplePie::NAMESPACE_MEDIARSS_WRONG5) { - $namespace = \SimplePie\SimplePie::NAMESPACE_MEDIARSS; - } - $cache[$string] = [$namespace, $local_name]; - } else { - $cache[$string] = ['', $string]; - } - } - return $cache[$string]; - } - - /** - * @param array<string, mixed> $data - */ - private function parse_hcard(array $data, bool $category = false): string - { - $name = ''; - $link = ''; - // Check if h-card is set and pass that information on in the link. - if (isset($data['type']) && in_array('h-card', $data['type'])) { - if (isset($data['properties']['name'][0])) { - $name = $data['properties']['name'][0]; - } - if (isset($data['properties']['url'][0])) { - $link = $data['properties']['url'][0]; - if ($name === '') { - $name = $link; - } else { - // can't have commas in categories. - $name = str_replace(',', '', $name); - } - $person_tag = $category ? '<span class="person-tag"></span>' : ''; - return '<a class="h-card" href="'.$link.'">'.$person_tag.$name.'</a>'; - } - } - return $data['value'] ?? ''; - } - - /** - * @return true - */ - private function parse_microformats(string &$data, string $url): bool - { - // For PHPStan, we already check that in call site. - \assert(function_exists('Mf2\parse')); - \assert(function_exists('Mf2\fetch')); - $feed_title = ''; - $feed_author = null; - $author_cache = []; - $items = []; - $entries = []; - $mf = \Mf2\parse($data, $url); - // First look for an h-feed. - $h_feed = []; - foreach ($mf['items'] as $mf_item) { - if (in_array('h-feed', $mf_item['type'])) { - $h_feed = $mf_item; - break; - } - // Also look for h-feed or h-entry in the children of each top level item. - if (!isset($mf_item['children'][0]['type'])) { - continue; - } - if (in_array('h-feed', $mf_item['children'][0]['type'])) { - $h_feed = $mf_item['children'][0]; - // In this case the parent of the h-feed may be an h-card, so use it as - // the feed_author. - if (in_array('h-card', $mf_item['type'])) { - $feed_author = $mf_item; - } - break; - } elseif (in_array('h-entry', $mf_item['children'][0]['type'])) { - $entries = $mf_item['children']; - // In this case the parent of the h-entry list may be an h-card, so use - // it as the feed_author. - if (in_array('h-card', $mf_item['type'])) { - $feed_author = $mf_item; - } - break; - } - } - if (isset($h_feed['children'])) { - $entries = $h_feed['children']; - // Also set the feed title and store author from the h-feed if available. - if (isset($mf['items'][0]['properties']['name'][0])) { - $feed_title = $mf['items'][0]['properties']['name'][0]; - } - if (isset($mf['items'][0]['properties']['author'][0])) { - $feed_author = $mf['items'][0]['properties']['author'][0]; - } - } elseif (count($entries) === 0) { - $entries = $mf['items']; - } - for ($i = 0; $i < count($entries); $i++) { - $entry = $entries[$i]; - if (in_array('h-entry', $entry['type'])) { - $item = []; - $title = ''; - $description = ''; - if (isset($entry['properties']['url'][0])) { - $link = $entry['properties']['url'][0]; - if (isset($link['value'])) { - $link = $link['value']; - } - $item['link'] = [['data' => $link]]; - } - if (isset($entry['properties']['uid'][0])) { - $guid = $entry['properties']['uid'][0]; - if (isset($guid['value'])) { - $guid = $guid['value']; - } - $item['guid'] = [['data' => $guid]]; - } - if (isset($entry['properties']['name'][0])) { - $title = $entry['properties']['name'][0]; - if (isset($title['value'])) { - $title = $title['value']; - } - $item['title'] = [['data' => $title]]; - } - if (isset($entry['properties']['author'][0]) || isset($feed_author)) { - // author is a special case, it can be plain text or an h-card array. - // If it's plain text it can also be a url that should be followed to - // get the actual h-card. - $author = $entry['properties']['author'][0] ?? $feed_author; - if (!is_string($author)) { - $author = $this->parse_hcard($author); - } elseif (strpos($author, 'http') === 0) { - if (isset($author_cache[$author])) { - $author = $author_cache[$author]; - } else { - if ($mf = \Mf2\fetch($author)) { - foreach ($mf['items'] as $hcard) { - // Only interested in an h-card by itself in this case. - if (!in_array('h-card', $hcard['type'])) { - continue; - } - // It must have a url property matching what we fetched. - if (!isset($hcard['properties']['url']) || - !(in_array($author, $hcard['properties']['url']))) { - continue; - } - // Save parse_hcard the trouble of finding the correct url. - $hcard['properties']['url'][0] = $author; - // Cache this h-card for the next h-entry to check. - $author_cache[$author] = $this->parse_hcard($hcard); - $author = $author_cache[$author]; - break; - } - } - } - } - $item['author'] = [['data' => $author]]; - } - if (isset($entry['properties']['photo'][0])) { - // If a photo is also in content, don't need to add it again here. - $content = ''; - if (isset($entry['properties']['content'][0]['html'])) { - $content = $entry['properties']['content'][0]['html']; - } - $photo_list = []; - for ($j = 0; $j < count($entry['properties']['photo']); $j++) { - $photo = $entry['properties']['photo'][$j]; - if (!empty($photo) && strpos($content, $photo) === false) { - $photo_list[] = $photo; - } - } - // When there's more than one photo show the first and use a lightbox. - // Need a permanent, unique name for the image set, but don't have - // anything unique except for the content itself, so use that. - $count = count($photo_list); - if ($count > 1) { - $image_set_id = preg_replace('/[[:^alnum:]]/', '', $photo_list[0]); - $description = '<p>'; - for ($j = 0; $j < $count; $j++) { - $hidden = $j === 0 ? '' : 'class="hidden" '; - $description .= '<a href="'.$photo_list[$j].'" '.$hidden. - 'data-lightbox="image-set-'.$image_set_id.'">'. - '<img src="'.$photo_list[$j].'"></a>'; - } - $description .= '<br><b>'.$count.' photos</b></p>'; - } elseif ($count == 1) { - $description = '<p><img src="'.$photo_list[0].'"></p>'; - } - } - if (isset($entry['properties']['content'][0]['html'])) { - // e-content['value'] is the same as p-name when they are on the same - // element. Use this to replace title with a strip_tags version so - // that alt text from images is not included in the title. - if ($entry['properties']['content'][0]['value'] === $title) { - $title = strip_tags($entry['properties']['content'][0]['html']); - $item['title'] = [['data' => $title]]; - } - $description .= $entry['properties']['content'][0]['html']; - if (isset($entry['properties']['in-reply-to'][0])) { - $in_reply_to = ''; - if (is_string($entry['properties']['in-reply-to'][0])) { - $in_reply_to = $entry['properties']['in-reply-to'][0]; - } elseif (isset($entry['properties']['in-reply-to'][0]['value'])) { - $in_reply_to = $entry['properties']['in-reply-to'][0]['value']; - } - if ($in_reply_to !== '') { - $description .= '<p><span class="in-reply-to"></span> '. - '<a href="'.$in_reply_to.'">'.$in_reply_to.'</a><p>'; - } - } - $item['description'] = [['data' => $description]]; - } - if (isset($entry['properties']['category'])) { - $category_csv = ''; - // Categories can also contain h-cards. - foreach ($entry['properties']['category'] as $category) { - if ($category_csv !== '') { - $category_csv .= ', '; - } - if (is_string($category)) { - // Can't have commas in categories. - $category_csv .= str_replace(',', '', $category); - } else { - $category_csv .= $this->parse_hcard($category, true); - } - } - $item['category'] = [['data' => $category_csv]]; - } - if (isset($entry['properties']['published'][0])) { - $timestamp = strtotime($entry['properties']['published'][0]); - $pub_date = date('F j Y g:ia', $timestamp).' GMT'; - $item['pubDate'] = [['data' => $pub_date]]; - } - // The title and description are set to the empty string to represent - // a deleted item (which also makes it an invalid rss item). - if (isset($entry['properties']['deleted'][0])) { - $item['title'] = [['data' => '']]; - $item['description'] = [['data' => '']]; - } - $items[] = ['child' => ['' => $item]]; - } - } - // Mimic RSS data format when storing microformats. - $link = [['data' => $url]]; - $image = ''; - if (!is_string($feed_author) && - isset($feed_author['properties']['photo'][0])) { - $image = [['child' => ['' => ['url' => - [['data' => $feed_author['properties']['photo'][0]]]]]]]; - } - // Use the name given for the h-feed, or get the title from the html. - if ($feed_title !== '') { - $feed_title = [['data' => htmlspecialchars($feed_title)]]; - } elseif ($position = strpos($data, '<title>')) { - $start = $position < 200 ? 0 : $position - 200; - $check = substr($data, $start, 400); - $matches = []; - if (preg_match('/<title>(.+)<\/title>/', $check, $matches)) { - $feed_title = [['data' => htmlspecialchars($matches[1])]]; - } - } - $channel = ['channel' => [['child' => ['' => - ['link' => $link, 'image' => $image, 'title' => $feed_title, - 'item' => $items]]]]]; - $rss = [['attribs' => ['' => ['version' => '2.0']], - 'child' => ['' => $channel]]]; - $this->data = ['child' => ['' => ['rss' => $rss]]]; - return true; - } - - private static function set_doctype(string $data): string - { - // Strip DOCTYPE except if containing an [internal subset] - $data = preg_replace('/^\\s*<!DOCTYPE\\s[^>\\[\\]]*>\s*/', '', $data) ?? $data; - // Declare HTML entities only if no remaining DOCTYPE - $doctype = preg_match('/^\\s*<!DOCTYPE\\s/', $data) ? '' : self::declare_html_entities(); - return $doctype . $data; - } - - private static function declare_html_entities(): string - { - // This is required because the RSS specification says that entity-encoded - // html is allowed, but the xml specification says they must be declared. - return '<!DOCTYPE rss [ <!ENTITY nbsp " "> <!ENTITY iexcl "¡"> <!ENTITY cent "¢"> <!ENTITY pound "£"> <!ENTITY curren "¤"> <!ENTITY yen "¥"> <!ENTITY brvbar "¦"> <!ENTITY sect "§"> <!ENTITY uml "¨"> <!ENTITY copy "©"> <!ENTITY ordf "ª"> <!ENTITY laquo "«"> <!ENTITY not "¬"> <!ENTITY shy "­"> <!ENTITY reg "®"> <!ENTITY macr "¯"> <!ENTITY deg "°"> <!ENTITY plusmn "±"> <!ENTITY sup2 "²"> <!ENTITY sup3 "³"> <!ENTITY acute "´"> <!ENTITY micro "µ"> <!ENTITY para "¶"> <!ENTITY middot "·"> <!ENTITY cedil "¸"> <!ENTITY sup1 "¹"> <!ENTITY ordm "º"> <!ENTITY raquo "»"> <!ENTITY frac14 "¼"> <!ENTITY frac12 "½"> <!ENTITY frac34 "¾"> <!ENTITY iquest "¿"> <!ENTITY Agrave "À"> <!ENTITY Aacute "Á"> <!ENTITY Acirc "Â"> <!ENTITY Atilde "Ã"> <!ENTITY Auml "Ä"> <!ENTITY Aring "Å"> <!ENTITY AElig "Æ"> <!ENTITY Ccedil "Ç"> <!ENTITY Egrave "È"> <!ENTITY Eacute "É"> <!ENTITY Ecirc "Ê"> <!ENTITY Euml "Ë"> <!ENTITY Igrave "Ì"> <!ENTITY Iacute "Í"> <!ENTITY Icirc "Î"> <!ENTITY Iuml "Ï"> <!ENTITY ETH "Ð"> <!ENTITY Ntilde "Ñ"> <!ENTITY Ograve "Ò"> <!ENTITY Oacute "Ó"> <!ENTITY Ocirc "Ô"> <!ENTITY Otilde "Õ"> <!ENTITY Ouml "Ö"> <!ENTITY times "×"> <!ENTITY Oslash "Ø"> <!ENTITY Ugrave "Ù"> <!ENTITY Uacute "Ú"> <!ENTITY Ucirc "Û"> <!ENTITY Uuml "Ü"> <!ENTITY Yacute "Ý"> <!ENTITY THORN "Þ"> <!ENTITY szlig "ß"> <!ENTITY agrave "à"> <!ENTITY aacute "á"> <!ENTITY acirc "â"> <!ENTITY atilde "ã"> <!ENTITY auml "ä"> <!ENTITY aring "å"> <!ENTITY aelig "æ"> <!ENTITY ccedil "ç"> <!ENTITY egrave "è"> <!ENTITY eacute "é"> <!ENTITY ecirc "ê"> <!ENTITY euml "ë"> <!ENTITY igrave "ì"> <!ENTITY iacute "í"> <!ENTITY icirc "î"> <!ENTITY iuml "ï"> <!ENTITY eth "ð"> <!ENTITY ntilde "ñ"> <!ENTITY ograve "ò"> <!ENTITY oacute "ó"> <!ENTITY ocirc "ô"> <!ENTITY otilde "õ"> <!ENTITY ouml "ö"> <!ENTITY divide "÷"> <!ENTITY oslash "ø"> <!ENTITY ugrave "ù"> <!ENTITY uacute "ú"> <!ENTITY ucirc "û"> <!ENTITY uuml "ü"> <!ENTITY yacute "ý"> <!ENTITY thorn "þ"> <!ENTITY yuml "ÿ"> <!ENTITY OElig "Œ"> <!ENTITY oelig "œ"> <!ENTITY Scaron "Š"> <!ENTITY scaron "š"> <!ENTITY Yuml "Ÿ"> <!ENTITY fnof "ƒ"> <!ENTITY circ "ˆ"> <!ENTITY tilde "˜"> <!ENTITY Alpha "Α"> <!ENTITY Beta "Β"> <!ENTITY Gamma "Γ"> <!ENTITY Epsilon "Ε"> <!ENTITY Zeta "Ζ"> <!ENTITY Eta "Η"> <!ENTITY Theta "Θ"> <!ENTITY Iota "Ι"> <!ENTITY Kappa "Κ"> <!ENTITY Lambda "Λ"> <!ENTITY Mu "Μ"> <!ENTITY Nu "Ν"> <!ENTITY Xi "Ξ"> <!ENTITY Omicron "Ο"> <!ENTITY Pi "Π"> <!ENTITY Rho "Ρ"> <!ENTITY Sigma "Σ"> <!ENTITY Tau "Τ"> <!ENTITY Upsilon "Υ"> <!ENTITY Phi "Φ"> <!ENTITY Chi "Χ"> <!ENTITY Psi "Ψ"> <!ENTITY Omega "Ω"> <!ENTITY alpha "α"> <!ENTITY beta "β"> <!ENTITY gamma "γ"> <!ENTITY delta "δ"> <!ENTITY epsilon "ε"> <!ENTITY zeta "ζ"> <!ENTITY eta "η"> <!ENTITY theta "θ"> <!ENTITY iota "ι"> <!ENTITY kappa "κ"> <!ENTITY lambda "λ"> <!ENTITY mu "μ"> <!ENTITY nu "ν"> <!ENTITY xi "ξ"> <!ENTITY omicron "ο"> <!ENTITY pi "π"> <!ENTITY rho "ρ"> <!ENTITY sigmaf "ς"> <!ENTITY sigma "σ"> <!ENTITY tau "τ"> <!ENTITY upsilon "υ"> <!ENTITY phi "φ"> <!ENTITY chi "χ"> <!ENTITY psi "ψ"> <!ENTITY omega "ω"> <!ENTITY thetasym "ϑ"> <!ENTITY upsih "ϒ"> <!ENTITY piv "ϖ"> <!ENTITY ensp " "> <!ENTITY emsp " "> <!ENTITY thinsp " "> <!ENTITY zwnj "‌"> <!ENTITY zwj "‍"> <!ENTITY lrm "‎"> <!ENTITY rlm "‏"> <!ENTITY ndash "–"> <!ENTITY mdash "—"> <!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY sbquo "‚"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”"> <!ENTITY bdquo "„"> <!ENTITY dagger "†"> <!ENTITY Dagger "‡"> <!ENTITY bull "•"> <!ENTITY hellip "…"> <!ENTITY permil "‰"> <!ENTITY prime "′"> <!ENTITY Prime "″"> <!ENTITY lsaquo "‹"> <!ENTITY rsaquo "›"> <!ENTITY oline "‾"> <!ENTITY frasl "⁄"> <!ENTITY euro "€"> <!ENTITY image "ℑ"> <!ENTITY weierp "℘"> <!ENTITY real "ℜ"> <!ENTITY trade "™"> <!ENTITY alefsym "ℵ"> <!ENTITY larr "←"> <!ENTITY uarr "↑"> <!ENTITY rarr "→"> <!ENTITY darr "↓"> <!ENTITY harr "↔"> <!ENTITY crarr "↵"> <!ENTITY lArr "⇐"> <!ENTITY uArr "⇑"> <!ENTITY rArr "⇒"> <!ENTITY dArr "⇓"> <!ENTITY hArr "⇔"> <!ENTITY forall "∀"> <!ENTITY part "∂"> <!ENTITY exist "∃"> <!ENTITY empty "∅"> <!ENTITY nabla "∇"> <!ENTITY isin "∈"> <!ENTITY notin "∉"> <!ENTITY ni "∋"> <!ENTITY prod "∏"> <!ENTITY sum "∑"> <!ENTITY minus "−"> <!ENTITY lowast "∗"> <!ENTITY radic "√"> <!ENTITY prop "∝"> <!ENTITY infin "∞"> <!ENTITY ang "∠"> <!ENTITY and "∧"> <!ENTITY or "∨"> <!ENTITY cap "∩"> <!ENTITY cup "∪"> <!ENTITY int "∫"> <!ENTITY there4 "∴"> <!ENTITY sim "∼"> <!ENTITY cong "≅"> <!ENTITY asymp "≈"> <!ENTITY ne "≠"> <!ENTITY equiv "≡"> <!ENTITY le "≤"> <!ENTITY ge "≥"> <!ENTITY sub "⊂"> <!ENTITY sup "⊃"> <!ENTITY nsub "⊄"> <!ENTITY sube "⊆"> <!ENTITY supe "⊇"> <!ENTITY oplus "⊕"> <!ENTITY otimes "⊗"> <!ENTITY perp "⊥"> <!ENTITY sdot "⋅"> <!ENTITY lceil "⌈"> <!ENTITY rceil "⌉"> <!ENTITY lfloor "⌊"> <!ENTITY rfloor "⌋"> <!ENTITY lang "〈"> <!ENTITY rang "〉"> <!ENTITY loz "◊"> <!ENTITY spades "♠"> <!ENTITY clubs "♣"> <!ENTITY hearts "♥"> <!ENTITY diams "♦"> ]>'; - } -} - -class_alias('SimplePie\Parser', 'SimplePie_Parser'); diff --git a/core/vendor/simplepie/simplepie/src/Rating.php b/core/vendor/simplepie/simplepie/src/Rating.php deleted file mode 100644 index ad1aaafa43..0000000000 --- a/core/vendor/simplepie/simplepie/src/Rating.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -/** - * Handles `<media:rating>` or `<itunes:explicit>` tags as defined in Media RSS and iTunes RSS respectively - * - * Used by {@see \SimplePie\Enclosure::get_rating()} and {@see \SimplePie\Enclosure::get_ratings()} - * - * This class can be overloaded with {@see \SimplePie\SimplePie::set_rating_class()} - */ -class Rating -{ - /** - * Rating scheme - * - * @var ?string - * @see get_scheme() - */ - public $scheme; - - /** - * Rating value - * - * @var ?string - * @see get_value() - */ - public $value; - - /** - * Constructor, used to input the data - * - * For documentation on all the parameters, see the corresponding - * properties and their accessors - */ - public function __construct( - ?string $scheme = null, - ?string $value = null - ) { - $this->scheme = $scheme; - $this->value = $value; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Get the organizational scheme for the rating - * - * @return string|null - */ - public function get_scheme() - { - if ($this->scheme !== null) { - return $this->scheme; - } - - return null; - } - - /** - * Get the value of the rating - * - * @return string|null - */ - public function get_value() - { - if ($this->value !== null) { - return $this->value; - } - - return null; - } -} - -class_alias('SimplePie\Rating', 'SimplePie_Rating'); diff --git a/core/vendor/simplepie/simplepie/src/Registry.php b/core/vendor/simplepie/simplepie/src/Registry.php deleted file mode 100644 index 228f8c33cd..0000000000 --- a/core/vendor/simplepie/simplepie/src/Registry.php +++ /dev/null @@ -1,258 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -use InvalidArgumentException; -use SimplePie\Content\Type\Sniffer; -use SimplePie\Parse\Date; -use SimplePie\XML\Declaration\Parser as DeclarationParser; - -/** - * Handles creating objects and calling methods - * - * Access this via {@see \SimplePie\SimplePie::get_registry()} - */ -class Registry -{ - /** - * Default class mapping - * - * Overriding classes *must* subclass these. - * - * @var array<class-string, class-string> - */ - protected $default = [ - Cache::class => Cache::class, - Locator::class => Locator::class, - Parser::class => Parser::class, - File::class => File::class, - Sanitize::class => Sanitize::class, - Item::class => Item::class, - Author::class => Author::class, - Category::class => Category::class, - Enclosure::class => Enclosure::class, - Caption::class => Caption::class, - Copyright::class => Copyright::class, - Credit::class => Credit::class, - Rating::class => Rating::class, - Restriction::class => Restriction::class, - Sniffer::class => Sniffer::class, - Source::class => Source::class, - Misc::class => Misc::class, - DeclarationParser::class => DeclarationParser::class, - Date::class => Date::class, - ]; - - /** - * Class mapping - * - * @see register() - * @var array<string, class-string> - */ - protected $classes = []; - - /** - * Legacy classes - * - * @see register() - * @var array<class-string> - */ - protected $legacy = []; - - /** - * Legacy types - * - * @see register() - * @var array<string, class-string> - */ - private $legacyTypes = [ - 'Cache' => Cache::class, - 'Locator' => Locator::class, - 'Parser' => Parser::class, - 'File' => File::class, - 'Sanitize' => Sanitize::class, - 'Item' => Item::class, - 'Author' => Author::class, - 'Category' => Category::class, - 'Enclosure' => Enclosure::class, - 'Caption' => Caption::class, - 'Copyright' => Copyright::class, - 'Credit' => Credit::class, - 'Rating' => Rating::class, - 'Restriction' => Restriction::class, - 'Content_Type_Sniffer' => Sniffer::class, - 'Source' => Source::class, - 'Misc' => Misc::class, - 'XML_Declaration_Parser' => DeclarationParser::class, - 'Parse_Date' => Date::class, - ]; - - /** - * Constructor - * - * No-op - */ - public function __construct() - { - } - - /** - * Register a class - * - * @param string $type See {@see $default} for names - * @param class-string $class Class name, must subclass the corresponding default - * @param bool $legacy Whether to enable legacy support for this class - * @return bool Successfulness - */ - public function register(string $type, $class, bool $legacy = false) - { - if (array_key_exists($type, $this->legacyTypes)) { - // trigger_error(sprintf('"%s"(): Using argument #1 ($type) with value "%s" is deprecated since SimplePie 1.8.0, use class-string "%s" instead.', __METHOD__, $type, $this->legacyTypes[$type]), \E_USER_DEPRECATED); - - $type = $this->legacyTypes[$type]; - } - - if (!array_key_exists($type, $this->default)) { - return false; - } - - if (!class_exists($class)) { - return false; - } - - /** @var string */ - $base_class = $this->default[$type]; - - if (!is_subclass_of($class, $base_class)) { - return false; - } - - $this->classes[$type] = $class; - - if ($legacy) { - $this->legacy[] = $class; - } - - return true; - } - - /** - * Get the class registered for a type - * - * Where possible, use {@see create()} or {@see call()} instead - * - * @template T - * @param class-string<T> $type - * @return class-string<T>|null - */ - public function get_class($type) - { - if (array_key_exists($type, $this->legacyTypes)) { - // trigger_error(sprintf('"%s"(): Using argument #1 ($type) with value "%s" is deprecated since SimplePie 1.8.0, use class-string "%s" instead.', __METHOD__, $type, $this->legacyTypes[$type]), \E_USER_DEPRECATED); - - $type = $this->legacyTypes[$type]; - } - - if (!array_key_exists($type, $this->default)) { - return null; - } - - // For PHPStan: values in $default should be subtypes of keys. - /** @var class-string<T> */ - $class = $this->default[$type]; - - if (array_key_exists($type, $this->classes)) { - // For PHPStan: values in $classes should be subtypes of keys. - /** @var class-string<T> */ - $class = $this->classes[$type]; - } - - return $class; - } - - /** - * Create a new instance of a given type - * - * @template T class-string $type - * @param class-string<T> $type - * @param array<mixed> $parameters Parameters to pass to the constructor - * @return T Instance of class - */ - public function &create($type, array $parameters = []) - { - $class = $this->get_class($type); - if ($class === null) { - throw new InvalidArgumentException(sprintf( - '%s(): Argument #1 ($type) "%s" not found in class list.', - __METHOD__, - $type - ), 1); - } - - if (!method_exists($class, '__construct')) { - $instance = new $class(); - } else { - $reflector = new \ReflectionClass($class); - // For PHPStan: $class is T. - /** @var T */ - $instance = $reflector->newInstanceArgs($parameters); - } - - if ($instance instanceof RegistryAware) { - $instance->set_registry($this); - } elseif (method_exists($instance, 'set_registry')) { - trigger_error(sprintf('Using the method "set_registry()" without implementing "%s" is deprecated since SimplePie 1.8.0, implement "%s" in "%s".', RegistryAware::class, RegistryAware::class, $class), \E_USER_DEPRECATED); - $instance->set_registry($this); - } - - return $instance; - } - - /** - * Call a static method for a type - * - * @param class-string $type - * @param string $method - * @param array<mixed> $parameters - * @return mixed - */ - public function &call($type, string $method, array $parameters = []) - { - $class = $this->get_class($type); - if ($class === null) { - throw new InvalidArgumentException(sprintf( - '%s(): Argument #1 ($type) "%s" not found in class list.', - __METHOD__, - $type - ), 1); - } - - if (in_array($class, $this->legacy)) { - switch ($type) { - case Cache::class: - // For backwards compatibility with old non-static - // Cache::create() methods in PHP < 8.0. - // No longer supported as of PHP 8.0. - if ($method === 'get_handler') { - // Fixing this PHPStan error breaks CacheTest::testDirectOverrideLegacy() - /** @phpstan-ignore argument.type */ - $result = @call_user_func_array([$class, 'create'], $parameters); - return $result; - } - break; - } - } - - $callable = [$class, $method]; - assert(is_callable($callable), 'For PHPstan'); - $result = call_user_func_array($callable, $parameters); - return $result; - } -} - -class_alias('SimplePie\Registry', 'SimplePie_Registry'); diff --git a/core/vendor/simplepie/simplepie/src/RegistryAware.php b/core/vendor/simplepie/simplepie/src/RegistryAware.php deleted file mode 100644 index a44845aea1..0000000000 --- a/core/vendor/simplepie/simplepie/src/RegistryAware.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -/** - * Handles the injection of Registry into other class - * - * {@see \SimplePie\SimplePie::get_registry()} - */ -interface RegistryAware -{ - /** - * Set the Registry into the class - * - * @return void - */ - public function set_registry(Registry $registry); -} diff --git a/core/vendor/simplepie/simplepie/src/Restriction.php b/core/vendor/simplepie/simplepie/src/Restriction.php deleted file mode 100644 index b3cc51eb00..0000000000 --- a/core/vendor/simplepie/simplepie/src/Restriction.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -/** - * Handles `<media:restriction>` as defined in Media RSS - * - * Used by {@see \SimplePie\Enclosure::get_restriction()} and {@see \SimplePie\Enclosure::get_restrictions()} - * - * This class can be overloaded with {@see \SimplePie\SimplePie::set_restriction_class()} - */ -class Restriction -{ - public const RELATIONSHIP_ALLOW = 'allow'; - public const RELATIONSHIP_DENY = 'deny'; - - /** - * Relationship ('allow'/'deny') - * - * @var self::RELATIONSHIP_*|null - * @see get_relationship() - */ - public $relationship; - - /** - * Type of restriction - * - * @var string|null - * @see get_type() - */ - public $type; - - /** - * Restricted values - * - * @var string|null - * @see get_value() - */ - public $value; - - /** - * Constructor, used to input the data - * - * For documentation on all the parameters, see the corresponding - * properties and their accessors - * - * @param ?self::RELATIONSHIP_* $relationship - */ - public function __construct(?string $relationship = null, ?string $type = null, ?string $value = null) - { - $this->relationship = $relationship; - $this->type = $type; - $this->value = $value; - } - - /** - * String-ified version - * - * @return string - */ - public function __toString() - { - // There is no $this->data here - return md5(serialize($this)); - } - - /** - * Get the relationship - * - * @return ?self::RELATIONSHIP_* - */ - public function get_relationship() - { - if ($this->relationship !== null) { - return $this->relationship; - } - - return null; - } - - /** - * Get the type - * - * @return string|null - */ - public function get_type() - { - if ($this->type !== null) { - return $this->type; - } - - return null; - } - - /** - * Get the list of restricted things - * - * @return string|null - */ - public function get_value() - { - if ($this->value !== null) { - return $this->value; - } - - return null; - } -} - -class_alias('SimplePie\Restriction', 'SimplePie_Restriction'); diff --git a/core/vendor/simplepie/simplepie/src/Sanitize.php b/core/vendor/simplepie/simplepie/src/Sanitize.php deleted file mode 100644 index c8aa2dce69..0000000000 --- a/core/vendor/simplepie/simplepie/src/Sanitize.php +++ /dev/null @@ -1,831 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -use DOMDocument; -use DOMXPath; -use InvalidArgumentException; -use Psr\Http\Client\ClientInterface; -use Psr\Http\Message\RequestFactoryInterface; -use Psr\Http\Message\UriFactoryInterface; -use SimplePie\Cache\Base; -use SimplePie\Cache\BaseDataCache; -use SimplePie\Cache\CallableNameFilter; -use SimplePie\Cache\DataCache; -use SimplePie\Cache\NameFilter; -use SimplePie\HTTP\Client; -use SimplePie\HTTP\ClientException; -use SimplePie\HTTP\FileClient; -use SimplePie\HTTP\Psr18Client; - -/** - * Used for data cleanup and post-processing - * - * - * This class can be overloaded with {@see \SimplePie\SimplePie::set_sanitize_class()} - * - * @todo Move to using an actual HTML parser (this will allow tags to be properly stripped, and to switch between HTML and XHTML), this will also make it easier to shorten a string while preserving HTML tags - */ -class Sanitize implements RegistryAware -{ - // Private vars - /** @var string */ - public $base = ''; - - // Options - /** @var bool */ - public $remove_div = true; - /** @var string */ - public $image_handler = ''; - /** @var string[] */ - public $strip_htmltags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']; - /** @var bool */ - public $encode_instead_of_strip = false; - /** @var string[] */ - public $strip_attributes = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc']; - /** @var string[] */ - public $rename_attributes = []; - /** @var array<string, array<string, string>> */ - public $add_attributes = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]; - /** @var bool */ - public $strip_comments = false; - /** @var string */ - public $output_encoding = 'UTF-8'; - /** @var bool */ - public $enable_cache = true; - /** @var string */ - public $cache_location = './cache'; - /** @var string&(callable(string): string) */ - public $cache_name_function = 'md5'; - - /** - * @var NameFilter - */ - private $cache_namefilter; - /** @var int */ - public $timeout = 10; - /** @var string */ - public $useragent = ''; - /** @var bool */ - public $force_fsockopen = false; - /** @var array<string, string|string[]> */ - public $replace_url_attributes = []; - /** - * @var array<int, mixed> Custom curl options - * @see SimplePie::set_curl_options() - */ - private $curl_options = []; - - /** @var Registry */ - public $registry; - - /** - * @var DataCache|null - */ - private $cache = null; - - /** - * @var int Cache duration (in seconds) - */ - private $cache_duration = 3600; - - /** - * List of domains for which to force HTTPS. - * @see \SimplePie\Sanitize::set_https_domains() - * Array is a tree split at DNS levels. Example: - * array('biz' => true, 'com' => array('example' => true), 'net' => array('example' => array('www' => true))) - * @var true|array<string, true|array<string, true|array<string, array<string, true|array<string, true|array<string, true>>>>>> - */ - public $https_domains = []; - - /** - * @var Client|null - */ - private $http_client = null; - - public function __construct() - { - // Set defaults - $this->set_url_replacements(null); - } - - /** - * @return void - */ - public function remove_div(bool $enable = true) - { - $this->remove_div = (bool) $enable; - } - - /** - * @param string|false $page - * @return void - */ - public function set_image_handler($page = false) - { - if ($page) { - $this->image_handler = (string) $page; - } else { - $this->image_handler = ''; - } - } - - /** - * @return void - */ - public function set_registry(\SimplePie\Registry $registry) - { - $this->registry = $registry; - } - - /** - * @param (string&(callable(string): string))|NameFilter $cache_name_function - * @param class-string<Cache> $cache_class - * @return void - */ - public function pass_cache_data(bool $enable_cache = true, string $cache_location = './cache', $cache_name_function = 'md5', string $cache_class = Cache::class, ?DataCache $cache = null) - { - $this->enable_cache = $enable_cache; - - if ($cache_location) { - $this->cache_location = $cache_location; - } - - // @phpstan-ignore-next-line Enforce PHPDoc type. - if (!is_string($cache_name_function) && !$cache_name_function instanceof NameFilter) { - throw new InvalidArgumentException(sprintf( - '%s(): Argument #3 ($cache_name_function) must be of type %s', - __METHOD__, - NameFilter::class - ), 1); - } - - // BC: $cache_name_function could be a callable as string - if (is_string($cache_name_function)) { - // trigger_error(sprintf('Providing $cache_name_function as string in "%s()" is deprecated since SimplePie 1.8.0, provide as "%s" instead.', __METHOD__, NameFilter::class), \E_USER_DEPRECATED); - $this->cache_name_function = $cache_name_function; - - $cache_name_function = new CallableNameFilter($cache_name_function); - } - - $this->cache_namefilter = $cache_name_function; - - if ($cache !== null) { - $this->cache = $cache; - } - } - - /** - * Set a PSR-18 client and PSR-17 factories - * - * Allows you to use your own HTTP client implementations. - */ - final public function set_http_client( - ClientInterface $http_client, - RequestFactoryInterface $request_factory, - UriFactoryInterface $uri_factory - ): void { - $this->http_client = new Psr18Client($http_client, $request_factory, $uri_factory); - } - - /** - * @deprecated since SimplePie 1.9.0, use \SimplePie\Sanitize::set_http_client() instead. - * @param class-string<File> $file_class - * @param array<int, mixed> $curl_options - * @return void - */ - public function pass_file_data(string $file_class = File::class, int $timeout = 10, string $useragent = '', bool $force_fsockopen = false, array $curl_options = []) - { - // trigger_error(sprintf('SimplePie\Sanitize::pass_file_data() is deprecated since SimplePie 1.9.0, please use "SimplePie\Sanitize::set_http_client()" instead.'), \E_USER_DEPRECATED); - if ($timeout) { - $this->timeout = $timeout; - } - - if ($useragent) { - $this->useragent = $useragent; - } - - if ($force_fsockopen) { - $this->force_fsockopen = $force_fsockopen; - } - - $this->curl_options = $curl_options; - // Invalidate the registered client. - $this->http_client = null; - } - - /** - * @param string[]|string|false $tags Set a list of tags to strip, or set empty string to use default tags, or false to strip nothing. - * @return void - */ - public function strip_htmltags($tags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']) - { - if ($tags) { - if (is_array($tags)) { - $this->strip_htmltags = $tags; - } else { - $this->strip_htmltags = explode(',', $tags); - } - } else { - $this->strip_htmltags = []; - } - } - - /** - * @return void - */ - public function encode_instead_of_strip(bool $encode = false) - { - $this->encode_instead_of_strip = $encode; - } - - /** - * @param string[]|string $attribs - * @return void - */ - public function rename_attributes($attribs = []) - { - if ($attribs) { - if (is_array($attribs)) { - $this->rename_attributes = $attribs; - } else { - $this->rename_attributes = explode(',', $attribs); - } - } else { - $this->rename_attributes = []; - } - } - - /** - * @param string[]|string $attribs - * @return void - */ - public function strip_attributes($attribs = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc']) - { - if ($attribs) { - if (is_array($attribs)) { - $this->strip_attributes = $attribs; - } else { - $this->strip_attributes = explode(',', $attribs); - } - } else { - $this->strip_attributes = []; - } - } - - /** - * @param array<string, array<string, string>> $attribs - * @return void - */ - public function add_attributes(array $attribs = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]) - { - $this->add_attributes = $attribs; - } - - /** - * @return void - */ - public function strip_comments(bool $strip = false) - { - $this->strip_comments = $strip; - } - - /** - * @return void - */ - public function set_output_encoding(string $encoding = 'UTF-8') - { - $this->output_encoding = $encoding; - } - - /** - * Set element/attribute key/value pairs of HTML attributes - * containing URLs that need to be resolved relative to the feed - * - * Defaults to |a|@href, |area|@href, |audio|@src, |blockquote|@cite, - * |del|@cite, |form|@action, |img|@longdesc, |img|@src, |input|@src, - * |ins|@cite, |q|@cite, |source|@src, |video|@src - * - * @since 1.0 - * @param array<string, string|string[]>|null $element_attribute Element/attribute key/value pairs, null for default - * @return void - */ - public function set_url_replacements(?array $element_attribute = null) - { - if ($element_attribute === null) { - $element_attribute = [ - 'a' => 'href', - 'area' => 'href', - 'audio' => 'src', - 'blockquote' => 'cite', - 'del' => 'cite', - 'form' => 'action', - 'img' => [ - 'longdesc', - 'src' - ], - 'input' => 'src', - 'ins' => 'cite', - 'q' => 'cite', - 'source' => 'src', - 'video' => [ - 'poster', - 'src' - ] - ]; - } - $this->replace_url_attributes = $element_attribute; - } - - /** - * Set the list of domains for which to force HTTPS. - * @see \SimplePie\Misc::https_url() - * Example array('biz', 'example.com', 'example.org', 'www.example.net'); - * - * @param string[] $domains list of domain names ['biz', 'example.com', 'example.org', 'www.example.net'] - * - * @return void - */ - public function set_https_domains(array $domains) - { - $this->https_domains = []; - foreach ($domains as $domain) { - $domain = trim($domain, ". \t\n\r\0\x0B"); - $segments = array_reverse(explode('.', $domain)); - /** @var true|array<string, true|array<string, true|array<string, array<string, true|array<string, true|array<string, true>>>>>> */ // Needed for PHPStan. - $node = &$this->https_domains; - foreach ($segments as $segment) {//Build a tree - if ($node === true) { - break; - } - if (!isset($node[$segment])) { - $node[$segment] = []; - } - $node = &$node[$segment]; - } - $node = true; - } - } - - /** - * Check if the domain is in the list of forced HTTPS. - * - * @return bool - */ - protected function is_https_domain(string $domain) - { - $domain = trim($domain, '. '); - $segments = array_reverse(explode('.', $domain)); - $node = &$this->https_domains; - foreach ($segments as $segment) {//Explore the tree - if (isset($node[$segment])) { - $node = &$node[$segment]; - } else { - break; - } - } - return $node === true; - } - - /** - * Force HTTPS for selected Web sites. - * - * @return string - */ - public function https_url(string $url) - { - return ( - strtolower(substr($url, 0, 7)) === 'http://' - && ($parsed = parse_url($url, PHP_URL_HOST)) !== false // Malformed URL - && $parsed !== null // Missing host - && $this->is_https_domain($parsed) // Should be forced? - ) ? substr_replace($url, 's', 4, 0) // Add the 's' to HTTPS - : $url; - } - - /** - * @param int-mask-of<SimplePie::CONSTRUCT_*> $type - * @param string $base - * @return string Sanitized data; false if output encoding is changed to something other than UTF-8 and conversion fails - */ - public function sanitize(string $data, int $type, string $base = '') - { - $data = trim($data); - if ($data !== '' || $type & \SimplePie\SimplePie::CONSTRUCT_IRI) { - if ($type & \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML) { - if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . \SimplePie\SimplePie::PCRE_HTML_ATTRIBUTE . '>)/', $data)) { - $type |= \SimplePie\SimplePie::CONSTRUCT_HTML; - } else { - $type |= \SimplePie\SimplePie::CONSTRUCT_TEXT; - } - } - - if ($type & \SimplePie\SimplePie::CONSTRUCT_BASE64) { - $data = base64_decode($data); - } - - if ($type & (\SimplePie\SimplePie::CONSTRUCT_HTML | \SimplePie\SimplePie::CONSTRUCT_XHTML)) { - if (!class_exists('DOMDocument')) { - throw new \SimplePie\Exception('DOMDocument not found, unable to use sanitizer'); - } - $document = new \DOMDocument(); - $document->encoding = 'UTF-8'; - - // PHPStan seems to have trouble resolving int-mask because bitwise - // operators are used when operators are used when passing this parameter. - // https://github.com/phpstan/phpstan/issues/9384 - /** @var int-mask-of<SimplePie::CONSTRUCT_*> $type */ - $data = $this->preprocess($data, $type); - - set_error_handler([Misc::class, 'silence_errors']); - $document->loadHTML($data); - restore_error_handler(); - - $xpath = new \DOMXPath($document); - - // Strip comments - if ($this->strip_comments) { - /** @var \DOMNodeList<\DOMComment> */ - $comments = $xpath->query('//comment()'); - - foreach ($comments as $comment) { - $parentNode = $comment->parentNode; - assert($parentNode !== null, 'For PHPStan, comment must have a parent'); - $parentNode->removeChild($comment); - } - } - - // Strip out HTML tags and attributes that might cause various security problems. - // Based on recommendations by Mark Pilgrim at: - // https://web.archive.org/web/20110902041826/http://diveintomark.org:80/archives/2003/06/12/how_to_consume_rss_safely - if ($this->strip_htmltags) { - foreach ($this->strip_htmltags as $tag) { - $this->strip_tag($tag, $document, $xpath, $type); - } - } - - if ($this->rename_attributes) { - foreach ($this->rename_attributes as $attrib) { - $this->rename_attr($attrib, $xpath); - } - } - - if ($this->strip_attributes) { - foreach ($this->strip_attributes as $attrib) { - $this->strip_attr($attrib, $xpath); - } - } - - if ($this->add_attributes) { - foreach ($this->add_attributes as $tag => $valuePairs) { - $this->add_attr($tag, $valuePairs, $document); - } - } - - // Replace relative URLs - $this->base = $base; - foreach ($this->replace_url_attributes as $element => $attributes) { - $this->replace_urls($document, $element, $attributes); - } - - // If image handling (caching, etc.) is enabled, cache and rewrite all the image tags. - if ($this->image_handler !== '' && $this->enable_cache) { - $images = $document->getElementsByTagName('img'); - - foreach ($images as $img) { - if ($img->hasAttribute('src')) { - $image_url = $this->cache_namefilter->filter($img->getAttribute('src')); - $cache = $this->get_cache($image_url); - - if ($cache->get_data($image_url, false)) { - $img->setAttribute('src', $this->image_handler . $image_url); - } else { - try { - $file = $this->get_http_client()->request( - Client::METHOD_GET, - $img->getAttribute('src'), - ['X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']] - ); - } catch (ClientException $th) { - continue; - } - - if ((!Misc::is_remote_uri($file->get_final_requested_uri()) || ($file->get_status_code() === 200 || $file->get_status_code() > 206 && $file->get_status_code() < 300))) { - if ($cache->set_data($image_url, ['headers' => $file->get_headers(), 'body' => $file->get_body_content()], $this->cache_duration)) { - $img->setAttribute('src', $this->image_handler . $image_url); - } else { - trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); - } - } - } - } - } - } - - // Get content node - $div = null; - if (($item = $document->getElementsByTagName('body')->item(0)) !== null) { - $div = $item->firstChild; - } - // Finally, convert to a HTML string - $data = trim((string) $document->saveHTML($div)); - - if ($this->remove_div) { - $data = preg_replace('/^<div' . \SimplePie\SimplePie::PCRE_XML_ATTRIBUTE . '>/', '', $data); - // Cast for PHPStan, it is unable to validate a non-literal regex above. - $data = preg_replace('/<\/div>$/', '', (string) $data); - } else { - $data = preg_replace('/^<div' . \SimplePie\SimplePie::PCRE_XML_ATTRIBUTE . '>/', '<div>', $data); - } - - // Cast for PHPStan, it is unable to validate a non-literal regex above. - $data = str_replace('</source>', '', (string) $data); - } - - if ($type & \SimplePie\SimplePie::CONSTRUCT_IRI) { - $absolute = $this->registry->call(Misc::class, 'absolutize_url', [$data, $base]); - if ($absolute !== false) { - $data = $absolute; - } - } - - if ($type & (\SimplePie\SimplePie::CONSTRUCT_TEXT | \SimplePie\SimplePie::CONSTRUCT_IRI)) { - $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8'); - } - - if ($this->output_encoding !== 'UTF-8') { - // This really returns string|false but changing encoding is uncommon and we are going to deprecate it, so let’s just lie to PHPStan in the interest of cleaner annotations. - /** @var string */ - $data = $this->registry->call(Misc::class, 'change_encoding', [$data, 'UTF-8', $this->output_encoding]); - } - } - return $data; - } - - /** - * @param int-mask-of<SimplePie::CONSTRUCT_*> $type - * @return string - */ - protected function preprocess(string $html, int $type) - { - $ret = ''; - $html = preg_replace('%</?(?:html|body)[^>]*?'.'>%is', '', $html); - if ($type & ~\SimplePie\SimplePie::CONSTRUCT_XHTML) { - // Atom XHTML constructs are wrapped with a div by default - // Note: No protection if $html contains a stray </div>! - $html = '<div>' . $html . '</div>'; - $ret .= '<!DOCTYPE html>'; - $content_type = 'text/html'; - } else { - $ret .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; - $content_type = 'application/xhtml+xml'; - } - - $ret .= '<html><head>'; - $ret .= '<meta http-equiv="Content-Type" content="' . $content_type . '; charset=utf-8" />'; - $ret .= '</head><body>' . $html . '</body></html>'; - return $ret; - } - - /** - * @param array<string>|string $attributes - * @return void - */ - public function replace_urls(DOMDocument $document, string $tag, $attributes) - { - if (!is_array($attributes)) { - $attributes = [$attributes]; - } - - if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags)) { - $elements = $document->getElementsByTagName($tag); - foreach ($elements as $element) { - foreach ($attributes as $attribute) { - if ($element->hasAttribute($attribute)) { - $value = $this->registry->call(Misc::class, 'absolutize_url', [$element->getAttribute($attribute), $this->base]); - if ($value !== false) { - $value = $this->https_url($value); - $element->setAttribute($attribute, $value); - } - } - } - } - } - } - - /** - * @param array<int, string> $match - * @return string - */ - public function do_strip_htmltags(array $match) - { - if ($this->encode_instead_of_strip) { - if (isset($match[4]) && !in_array(strtolower($match[1]), ['script', 'style'])) { - $match[1] = htmlspecialchars($match[1], ENT_COMPAT, 'UTF-8'); - $match[2] = htmlspecialchars($match[2], ENT_COMPAT, 'UTF-8'); - return "<$match[1]$match[2]>$match[3]</$match[1]>"; - } else { - return htmlspecialchars($match[0], ENT_COMPAT, 'UTF-8'); - } - } elseif (isset($match[4]) && !in_array(strtolower($match[1]), ['script', 'style'])) { - return $match[4]; - } else { - return ''; - } - } - - /** - * @param int-mask-of<SimplePie::CONSTRUCT_*> $type - * @return void - */ - protected function strip_tag(string $tag, DOMDocument $document, DOMXPath $xpath, int $type) - { - $elements = $xpath->query('body//' . $tag); - - if ($elements === false) { - throw new \SimplePie\Exception(sprintf( - '%s(): Possibly malformed expression, check argument #1 ($tag)', - __METHOD__ - ), 1); - } - - if ($this->encode_instead_of_strip) { - foreach ($elements as $element) { - $fragment = $document->createDocumentFragment(); - - // For elements which aren't script or style, include the tag itself - if (!in_array($tag, ['script', 'style'])) { - $text = '<' . $tag; - if ($element->attributes !== null) { - $attrs = []; - foreach ($element->attributes as $name => $attr) { - $value = $attr->value; - - // In XHTML, empty values should never exist, so we repeat the value - if (empty($value) && ($type & \SimplePie\SimplePie::CONSTRUCT_XHTML)) { - $value = $name; - } - // For HTML, empty is fine - elseif (empty($value) && ($type & \SimplePie\SimplePie::CONSTRUCT_HTML)) { - $attrs[] = $name; - continue; - } - - // Standard attribute text - $attrs[] = $name . '="' . $attr->value . '"'; - } - $text .= ' ' . implode(' ', $attrs); - } - $text .= '>'; - $fragment->appendChild(new \DOMText($text)); - } - - $number = $element->childNodes->length; - for ($i = $number; $i > 0; $i--) { - if (($child = $element->childNodes->item(0)) !== null) { - $fragment->appendChild($child); - } - } - - if (!in_array($tag, ['script', 'style'])) { - $fragment->appendChild(new \DOMText('</' . $tag . '>')); - } - - if (($parentNode = $element->parentNode) !== null) { - $parentNode->replaceChild($fragment, $element); - } - } - - return; - } elseif (in_array($tag, ['script', 'style'])) { - foreach ($elements as $element) { - if (($parentNode = $element->parentNode) !== null) { - $parentNode->removeChild($element); - } - } - - return; - } else { - foreach ($elements as $element) { - $fragment = $document->createDocumentFragment(); - $number = $element->childNodes->length; - for ($i = $number; $i > 0; $i--) { - if (($child = $element->childNodes->item(0)) !== null) { - $fragment->appendChild($child); - } - } - - if (($parentNode = $element->parentNode) !== null) { - $parentNode->replaceChild($fragment, $element); - } - } - } - } - - /** - * @return void - */ - protected function strip_attr(string $attrib, DOMXPath $xpath) - { - $elements = $xpath->query('//*[@' . $attrib . ']'); - - if ($elements === false) { - throw new \SimplePie\Exception(sprintf( - '%s(): Possibly malformed expression, check argument #1 ($attrib)', - __METHOD__ - ), 1); - } - - /** @var \DOMElement $element */ - foreach ($elements as $element) { - $element->removeAttribute($attrib); - } - } - - /** - * @return void - */ - protected function rename_attr(string $attrib, DOMXPath $xpath) - { - $elements = $xpath->query('//*[@' . $attrib . ']'); - - if ($elements === false) { - throw new \SimplePie\Exception(sprintf( - '%s(): Possibly malformed expression, check argument #1 ($attrib)', - __METHOD__ - ), 1); - } - - /** @var \DOMElement $element */ - foreach ($elements as $element) { - $element->setAttribute('data-sanitized-' . $attrib, $element->getAttribute($attrib)); - $element->removeAttribute($attrib); - } - } - - /** - * @param array<string, string> $valuePairs - * @return void - */ - protected function add_attr(string $tag, array $valuePairs, DOMDocument $document) - { - $elements = $document->getElementsByTagName($tag); - /** @var \DOMElement $element */ - foreach ($elements as $element) { - foreach ($valuePairs as $attrib => $value) { - $element->setAttribute($attrib, $value); - } - } - } - - /** - * Get a DataCache - * - * @param string $image_url Only needed for BC, can be removed in SimplePie 2.0.0 - * - * @return DataCache - */ - private function get_cache(string $image_url = ''): DataCache - { - if ($this->cache === null) { - // @trigger_error(sprintf('Not providing as PSR-16 cache implementation is deprecated since SimplePie 1.8.0, please use "SimplePie\SimplePie::set_cache()".'), \E_USER_DEPRECATED); - $cache = $this->registry->call(Cache::class, 'get_handler', [ - $this->cache_location, - $image_url, - Base::TYPE_IMAGE - ]); - - return new BaseDataCache($cache); - } - - return $this->cache; - } - - /** - * Get a HTTP client - */ - private function get_http_client(): Client - { - if ($this->http_client === null) { - $this->http_client = new FileClient( - $this->registry, - [ - 'timeout' => $this->timeout, - 'redirects' => 5, - 'useragent' => $this->useragent, - 'force_fsockopen' => $this->force_fsockopen, - 'curl_options' => $this->curl_options, - ] - ); - } - - return $this->http_client; - } -} - -class_alias('SimplePie\Sanitize', 'SimplePie_Sanitize'); diff --git a/core/vendor/simplepie/simplepie/src/SimplePie.php b/core/vendor/simplepie/simplepie/src/SimplePie.php deleted file mode 100644 index bbc5218e6e..0000000000 --- a/core/vendor/simplepie/simplepie/src/SimplePie.php +++ /dev/null @@ -1,3465 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -use InvalidArgumentException; -use Psr\Http\Client\ClientInterface; -use Psr\Http\Message\RequestFactoryInterface; -use Psr\Http\Message\UriFactoryInterface; -use Psr\SimpleCache\CacheInterface; -use SimplePie\Cache\Base; -use SimplePie\Cache\BaseDataCache; -use SimplePie\Cache\CallableNameFilter; -use SimplePie\Cache\DataCache; -use SimplePie\Cache\NameFilter; -use SimplePie\Cache\Psr16; -use SimplePie\Content\Type\Sniffer; -use SimplePie\Exception as SimplePieException; -use SimplePie\HTTP\Client; -use SimplePie\HTTP\ClientException; -use SimplePie\HTTP\FileClient; -use SimplePie\HTTP\Psr18Client; -use SimplePie\HTTP\Response; - -/** - * SimplePie - */ -class SimplePie -{ - /** - * SimplePie Name - */ - public const NAME = 'SimplePie'; - - /** - * SimplePie Version - */ - public const VERSION = '1.9.0'; - - /** - * SimplePie Website URL - */ - public const URL = 'http://simplepie.org'; - - /** - * SimplePie Linkback - */ - public const LINKBACK = '<a href="' . self::URL . '" title="' . self::NAME . ' ' . self::VERSION . '">' . self::NAME . '</a>'; - - /** - * No Autodiscovery - * @see SimplePie::set_autodiscovery_level() - */ - public const LOCATOR_NONE = 0; - - /** - * Feed Link Element Autodiscovery - * @see SimplePie::set_autodiscovery_level() - */ - public const LOCATOR_AUTODISCOVERY = 1; - - /** - * Local Feed Extension Autodiscovery - * @see SimplePie::set_autodiscovery_level() - */ - public const LOCATOR_LOCAL_EXTENSION = 2; - - /** - * Local Feed Body Autodiscovery - * @see SimplePie::set_autodiscovery_level() - */ - public const LOCATOR_LOCAL_BODY = 4; - - /** - * Remote Feed Extension Autodiscovery - * @see SimplePie::set_autodiscovery_level() - */ - public const LOCATOR_REMOTE_EXTENSION = 8; - - /** - * Remote Feed Body Autodiscovery - * @see SimplePie::set_autodiscovery_level() - */ - public const LOCATOR_REMOTE_BODY = 16; - - /** - * All Feed Autodiscovery - * @see SimplePie::set_autodiscovery_level() - */ - public const LOCATOR_ALL = 31; - - /** - * No known feed type - */ - public const TYPE_NONE = 0; - - /** - * RSS 0.90 - */ - public const TYPE_RSS_090 = 1; - - /** - * RSS 0.91 (Netscape) - */ - public const TYPE_RSS_091_NETSCAPE = 2; - - /** - * RSS 0.91 (Userland) - */ - public const TYPE_RSS_091_USERLAND = 4; - - /** - * RSS 0.91 (both Netscape and Userland) - */ - public const TYPE_RSS_091 = 6; - - /** - * RSS 0.92 - */ - public const TYPE_RSS_092 = 8; - - /** - * RSS 0.93 - */ - public const TYPE_RSS_093 = 16; - - /** - * RSS 0.94 - */ - public const TYPE_RSS_094 = 32; - - /** - * RSS 1.0 - */ - public const TYPE_RSS_10 = 64; - - /** - * RSS 2.0 - */ - public const TYPE_RSS_20 = 128; - - /** - * RDF-based RSS - */ - public const TYPE_RSS_RDF = 65; - - /** - * Non-RDF-based RSS (truly intended as syndication format) - */ - public const TYPE_RSS_SYNDICATION = 190; - - /** - * All RSS - */ - public const TYPE_RSS_ALL = 255; - - /** - * Atom 0.3 - */ - public const TYPE_ATOM_03 = 256; - - /** - * Atom 1.0 - */ - public const TYPE_ATOM_10 = 512; - - /** - * All Atom - */ - public const TYPE_ATOM_ALL = 768; - - /** - * All feed types - */ - public const TYPE_ALL = 1023; - - /** - * No construct - */ - public const CONSTRUCT_NONE = 0; - - /** - * Text construct - */ - public const CONSTRUCT_TEXT = 1; - - /** - * HTML construct - */ - public const CONSTRUCT_HTML = 2; - - /** - * XHTML construct - */ - public const CONSTRUCT_XHTML = 4; - - /** - * base64-encoded construct - */ - public const CONSTRUCT_BASE64 = 8; - - /** - * IRI construct - */ - public const CONSTRUCT_IRI = 16; - - /** - * A construct that might be HTML - */ - public const CONSTRUCT_MAYBE_HTML = 32; - - /** - * All constructs - */ - public const CONSTRUCT_ALL = 63; - - /** - * Don't change case - */ - public const SAME_CASE = 1; - - /** - * Change to lowercase - */ - public const LOWERCASE = 2; - - /** - * Change to uppercase - */ - public const UPPERCASE = 4; - - /** - * PCRE for HTML attributes - */ - public const PCRE_HTML_ATTRIBUTE = '((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*'; - - /** - * PCRE for XML attributes - */ - public const PCRE_XML_ATTRIBUTE = '((?:\s+(?:(?:[^\s:]+:)?[^\s:]+)\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\s*'; - - /** - * XML Namespace - */ - public const NAMESPACE_XML = 'http://www.w3.org/XML/1998/namespace'; - - /** - * Atom 1.0 Namespace - */ - public const NAMESPACE_ATOM_10 = 'http://www.w3.org/2005/Atom'; - - /** - * Atom 0.3 Namespace - */ - public const NAMESPACE_ATOM_03 = 'http://purl.org/atom/ns#'; - - /** - * RDF Namespace - */ - public const NAMESPACE_RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'; - - /** - * RSS 0.90 Namespace - */ - public const NAMESPACE_RSS_090 = 'http://my.netscape.com/rdf/simple/0.9/'; - - /** - * RSS 1.0 Namespace - */ - public const NAMESPACE_RSS_10 = 'http://purl.org/rss/1.0/'; - - /** - * RSS 1.0 Content Module Namespace - */ - public const NAMESPACE_RSS_10_MODULES_CONTENT = 'http://purl.org/rss/1.0/modules/content/'; - - /** - * RSS 2.0 Namespace - * (Stupid, I know, but I'm certain it will confuse people less with support.) - */ - public const NAMESPACE_RSS_20 = ''; - - /** - * DC 1.0 Namespace - */ - public const NAMESPACE_DC_10 = 'http://purl.org/dc/elements/1.0/'; - - /** - * DC 1.1 Namespace - */ - public const NAMESPACE_DC_11 = 'http://purl.org/dc/elements/1.1/'; - - /** - * W3C Basic Geo (WGS84 lat/long) Vocabulary Namespace - */ - public const NAMESPACE_W3C_BASIC_GEO = 'http://www.w3.org/2003/01/geo/wgs84_pos#'; - - /** - * GeoRSS Namespace - */ - public const NAMESPACE_GEORSS = 'http://www.georss.org/georss'; - - /** - * Media RSS Namespace - */ - public const NAMESPACE_MEDIARSS = 'http://search.yahoo.com/mrss/'; - - /** - * Wrong Media RSS Namespace. Caused by a long-standing typo in the spec. - */ - public const NAMESPACE_MEDIARSS_WRONG = 'http://search.yahoo.com/mrss'; - - /** - * Wrong Media RSS Namespace #2. New namespace introduced in Media RSS 1.5. - */ - public const NAMESPACE_MEDIARSS_WRONG2 = 'http://video.search.yahoo.com/mrss'; - - /** - * Wrong Media RSS Namespace #3. A possible typo of the Media RSS 1.5 namespace. - */ - public const NAMESPACE_MEDIARSS_WRONG3 = 'http://video.search.yahoo.com/mrss/'; - - /** - * Wrong Media RSS Namespace #4. New spec location after the RSS Advisory Board takes it over, but not a valid namespace. - */ - public const NAMESPACE_MEDIARSS_WRONG4 = 'http://www.rssboard.org/media-rss'; - - /** - * Wrong Media RSS Namespace #5. A possible typo of the RSS Advisory Board URL. - */ - public const NAMESPACE_MEDIARSS_WRONG5 = 'http://www.rssboard.org/media-rss/'; - - /** - * iTunes RSS Namespace - */ - public const NAMESPACE_ITUNES = 'http://www.itunes.com/dtds/podcast-1.0.dtd'; - - /** - * XHTML Namespace - */ - public const NAMESPACE_XHTML = 'http://www.w3.org/1999/xhtml'; - - /** - * IANA Link Relations Registry - */ - public const IANA_LINK_RELATIONS_REGISTRY = 'http://www.iana.org/assignments/relation/'; - - /** - * No file source - */ - public const FILE_SOURCE_NONE = 0; - - /** - * Remote file source - */ - public const FILE_SOURCE_REMOTE = 1; - - /** - * Local file source - */ - public const FILE_SOURCE_LOCAL = 2; - - /** - * fsockopen() file source - */ - public const FILE_SOURCE_FSOCKOPEN = 4; - - /** - * cURL file source - */ - public const FILE_SOURCE_CURL = 8; - - /** - * file_get_contents() file source - */ - public const FILE_SOURCE_FILE_GET_CONTENTS = 16; - - /** - * @internal Default value of the HTTP Accept header when fetching/locating feeds - */ - public const DEFAULT_HTTP_ACCEPT_HEADER = 'application/atom+xml, application/rss+xml, application/rdf+xml;q=0.9, application/xml;q=0.8, text/xml;q=0.8, text/html;q=0.7, unknown/unknown;q=0.1, application/unknown;q=0.1, */*;q=0.1'; - - /** - * @var array<string, mixed> Raw data - * @access private - */ - public $data = []; - - /** - * @var string|string[]|null Error string (or array when multiple feeds are initialized) - * @access private - */ - public $error = null; - - /** - * @var int HTTP status code - * @see SimplePie::status_code() - * @access private - */ - public $status_code = 0; - - /** - * @var Sanitize instance of Sanitize class - * @see SimplePie::set_sanitize_class() - * @access private - */ - public $sanitize; - - /** - * @var string SimplePie Useragent - * @see SimplePie::set_useragent() - * @access private - */ - public $useragent = ''; - - /** - * @var string Feed URL - * @see SimplePie::set_feed_url() - * @access private - */ - public $feed_url; - - /** - * @var ?string Original feed URL, or new feed URL iff HTTP 301 Moved Permanently - * @see SimplePie::subscribe_url() - * @access private - */ - public $permanent_url = null; - - /** - * @var File Instance of File class to use as a feed - * @see SimplePie::set_file() - */ - private $file; - - /** - * @var string|false Raw feed data - * @see SimplePie::set_raw_data() - * @access private - */ - public $raw_data; - - /** - * @var int Timeout for fetching remote files - * @see SimplePie::set_timeout() - * @access private - */ - public $timeout = 10; - - /** - * @var array<int, mixed> Custom curl options - * @see SimplePie::set_curl_options() - * @access private - */ - public $curl_options = []; - - /** - * @var bool Forces fsockopen() to be used for remote files instead - * of cURL, even if a new enough version is installed - * @see SimplePie::force_fsockopen() - * @access private - */ - public $force_fsockopen = false; - - /** - * @var bool Force the given data/URL to be treated as a feed no matter what - * it appears like - * @see SimplePie::force_feed() - * @access private - */ - public $force_feed = false; - - /** - * @var bool Enable/Disable Caching - * @see SimplePie::enable_cache() - * @access private - */ - private $enable_cache = true; - - /** - * @var DataCache|null - * @see SimplePie::set_cache() - */ - private $cache = null; - - /** - * @var NameFilter - * @see SimplePie::set_cache_namefilter() - */ - private $cache_namefilter; - - /** - * @var bool Force SimplePie to fallback to expired cache, if enabled, - * when feed is unavailable. - * @see SimplePie::force_cache_fallback() - * @access private - */ - public $force_cache_fallback = false; - - /** - * @var int Cache duration (in seconds) - * @see SimplePie::set_cache_duration() - * @access private - */ - public $cache_duration = 3600; - - /** - * @var int Auto-discovery cache duration (in seconds) - * @see SimplePie::set_autodiscovery_cache_duration() - * @access private - */ - public $autodiscovery_cache_duration = 604800; // 7 Days. - - /** - * @var string Cache location (relative to executing script) - * @see SimplePie::set_cache_location() - * @access private - */ - public $cache_location = './cache'; - - /** - * @var string&(callable(string): string) Function that creates the cache filename - * @see SimplePie::set_cache_name_function() - * @access private - */ - public $cache_name_function = 'md5'; - - /** - * @var bool Reorder feed by date descending - * @see SimplePie::enable_order_by_date() - * @access private - */ - public $order_by_date = true; - - /** - * @var mixed Force input encoding to be set to the follow value - * (false, or anything type-cast to false, disables this feature) - * @see SimplePie::set_input_encoding() - * @access private - */ - public $input_encoding = false; - - /** - * @var self::LOCATOR_* Feed Autodiscovery Level - * @see SimplePie::set_autodiscovery_level() - * @access private - */ - public $autodiscovery = self::LOCATOR_ALL; - - /** - * Class registry object - * - * @var Registry - */ - public $registry; - - /** - * @var int Maximum number of feeds to check with autodiscovery - * @see SimplePie::set_max_checked_feeds() - * @access private - */ - public $max_checked_feeds = 10; - - /** - * @var array<Response>|null All the feeds found during the autodiscovery process - * @see SimplePie::get_all_discovered_feeds() - * @access private - */ - public $all_discovered_feeds = []; - - /** - * @var string Web-accessible path to the handler_image.php file. - * @see SimplePie::set_image_handler() - * @access private - */ - public $image_handler = ''; - - /** - * @var array<string> Stores the URLs when multiple feeds are being initialized. - * @see SimplePie::set_feed_url() - * @access private - */ - public $multifeed_url = []; - - /** - * @var array<int, static> Stores SimplePie objects when multiple feeds initialized. - * @access private - */ - public $multifeed_objects = []; - - /** - * @var array<mixed> Stores the get_object_vars() array for use with multifeeds. - * @see SimplePie::set_feed_url() - * @access private - */ - public $config_settings = null; - - /** - * @var int Stores the number of items to return per-feed with multifeeds. - * @see SimplePie::set_item_limit() - * @access private - */ - public $item_limit = 0; - - /** - * @var bool Stores if last-modified and/or etag headers were sent with the - * request when checking a feed. - */ - public $check_modified = false; - - /** - * @var array<string> Stores the default attributes to be stripped by strip_attributes(). - * @see SimplePie::strip_attributes() - * @access private - */ - public $strip_attributes = ['bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc']; - - /** - * @var array<string, array<string, string>> Stores the default attributes to add to different tags by add_attributes(). - * @see SimplePie::add_attributes() - * @access private - */ - public $add_attributes = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]; - - /** - * @var array<string> Stores the default tags to be stripped by strip_htmltags(). - * @see SimplePie::strip_htmltags() - * @access private - */ - public $strip_htmltags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']; - - /** - * @var string[]|string Stores the default attributes to be renamed by rename_attributes(). - * @see SimplePie::rename_attributes() - * @access private - */ - public $rename_attributes = []; - - /** - * @var bool Should we throw exceptions, or use the old-style error property? - * @access private - */ - public $enable_exceptions = false; - - /** - * @var Client|null - */ - private $http_client = null; - - /** @var bool Whether HTTP client has been injected */ - private $http_client_injected = false; - - /** - * The SimplePie class contains feed level data and options - * - * To use SimplePie, create the SimplePie object with no parameters. You can - * then set configuration options using the provided methods. After setting - * them, you must initialise the feed using $feed->init(). At that point the - * object's methods and properties will be available to you. - * - * Previously, it was possible to pass in the feed URL along with cache - * options directly into the constructor. This has been removed as of 1.3 as - * it caused a lot of confusion. - * - * @since 1.0 Preview Release - */ - public function __construct() - { - if (version_compare(PHP_VERSION, '7.2', '<')) { - exit('Please upgrade to PHP 7.2 or newer.'); - } - - $this->set_useragent(); - - $this->set_cache_namefilter(new CallableNameFilter($this->cache_name_function)); - - // Other objects, instances created here so we can set options on them - $this->sanitize = new Sanitize(); - $this->registry = new Registry(); - - if (func_num_args() > 0) { - trigger_error('Passing parameters to the constructor is no longer supported. Please use set_feed_url(), set_cache_location(), and set_cache_duration() directly.', \E_USER_DEPRECATED); - - $args = func_get_args(); - switch (count($args)) { - case 3: - $this->set_cache_duration($args[2]); - // no break - case 2: - $this->set_cache_location($args[1]); - // no break - case 1: - $this->set_feed_url($args[0]); - $this->init(); - } - } - } - - /** - * Used for converting object to a string - * @return string - */ - public function __toString() - { - return md5(serialize($this->data)); - } - - /** - * Remove items that link back to this before destroying this object - * @return void - */ - public function __destruct() - { - if (!gc_enabled()) { - if (!empty($this->data['items'])) { - foreach ($this->data['items'] as $item) { - $item->__destruct(); - } - unset($item, $this->data['items']); - } - if (!empty($this->data['ordered_items'])) { - foreach ($this->data['ordered_items'] as $item) { - $item->__destruct(); - } - unset($item, $this->data['ordered_items']); - } - } - } - - /** - * Force the given data/URL to be treated as a feed - * - * This tells SimplePie to ignore the content-type provided by the server. - * Be careful when using this option, as it will also disable autodiscovery. - * - * @since 1.1 - * @param bool $enable Force the given data/URL to be treated as a feed - * @return void - */ - public function force_feed(bool $enable = false) - { - $this->force_feed = $enable; - } - - /** - * Set the URL of the feed you want to parse - * - * This allows you to enter the URL of the feed you want to parse, or the - * website you want to try to use auto-discovery on. This takes priority - * over any set raw data. - * - * Deprecated since 1.9.0: You can set multiple feeds to mash together by passing an array instead - * of a string for the $url. Remember that with each additional feed comes - * additional processing and resources. - * - * @since 1.0 Preview Release - * @see set_raw_data() - * @param string|string[] $url This is the URL (or (deprecated) array of URLs) that you want to parse. - * @return void - */ - public function set_feed_url($url) - { - $this->multifeed_url = []; - if (is_array($url)) { - trigger_error('Fetching multiple feeds with single SimplePie instance is deprecated since SimplePie 1.9.0, create one SimplePie instance per feed and use SimplePie::merge_items to get a single list of items.', \E_USER_DEPRECATED); - foreach ($url as $value) { - $this->multifeed_url[] = $this->registry->call(Misc::class, 'fix_protocol', [$value, 1]); - } - } else { - $this->feed_url = $this->registry->call(Misc::class, 'fix_protocol', [$url, 1]); - $this->permanent_url = $this->feed_url; - } - } - - /** - * Set an instance of {@see File} to use as a feed - * - * @deprecated since SimplePie 1.9.0, use \SimplePie\SimplePie::set_http_client() or \SimplePie\SimplePie::set_raw_data() instead. - * - * @param File &$file - * @return bool True on success, false on failure - */ - public function set_file(File &$file) - { - // trigger_error(sprintf('SimplePie\SimplePie::set_file() is deprecated since SimplePie 1.9.0, please use "SimplePie\SimplePie::set_http_client()" or "SimplePie\SimplePie::set_raw_data()" instead.'), \E_USER_DEPRECATED); - - $this->feed_url = $file->get_final_requested_uri(); - $this->permanent_url = $this->feed_url; - $this->file = &$file; - - return true; - } - - /** - * Set the raw XML data to parse - * - * Allows you to use a string of RSS/Atom data instead of a remote feed. - * - * If you have a feed available as a string in PHP, you can tell SimplePie - * to parse that data string instead of a remote feed. Any set feed URL - * takes precedence. - * - * @since 1.0 Beta 3 - * @param string $data RSS or Atom data as a string. - * @see set_feed_url() - * @return void - */ - public function set_raw_data(string $data) - { - $this->raw_data = $data; - } - - /** - * Set a PSR-18 client and PSR-17 factories - * - * Allows you to use your own HTTP client implementations. - * This will become required with SimplePie 2.0.0. - */ - final public function set_http_client( - ClientInterface $http_client, - RequestFactoryInterface $request_factory, - UriFactoryInterface $uri_factory - ): void { - $this->http_client = new Psr18Client($http_client, $request_factory, $uri_factory); - } - - /** - * Set the default timeout for fetching remote feeds - * - * This allows you to change the maximum time the feed's server to respond - * and send the feed back. - * - * @since 1.0 Beta 3 - * @param int $timeout The maximum number of seconds to spend waiting to retrieve a feed. - * @return void - */ - public function set_timeout(int $timeout = 10) - { - if ($this->http_client_injected) { - throw new SimplePieException(sprintf( - 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure timeout in your HTTP client instead.', - __METHOD__, - self::class - )); - } - - $this->timeout = (int) $timeout; - - // Reset a possible existing FileClient, - // so a new client with the changed value will be created - if (is_object($this->http_client) && $this->http_client instanceof FileClient) { - $this->http_client = null; - } elseif (is_object($this->http_client)) { - // Trigger notice if a PSR-18 client was set - trigger_error(sprintf( - 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure the timeout in your HTTP client instead.', - __METHOD__, - get_class($this) - ), \E_USER_NOTICE); - } - } - - /** - * Set custom curl options - * - * This allows you to change default curl options - * - * @since 1.0 Beta 3 - * @param array<int, mixed> $curl_options Curl options to add to default settings - * @return void - */ - public function set_curl_options(array $curl_options = []) - { - if ($this->http_client_injected) { - throw new SimplePieException(sprintf( - 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure custom curl options in your HTTP client instead.', - __METHOD__, - self::class - )); - } - - $this->curl_options = $curl_options; - - // Reset a possible existing FileClient, - // so a new client with the changed value will be created - if (is_object($this->http_client) && $this->http_client instanceof FileClient) { - $this->http_client = null; - } elseif (is_object($this->http_client)) { - // Trigger notice if a PSR-18 client was set - trigger_error(sprintf( - 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure the curl options in your HTTP client instead.', - __METHOD__, - get_class($this) - ), \E_USER_NOTICE); - } - } - - /** - * Force SimplePie to use fsockopen() instead of cURL - * - * @since 1.0 Beta 3 - * @param bool $enable Force fsockopen() to be used - * @return void - */ - public function force_fsockopen(bool $enable = false) - { - if ($this->http_client_injected) { - throw new SimplePieException(sprintf( - 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure fsockopen in your HTTP client instead.', - __METHOD__, - self::class - )); - } - - $this->force_fsockopen = $enable; - - // Reset a possible existing FileClient, - // so a new client with the changed value will be created - if (is_object($this->http_client) && $this->http_client instanceof FileClient) { - $this->http_client = null; - } elseif (is_object($this->http_client)) { - // Trigger notice if a PSR-18 client was set - trigger_error(sprintf( - 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure fsockopen in your HTTP client instead.', - __METHOD__, - get_class($this) - ), \E_USER_NOTICE); - } - } - - /** - * Enable/disable caching in SimplePie. - * - * This option allows you to disable caching all-together in SimplePie. - * However, disabling the cache can lead to longer load times. - * - * @since 1.0 Preview Release - * @param bool $enable Enable caching - * @return void - */ - public function enable_cache(bool $enable = true) - { - $this->enable_cache = $enable; - } - - /** - * Set a PSR-16 implementation as cache - * - * @param CacheInterface $cache The PSR-16 cache implementation - * - * @return void - */ - public function set_cache(CacheInterface $cache) - { - $this->cache = new Psr16($cache); - } - - /** - * SimplePie to continue to fall back to expired cache, if enabled, when - * feed is unavailable. - * - * This tells SimplePie to ignore any file errors and fall back to cache - * instead. This only works if caching is enabled and cached content - * still exists. - * - * @deprecated since SimplePie 1.8.0, expired cache will not be used anymore. - * - * @param bool $enable Force use of cache on fail. - * @return void - */ - public function force_cache_fallback(bool $enable = false) - { - // @trigger_error(sprintf('SimplePie\SimplePie::force_cache_fallback() is deprecated since SimplePie 1.8.0, expired cache will not be used anymore.'), \E_USER_DEPRECATED); - $this->force_cache_fallback = $enable; - } - - /** - * Set the length of time (in seconds) that the contents of a feed will be - * cached - * - * @param int $seconds The feed content cache duration - * @return void - */ - public function set_cache_duration(int $seconds = 3600) - { - $this->cache_duration = $seconds; - } - - /** - * Set the length of time (in seconds) that the autodiscovered feed URL will - * be cached - * - * @param int $seconds The autodiscovered feed URL cache duration. - * @return void - */ - public function set_autodiscovery_cache_duration(int $seconds = 604800) - { - $this->autodiscovery_cache_duration = $seconds; - } - - /** - * Set the file system location where the cached files should be stored - * - * @deprecated since SimplePie 1.8.0, use SimplePie::set_cache() instead. - * - * @param string $location The file system location. - * @return void - */ - public function set_cache_location(string $location = './cache') - { - // @trigger_error(sprintf('SimplePie\SimplePie::set_cache_location() is deprecated since SimplePie 1.8.0, please use "SimplePie\SimplePie::set_cache()" instead.'), \E_USER_DEPRECATED); - $this->cache_location = $location; - } - - /** - * Return the filename (i.e. hash, without path and without extension) of the file to cache a given URL. - * - * @param string $url The URL of the feed to be cached. - * @return string A filename (i.e. hash, without path and without extension). - */ - public function get_cache_filename(string $url) - { - // Append custom parameters to the URL to avoid cache pollution in case of multiple calls with different parameters. - $url .= $this->force_feed ? '#force_feed' : ''; - $options = []; - if ($this->timeout != 10) { - $options[CURLOPT_TIMEOUT] = $this->timeout; - } - if ($this->useragent !== Misc::get_default_useragent()) { - $options[CURLOPT_USERAGENT] = $this->useragent; - } - if (!empty($this->curl_options)) { - foreach ($this->curl_options as $k => $v) { - $options[$k] = $v; - } - } - if (!empty($options)) { - ksort($options); - $url .= '#' . urlencode(var_export($options, true)); - } - - return $this->cache_namefilter->filter($url); - } - - /** - * Set whether feed items should be sorted into reverse chronological order - * - * @param bool $enable Sort as reverse chronological order. - * @return void - */ - public function enable_order_by_date(bool $enable = true) - { - $this->order_by_date = $enable; - } - - /** - * Set the character encoding used to parse the feed - * - * This overrides the encoding reported by the feed, however it will fall - * back to the normal encoding detection if the override fails - * - * @param string|false $encoding Character encoding - * @return void - */ - public function set_input_encoding($encoding = false) - { - if ($encoding) { - $this->input_encoding = (string) $encoding; - } else { - $this->input_encoding = false; - } - } - - /** - * Set how much feed autodiscovery to do - * - * @see self::LOCATOR_NONE - * @see self::LOCATOR_AUTODISCOVERY - * @see self::LOCATOR_LOCAL_EXTENSION - * @see self::LOCATOR_LOCAL_BODY - * @see self::LOCATOR_REMOTE_EXTENSION - * @see self::LOCATOR_REMOTE_BODY - * @see self::LOCATOR_ALL - * @param self::LOCATOR_* $level Feed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator) - * @return void - */ - public function set_autodiscovery_level(int $level = self::LOCATOR_ALL) - { - $this->autodiscovery = $level; - } - - /** - * Get the class registry - * - * Use this to override SimplePie's default classes - * - * @return Registry - */ - public function &get_registry() - { - return $this->registry; - } - - /** - * Set which class SimplePie uses for caching - * - * @deprecated since SimplePie 1.3, use {@see set_cache()} instead - * - * @param class-string<Cache> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_cache_class(string $class = Cache::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::set_cache()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Cache::class, $class, true); - } - - /** - * Set which class SimplePie uses for auto-discovery - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Locator> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_locator_class(string $class = Locator::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Locator::class, $class, true); - } - - /** - * Set which class SimplePie uses for XML parsing - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Parser> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_parser_class(string $class = Parser::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Parser::class, $class, true); - } - - /** - * Set which class SimplePie uses for remote file fetching - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<File> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_file_class(string $class = File::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(File::class, $class, true); - } - - /** - * Set which class SimplePie uses for data sanitization - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Sanitize> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_sanitize_class(string $class = Sanitize::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Sanitize::class, $class, true); - } - - /** - * Set which class SimplePie uses for handling feed items - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Item> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_item_class(string $class = Item::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Item::class, $class, true); - } - - /** - * Set which class SimplePie uses for handling author data - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Author> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_author_class(string $class = Author::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Author::class, $class, true); - } - - /** - * Set which class SimplePie uses for handling category data - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Category> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_category_class(string $class = Category::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Category::class, $class, true); - } - - /** - * Set which class SimplePie uses for feed enclosures - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Enclosure> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_enclosure_class(string $class = Enclosure::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Enclosure::class, $class, true); - } - - /** - * Set which class SimplePie uses for `<media:text>` captions - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Caption> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_caption_class(string $class = Caption::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Caption::class, $class, true); - } - - /** - * Set which class SimplePie uses for `<media:copyright>` - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Copyright> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_copyright_class(string $class = Copyright::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Copyright::class, $class, true); - } - - /** - * Set which class SimplePie uses for `<media:credit>` - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Credit> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_credit_class(string $class = Credit::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Credit::class, $class, true); - } - - /** - * Set which class SimplePie uses for `<media:rating>` - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Rating> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_rating_class(string $class = Rating::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Rating::class, $class, true); - } - - /** - * Set which class SimplePie uses for `<media:restriction>` - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Restriction> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_restriction_class(string $class = Restriction::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Restriction::class, $class, true); - } - - /** - * Set which class SimplePie uses for content-type sniffing - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Sniffer> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_content_type_sniffer_class(string $class = Sniffer::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Sniffer::class, $class, true); - } - - /** - * Set which class SimplePie uses item sources - * - * @deprecated since SimplePie 1.3, use {@see get_registry()} instead - * - * @param class-string<Source> $class Name of custom class - * - * @return bool True on success, false otherwise - */ - public function set_source_class(string $class = Source::class) - { - trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.3, please use "SimplePie\SimplePie::get_registry()" instead.', __METHOD__), \E_USER_DEPRECATED); - - return $this->registry->register(Source::class, $class, true); - } - - /** - * Set the user agent string - * - * @param string $ua New user agent string. - * @return void - */ - public function set_useragent(?string $ua = null) - { - if ($this->http_client_injected) { - throw new SimplePieException(sprintf( - 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure user agent string in your HTTP client instead.', - __METHOD__, - self::class - )); - } - - if ($ua === null) { - $ua = Misc::get_default_useragent(); - } - - $this->useragent = (string) $ua; - - // Reset a possible existing FileClient, - // so a new client with the changed value will be created - if (is_object($this->http_client) && $this->http_client instanceof FileClient) { - $this->http_client = null; - } elseif (is_object($this->http_client)) { - // Trigger notice if a PSR-18 client was set - trigger_error(sprintf( - 'Using "%s()" has no effect, because you already provided a HTTP client with "%s::set_http_client()". Configure the useragent in your HTTP client instead.', - __METHOD__, - get_class($this) - ), \E_USER_NOTICE); - } - } - - /** - * Set a namefilter to modify the cache filename with - * - * @param NameFilter $filter - * - * @return void - */ - public function set_cache_namefilter(NameFilter $filter): void - { - $this->cache_namefilter = $filter; - } - - /** - * Set callback function to create cache filename with - * - * @deprecated since SimplePie 1.8.0, use {@see set_cache_namefilter()} instead - * - * @param (string&(callable(string): string))|null $function Callback function - * @return void - */ - public function set_cache_name_function(?string $function = null) - { - // trigger_error(sprintf('"%s()" is deprecated since SimplePie 1.8.0, please use "SimplePie\SimplePie::set_cache_namefilter()" instead.', __METHOD__), \E_USER_DEPRECATED); - - if ($function === null) { - $function = 'md5'; - } - - $this->cache_name_function = $function; - - $this->set_cache_namefilter(new CallableNameFilter($this->cache_name_function)); - } - - /** - * Set options to make SP as fast as possible - * - * Forgoes a substantial amount of data sanitization in favor of speed. This - * turns SimplePie into a dumb parser of feeds. - * - * @param bool $set Whether to set them or not - * @return void - */ - public function set_stupidly_fast(bool $set = false) - { - if ($set) { - $this->enable_order_by_date(false); - $this->remove_div(false); - $this->strip_comments(false); - $this->strip_htmltags([]); - $this->strip_attributes([]); - $this->add_attributes([]); - $this->set_image_handler(false); - $this->set_https_domains([]); - } - } - - /** - * Set maximum number of feeds to check with autodiscovery - * - * @param int $max Maximum number of feeds to check - * @return void - */ - public function set_max_checked_feeds(int $max = 10) - { - $this->max_checked_feeds = $max; - } - - /** - * @return void - */ - public function remove_div(bool $enable = true) - { - $this->sanitize->remove_div($enable); - } - - /** - * @param string[]|string|false $tags Set a list of tags to strip, or set empty string to use default tags, or false to strip nothing. - * @return void - */ - public function strip_htmltags($tags = '', ?bool $encode = null) - { - if ($tags === '') { - $tags = $this->strip_htmltags; - } - $this->sanitize->strip_htmltags($tags); - if ($encode !== null) { - $this->sanitize->encode_instead_of_strip($encode); - } - } - - /** - * @return void - */ - public function encode_instead_of_strip(bool $enable = true) - { - $this->sanitize->encode_instead_of_strip($enable); - } - - /** - * @param string[]|string $attribs - * @return void - */ - public function rename_attributes($attribs = '') - { - if ($attribs === '') { - $attribs = $this->rename_attributes; - } - $this->sanitize->rename_attributes($attribs); - } - - /** - * @param string[]|string $attribs - * @return void - */ - public function strip_attributes($attribs = '') - { - if ($attribs === '') { - $attribs = $this->strip_attributes; - } - $this->sanitize->strip_attributes($attribs); - } - - /** - * @param array<string, array<string, string>>|'' $attribs - * @return void - */ - public function add_attributes($attribs = '') - { - if ($attribs === '') { - $attribs = $this->add_attributes; - } - $this->sanitize->add_attributes($attribs); - } - - /** - * Set the output encoding - * - * Allows you to override SimplePie's output to match that of your webpage. - * This is useful for times when your webpages are not being served as - * UTF-8. This setting will be obeyed by {@see handle_content_type()}, and - * is similar to {@see set_input_encoding()}. - * - * It should be noted, however, that not all character encodings can support - * all characters. If your page is being served as ISO-8859-1 and you try - * to display a Japanese feed, you'll likely see garbled characters. - * Because of this, it is highly recommended to ensure that your webpages - * are served as UTF-8. - * - * The number of supported character encodings depends on whether your web - * host supports {@link http://php.net/mbstring mbstring}, - * {@link http://php.net/iconv iconv}, or both. See - * {@link http://simplepie.org/wiki/faq/Supported_Character_Encodings} for - * more information. - * - * @param string $encoding - * @return void - */ - public function set_output_encoding(string $encoding = 'UTF-8') - { - $this->sanitize->set_output_encoding($encoding); - } - - /** - * @return void - */ - public function strip_comments(bool $strip = false) - { - $this->sanitize->strip_comments($strip); - } - - /** - * Set element/attribute key/value pairs of HTML attributes - * containing URLs that need to be resolved relative to the feed - * - * Defaults to |a|@href, |area|@href, |blockquote|@cite, |del|@cite, - * |form|@action, |img|@longdesc, |img|@src, |input|@src, |ins|@cite, - * |q|@cite - * - * @since 1.0 - * @param array<string, string|string[]>|null $element_attribute Element/attribute key/value pairs, null for default - * @return void - */ - public function set_url_replacements(?array $element_attribute = null) - { - $this->sanitize->set_url_replacements($element_attribute); - } - - /** - * Set the list of domains for which to force HTTPS. - * @see Sanitize::set_https_domains() - * @param array<string> $domains List of HTTPS domains. Example array('biz', 'example.com', 'example.org', 'www.example.net'). - * @return void - */ - public function set_https_domains(array $domains = []) - { - $this->sanitize->set_https_domains($domains); - } - - /** - * Set the handler to enable the display of cached images. - * - * @param string|false $page Web-accessible path to the handler_image.php file. - * @param string $qs The query string that the value should be passed to. - * @return void - */ - public function set_image_handler($page = false, string $qs = 'i') - { - if ($page !== false) { - $this->sanitize->set_image_handler($page . '?' . $qs . '='); - } else { - $this->image_handler = ''; - } - } - - /** - * Set the limit for items returned per-feed with multifeeds - * - * @param int $limit The maximum number of items to return. - * @return void - */ - public function set_item_limit(int $limit = 0) - { - $this->item_limit = $limit; - } - - /** - * Enable throwing exceptions - * - * @param bool $enable Should we throw exceptions, or use the old-style error property? - * @return void - */ - public function enable_exceptions(bool $enable = true) - { - $this->enable_exceptions = $enable; - } - - /** - * Initialize the feed object - * - * This is what makes everything happen. Period. This is where all of the - * configuration options get processed, feeds are fetched, cached, and - * parsed, and all of that other good stuff. - * - * @return bool True if successful, false otherwise - */ - public function init() - { - // Check absolute bare minimum requirements. - if (!extension_loaded('xml') || !extension_loaded('pcre')) { - $this->error = 'XML or PCRE extensions not loaded!'; - return false; - } - // Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader. - elseif (!extension_loaded('xmlreader')) { - static $xml_is_sane = null; - if ($xml_is_sane === null) { - $parser_check = xml_parser_create(); - xml_parse_into_struct($parser_check, '<foo>&</foo>', $values); - if (\PHP_VERSION_ID < 80000) { - xml_parser_free($parser_check); - } - $xml_is_sane = isset($values[0]['value']); - } - if (!$xml_is_sane) { - return false; - } - } - - // The default sanitize class gets set in the constructor, check if it has - // changed. - if ($this->registry->get_class(Sanitize::class) !== Sanitize::class) { - $this->sanitize = $this->registry->create(Sanitize::class); - } - if (method_exists($this->sanitize, 'set_registry')) { - $this->sanitize->set_registry($this->registry); - } - - // Pass whatever was set with config options over to the sanitizer. - // Pass the classes in for legacy support; new classes should use the registry instead - $cache = $this->registry->get_class(Cache::class); - \assert($cache !== null, 'Cache must be defined'); - $this->sanitize->pass_cache_data( - $this->enable_cache, - $this->cache_location, - $this->cache_namefilter, - $cache, - $this->cache - ); - - $http_client = $this->get_http_client(); - - if ($http_client instanceof Psr18Client) { - $this->sanitize->set_http_client( - $http_client->getHttpClient(), - $http_client->getRequestFactory(), - $http_client->getUriFactory() - ); - } - - if (!empty($this->multifeed_url)) { - $i = 0; - $success = 0; - $this->multifeed_objects = []; - $this->error = []; - foreach ($this->multifeed_url as $url) { - $this->multifeed_objects[$i] = clone $this; - $this->multifeed_objects[$i]->set_feed_url($url); - $single_success = $this->multifeed_objects[$i]->init(); - $success |= $single_success; - if (!$single_success) { - $this->error[$i] = $this->multifeed_objects[$i]->error(); - } - $i++; - } - return (bool) $success; - } elseif ($this->feed_url === null && $this->raw_data === null) { - return false; - } - - $this->error = null; - $this->data = []; - $this->check_modified = false; - $this->multifeed_objects = []; - $cache = false; - - if ($this->feed_url !== null) { - $parsed_feed_url = $this->registry->call(Misc::class, 'parse_url', [$this->feed_url]); - - // Decide whether to enable caching - if ($this->enable_cache && $parsed_feed_url['scheme'] !== '') { - $cache = $this->get_cache($this->feed_url); - } - - // Fetch the data into $this->raw_data - if (($fetched = $this->fetch_data($cache)) === true) { - return true; - } elseif ($fetched === false) { - return false; - } - - [$headers, $sniffed] = $fetched; - } - - // Empty response check - if (empty($this->raw_data)) { - $this->error = "A feed could not be found at `$this->feed_url`. Empty body."; - $this->registry->call(Misc::class, 'error', [$this->error, E_USER_NOTICE, __FILE__, __LINE__]); - return false; - } - - // Set up array of possible encodings - $encodings = []; - - // First check to see if input has been overridden. - if ($this->input_encoding !== false) { - $encodings[] = strtoupper($this->input_encoding); - } - - $application_types = ['application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity']; - $text_types = ['text/xml', 'text/xml-external-parsed-entity']; - - // RFC 3023 (only applies to sniffed content) - if (isset($sniffed)) { - if (in_array($sniffed, $application_types) || substr($sniffed, 0, 12) === 'application/' && substr($sniffed, -4) === '+xml') { - if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) { - $encodings[] = strtoupper($charset[1]); - } - $encodings = array_merge($encodings, $this->registry->call(Misc::class, 'xml_encoding', [$this->raw_data, &$this->registry])); - $encodings[] = 'UTF-8'; - } elseif (in_array($sniffed, $text_types) || substr($sniffed, 0, 5) === 'text/' && substr($sniffed, -4) === '+xml') { - if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) { - $encodings[] = strtoupper($charset[1]); - } - $encodings[] = 'US-ASCII'; - } - // Text MIME-type default - elseif (substr($sniffed, 0, 5) === 'text/') { - $encodings[] = 'UTF-8'; - } - } - - // Fallback to XML 1.0 Appendix F.1/UTF-8/ISO-8859-1 - $encodings = array_merge($encodings, $this->registry->call(Misc::class, 'xml_encoding', [$this->raw_data, &$this->registry])); - $encodings[] = 'UTF-8'; - $encodings[] = 'ISO-8859-1'; - - // There's no point in trying an encoding twice - $encodings = array_unique($encodings); - - // Loop through each possible encoding, till we return something, or run out of possibilities - foreach ($encodings as $encoding) { - // Change the encoding to UTF-8 (as we always use UTF-8 internally) - if ($utf8_data = $this->registry->call(Misc::class, 'change_encoding', [$this->raw_data, $encoding, 'UTF-8'])) { - // Create new parser - $parser = $this->registry->create(Parser::class); - - // If it's parsed fine - if ($parser->parse($utf8_data, 'UTF-8', $this->permanent_url ?? '')) { - $this->data = $parser->get_data(); - if (!($this->get_type() & ~self::TYPE_NONE)) { - $this->error = "A feed could not be found at `$this->feed_url`. This does not appear to be a valid RSS or Atom feed."; - $this->registry->call(Misc::class, 'error', [$this->error, E_USER_NOTICE, __FILE__, __LINE__]); - return false; - } - - if (isset($headers)) { - $this->data['headers'] = $headers; - } - $this->data['build'] = Misc::get_build(); - - // Cache the file if caching is enabled - $this->data['cache_expiration_time'] = $this->cache_duration + time(); - - if ($cache && !$cache->set_data($this->get_cache_filename($this->feed_url), $this->data, $this->cache_duration)) { - trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); - } - return true; - } - } - } - - if (isset($parser)) { - // We have an error, just set Misc::error to it and quit - $this->error = $this->feed_url; - $this->error .= sprintf(' is invalid XML, likely due to invalid characters. XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_current_column()); - } else { - $this->error = 'The data could not be converted to UTF-8.'; - if (!extension_loaded('mbstring') && !extension_loaded('iconv') && !class_exists('\UConverter')) { - $this->error .= ' You MUST have either the iconv, mbstring or intl (PHP 5.5+) extension installed and enabled.'; - } else { - $missingExtensions = []; - if (!extension_loaded('iconv')) { - $missingExtensions[] = 'iconv'; - } - if (!extension_loaded('mbstring')) { - $missingExtensions[] = 'mbstring'; - } - if (!class_exists('\UConverter')) { - $missingExtensions[] = 'intl (PHP 5.5+)'; - } - $this->error .= ' Try installing/enabling the ' . implode(' or ', $missingExtensions) . ' extension.'; - } - } - - $this->registry->call(Misc::class, 'error', [$this->error, E_USER_NOTICE, __FILE__, __LINE__]); - - return false; - } - - /** - * Fetch the data - * - * If the data is already cached, attempt to fetch it from there instead - * - * @param Base|DataCache|false $cache Cache handler, or false to not load from the cache - * @return array{array<string, string>, string}|bool Returns true if the data was loaded from the cache, or an array of HTTP headers and sniffed type - */ - protected function fetch_data(&$cache) - { - if ($cache instanceof Base) { - // @trigger_error(sprintf('Providing $cache as "\SimplePie\Cache\Base" in %s() is deprecated since SimplePie 1.8.0, please provide "\SimplePie\Cache\DataCache" implementation instead.', __METHOD__), \E_USER_DEPRECATED); - $cache = new BaseDataCache($cache); - } - - // @phpstan-ignore-next-line Enforce PHPDoc type. - if ($cache !== false && !$cache instanceof DataCache) { - throw new InvalidArgumentException(sprintf( - '%s(): Argument #1 ($cache) must be of type %s|false', - __METHOD__, - DataCache::class - ), 1); - } - - $cacheKey = $this->get_cache_filename($this->feed_url); - - // If it's enabled, use the cache - if ($cache) { - // Load the Cache - $this->data = $cache->get_data($cacheKey, []); - - if (!empty($this->data)) { - // If the cache is for an outdated build of SimplePie - if (!isset($this->data['build']) || $this->data['build'] !== Misc::get_build()) { - $cache->delete_data($cacheKey); - $this->data = []; - } - // If we've hit a collision just rerun it with caching disabled - elseif (isset($this->data['url']) && $this->data['url'] !== $this->feed_url) { - $cache = false; - $this->data = []; - } - // If we've got a non feed_url stored (if the page isn't actually a feed, or is a redirect) use that URL. - elseif (isset($this->data['feed_url'])) { - // Do not need to do feed autodiscovery yet. - if ($this->data['feed_url'] !== $this->data['url']) { - $this->set_feed_url($this->data['feed_url']); - $this->data['url'] = $this->data['feed_url']; - - $cache->set_data($this->get_cache_filename($this->feed_url), $this->data, $this->autodiscovery_cache_duration); - - return $this->init(); - } - - $cache->delete_data($this->get_cache_filename($this->feed_url)); - $this->data = []; - } - // Check if the cache has been updated - elseif (!isset($this->data['cache_expiration_time']) || $this->data['cache_expiration_time'] < time()) { - // Want to know if we tried to send last-modified and/or etag headers - // when requesting this file. (Note that it's up to the file to - // support this, but we don't always send the headers either.) - $this->check_modified = true; - if (isset($this->data['headers']['last-modified']) || isset($this->data['headers']['etag'])) { - $headers = [ - 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER, - ]; - if (isset($this->data['headers']['last-modified'])) { - $headers['if-modified-since'] = $this->data['headers']['last-modified']; - } - if (isset($this->data['headers']['etag'])) { - $headers['if-none-match'] = $this->data['headers']['etag']; - } - - try { - $file = $this->get_http_client()->request(Client::METHOD_GET, $this->feed_url, $headers); - $this->status_code = $file->get_status_code(); - } catch (ClientException $th) { - $this->check_modified = false; - $this->status_code = 0; - - if ($this->force_cache_fallback) { - $this->data['cache_expiration_time'] = $this->cache_duration + time(); - $cache->set_data($cacheKey, $this->data, $this->cache_duration); - - return true; - } - - $failedFileReason = $th->getMessage(); - } - - if ($this->status_code === 304) { - // Set raw_data to false here too, to signify that the cache - // is still valid. - $this->raw_data = false; - $this->data['cache_expiration_time'] = $this->cache_duration + time(); - $cache->set_data($cacheKey, $this->data, $this->cache_duration); - - return true; - } - } - } - // If the cache is still valid, just return true - else { - $this->raw_data = false; - return true; - } - } - // If the cache is empty - else { - $this->data = []; - } - } - - // If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it. - if (!isset($file)) { - if ($this->file instanceof File && $this->file->get_final_requested_uri() === $this->feed_url) { - $file = &$this->file; - } elseif (isset($failedFileReason)) { - // Do not try to fetch again if we already failed once. - // If the file connection had an error, set SimplePie::error to that and quit - $this->error = $failedFileReason; - - return !empty($this->data); - } else { - $headers = [ - 'Accept' => SimplePie::DEFAULT_HTTP_ACCEPT_HEADER, - ]; - try { - $file = $this->get_http_client()->request(Client::METHOD_GET, $this->feed_url, $headers); - } catch (ClientException $th) { - // If the file connection has an error, set SimplePie::error to that and quit - $this->error = $th->getMessage(); - - return !empty($this->data); - } - } - } - $this->status_code = $file->get_status_code(); - - // If the file connection has an error, set SimplePie::error to that and quit - if (!(!Misc::is_remote_uri($file->get_final_requested_uri()) || ($file->get_status_code() === 200 || $file->get_status_code() > 206 && $file->get_status_code() < 300))) { - $this->error = 'Retrieved unsupported status code "' . $this->status_code . '"'; - return !empty($this->data); - } - - if (!$this->force_feed) { - // Check if the supplied URL is a feed, if it isn't, look for it. - $locate = $this->registry->create(Locator::class, [ - (!$file instanceof File) ? File::fromResponse($file) : $file, - $this->timeout, - $this->useragent, - $this->max_checked_feeds, - $this->force_fsockopen, - $this->curl_options - ]); - - $http_client = $this->get_http_client(); - - if ($http_client instanceof Psr18Client) { - $locate->set_http_client( - $http_client->getHttpClient(), - $http_client->getRequestFactory(), - $http_client->getUriFactory() - ); - } - - if (!$locate->is_feed($file)) { - $copyStatusCode = $file->get_status_code(); - $copyContentType = $file->get_header_line('content-type'); - try { - $microformats = false; - if (class_exists('DOMXpath') && function_exists('Mf2\parse')) { - $doc = new \DOMDocument(); - @$doc->loadHTML($file->get_body_content()); - $xpath = new \DOMXpath($doc); - // Check for both h-feed and h-entry, as both a feed with no entries - // and a list of entries without an h-feed wrapper are both valid. - $query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '. - 'contains(concat(" ", @class, " "), " h-entry ")]'; - - /** @var \DOMNodeList<\DOMElement> $result */ - $result = $xpath->query($query); - $microformats = $result->length !== 0; - } - // Now also do feed discovery, but if microformats were found don't - // overwrite the current value of file. - $discovered = $locate->find( - $this->autodiscovery, - $this->all_discovered_feeds - ); - if ($microformats) { - $hub = $locate->get_rel_link('hub'); - $self = $locate->get_rel_link('self'); - if ($hub || $self) { - $file = $this->store_links($file, $hub, $self); - } - // Push the current file onto all_discovered feeds so the user can - // be shown this as one of the options. - if ($this->all_discovered_feeds !== null) { - $this->all_discovered_feeds[] = $file; - } - } else { - if ($discovered) { - $file = $discovered; - } else { - // We need to unset this so that if SimplePie::set_file() has - // been called that object is untouched - unset($file); - $this->error = "A feed could not be found at `$this->feed_url`; the status code is `$copyStatusCode` and content-type is `$copyContentType`"; - $this->registry->call(Misc::class, 'error', [$this->error, E_USER_NOTICE, __FILE__, __LINE__]); - return false; - } - } - } catch (SimplePieException $e) { - // We need to unset this so that if SimplePie::set_file() has been called that object is untouched - unset($file); - // This is usually because DOMDocument doesn't exist - $this->error = $e->getMessage(); - $this->registry->call(Misc::class, 'error', [$this->error, E_USER_NOTICE, $e->getFile(), $e->getLine()]); - return false; - } - - if ($cache) { - $this->data = [ - 'url' => $this->feed_url, - 'feed_url' => $file->get_final_requested_uri(), - 'build' => Misc::get_build(), - 'cache_expiration_time' => $this->cache_duration + time(), - ]; - - if (!$cache->set_data($cacheKey, $this->data, $this->cache_duration)) { - trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); - } - } - } - $this->feed_url = $file->get_final_requested_uri(); - $locate = null; - } - - $this->raw_data = $file->get_body_content(); - $this->permanent_url = $file->get_permanent_uri(); - - $headers = []; - foreach ($file->get_headers() as $key => $values) { - $headers[$key] = implode(', ', $values); - } - - $sniffer = $this->registry->create(Sniffer::class, [&$file]); - $sniffed = $sniffer->get_type(); - - return [$headers, $sniffed]; - } - - /** - * Get the error message for the occurred error - * - * @return string|string[]|null Error message, or array of messages for multifeeds - */ - public function error() - { - return $this->error; - } - - /** - * Get the last HTTP status code - * - * @return int Status code - */ - public function status_code() - { - return $this->status_code; - } - - /** - * Get the raw XML - * - * This is the same as the old `$feed->enable_xml_dump(true)`, but returns - * the data instead of printing it. - * - * @return string|false Raw XML data, false if the cache is used - */ - public function get_raw_data() - { - return $this->raw_data; - } - - /** - * Get the character encoding used for output - * - * @since Preview Release - * @return string - */ - public function get_encoding() - { - return $this->sanitize->output_encoding; - } - - /** - * Send the content-type header with correct encoding - * - * This method ensures that the SimplePie-enabled page is being served with - * the correct {@link http://www.iana.org/assignments/media-types/ mime-type} - * and character encoding HTTP headers (character encoding determined by the - * {@see set_output_encoding} config option). - * - * This won't work properly if any content or whitespace has already been - * sent to the browser, because it relies on PHP's - * {@link http://php.net/header header()} function, and these are the - * circumstances under which the function works. - * - * Because it's setting these settings for the entire page (as is the nature - * of HTTP headers), this should only be used once per page (again, at the - * top). - * - * @param string $mime MIME type to serve the page as - * @return void - */ - public function handle_content_type(string $mime = 'text/html') - { - if (!headers_sent()) { - $header = "Content-type: $mime;"; - if ($this->get_encoding()) { - $header .= ' charset=' . $this->get_encoding(); - } else { - $header .= ' charset=UTF-8'; - } - header($header); - } - } - - /** - * Get the type of the feed - * - * This returns a self::TYPE_* constant, which can be tested against - * using {@link http://php.net/language.operators.bitwise bitwise operators} - * - * @since 0.8 (usage changed to using constants in 1.0) - * @see self::TYPE_NONE Unknown. - * @see self::TYPE_RSS_090 RSS 0.90. - * @see self::TYPE_RSS_091_NETSCAPE RSS 0.91 (Netscape). - * @see self::TYPE_RSS_091_USERLAND RSS 0.91 (Userland). - * @see self::TYPE_RSS_091 RSS 0.91. - * @see self::TYPE_RSS_092 RSS 0.92. - * @see self::TYPE_RSS_093 RSS 0.93. - * @see self::TYPE_RSS_094 RSS 0.94. - * @see self::TYPE_RSS_10 RSS 1.0. - * @see self::TYPE_RSS_20 RSS 2.0.x. - * @see self::TYPE_RSS_RDF RDF-based RSS. - * @see self::TYPE_RSS_SYNDICATION Non-RDF-based RSS (truly intended as syndication format). - * @see self::TYPE_RSS_ALL Any version of RSS. - * @see self::TYPE_ATOM_03 Atom 0.3. - * @see self::TYPE_ATOM_10 Atom 1.0. - * @see self::TYPE_ATOM_ALL Any version of Atom. - * @see self::TYPE_ALL Any known/supported feed type. - * @return int-mask-of<self::TYPE_*> constant - */ - public function get_type() - { - if (!isset($this->data['type'])) { - $this->data['type'] = self::TYPE_ALL; - if (isset($this->data['child'][self::NAMESPACE_ATOM_10]['feed'])) { - $this->data['type'] &= self::TYPE_ATOM_10; - } elseif (isset($this->data['child'][self::NAMESPACE_ATOM_03]['feed'])) { - $this->data['type'] &= self::TYPE_ATOM_03; - } elseif (isset($this->data['child'][self::NAMESPACE_RDF]['RDF'])) { - if (isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][self::NAMESPACE_RSS_10]['channel']) - || isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][self::NAMESPACE_RSS_10]['image']) - || isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][self::NAMESPACE_RSS_10]['item']) - || isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][self::NAMESPACE_RSS_10]['textinput'])) { - $this->data['type'] &= self::TYPE_RSS_10; - } - if (isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][self::NAMESPACE_RSS_090]['channel']) - || isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][self::NAMESPACE_RSS_090]['image']) - || isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][self::NAMESPACE_RSS_090]['item']) - || isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][self::NAMESPACE_RSS_090]['textinput'])) { - $this->data['type'] &= self::TYPE_RSS_090; - } - } elseif (isset($this->data['child'][self::NAMESPACE_RSS_20]['rss'])) { - $this->data['type'] &= self::TYPE_RSS_ALL; - if (isset($this->data['child'][self::NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version'])) { - switch (trim($this->data['child'][self::NAMESPACE_RSS_20]['rss'][0]['attribs']['']['version'])) { - case '0.91': - $this->data['type'] &= self::TYPE_RSS_091; - if (isset($this->data['child'][self::NAMESPACE_RSS_20]['rss'][0]['child'][self::NAMESPACE_RSS_20]['skiphours']['hour'][0]['data'])) { - switch (trim($this->data['child'][self::NAMESPACE_RSS_20]['rss'][0]['child'][self::NAMESPACE_RSS_20]['skiphours']['hour'][0]['data'])) { - case '0': - $this->data['type'] &= self::TYPE_RSS_091_NETSCAPE; - break; - - case '24': - $this->data['type'] &= self::TYPE_RSS_091_USERLAND; - break; - } - } - break; - - case '0.92': - $this->data['type'] &= self::TYPE_RSS_092; - break; - - case '0.93': - $this->data['type'] &= self::TYPE_RSS_093; - break; - - case '0.94': - $this->data['type'] &= self::TYPE_RSS_094; - break; - - case '2.0': - $this->data['type'] &= self::TYPE_RSS_20; - break; - } - } - } else { - $this->data['type'] = self::TYPE_NONE; - } - } - return $this->data['type']; - } - - /** - * Get the URL for the feed - * - * When the 'permanent' mode is enabled, returns the original feed URL, - * except in the case of an `HTTP 301 Moved Permanently` status response, - * in which case the location of the first redirection is returned. - * - * When the 'permanent' mode is disabled (default), - * may or may not be different from the URL passed to {@see set_feed_url()}, - * depending on whether auto-discovery was used, and whether there were - * any redirects along the way. - * - * @since Preview Release (previously called `get_feed_url()` since SimplePie 0.8.) - * @todo Support <itunes:new-feed-url> - * @todo Also, |atom:link|@rel=self - * @param bool $permanent Permanent mode to return only the original URL or the first redirection - * iff it is a 301 redirection - * @return string|null - */ - public function subscribe_url(bool $permanent = false) - { - if ($permanent) { - if ($this->permanent_url !== null) { - // sanitize encodes ampersands which are required when used in a url. - return str_replace( - '&', - '&', - $this->sanitize( - $this->permanent_url, - self::CONSTRUCT_IRI - ) - ); - } - } else { - if ($this->feed_url !== null) { - return str_replace( - '&', - '&', - $this->sanitize( - $this->feed_url, - self::CONSTRUCT_IRI - ) - ); - } - } - return null; - } - - /** - * Get data for an feed-level element - * - * This method allows you to get access to ANY element/attribute that is a - * sub-element of the opening feed tag. - * - * The return value is an indexed array of elements matching the given - * namespace and tag name. Each element has `attribs`, `data` and `child` - * subkeys. For `attribs` and `child`, these contain namespace subkeys. - * `attribs` then has one level of associative name => value data (where - * `value` is a string) after the namespace. `child` has tag-indexed keys - * after the namespace, each member of which is an indexed array matching - * this same format. - * - * For example: - * <pre> - * // This is probably a bad example because we already support - * // <media:content> natively, but it shows you how to parse through - * // the nodes. - * $group = $item->get_item_tags(\SimplePie\SimplePie::NAMESPACE_MEDIARSS, 'group'); - * $content = $group[0]['child'][\SimplePie\SimplePie::NAMESPACE_MEDIARSS]['content']; - * $file = $content[0]['attribs']['']['url']; - * echo $file; - * </pre> - * - * @since 1.0 - * @see http://simplepie.org/wiki/faq/supported_xml_namespaces - * @param string $namespace The URL of the XML namespace of the elements you're trying to access - * @param string $tag Tag name - * @return array<array<string, mixed>>|null - */ - public function get_feed_tags(string $namespace, string $tag) - { - $type = $this->get_type(); - if ($type & self::TYPE_ATOM_10) { - if (isset($this->data['child'][self::NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag])) { - return $this->data['child'][self::NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag]; - } - } - if ($type & self::TYPE_ATOM_03) { - if (isset($this->data['child'][self::NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag])) { - return $this->data['child'][self::NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag]; - } - } - if ($type & self::TYPE_RSS_RDF) { - if (isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag])) { - return $this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag]; - } - } - if ($type & self::TYPE_RSS_SYNDICATION) { - if (isset($this->data['child'][self::NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag])) { - return $this->data['child'][self::NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]; - } - } - return null; - } - - /** - * Get data for an channel-level element - * - * This method allows you to get access to ANY element/attribute in the - * channel/header section of the feed. - * - * See {@see SimplePie::get_feed_tags()} for a description of the return value - * - * @since 1.0 - * @see http://simplepie.org/wiki/faq/supported_xml_namespaces - * @param string $namespace The URL of the XML namespace of the elements you're trying to access - * @param string $tag Tag name - * @return array<array<string, mixed>>|null - */ - public function get_channel_tags(string $namespace, string $tag) - { - $type = $this->get_type(); - if ($type & self::TYPE_ATOM_ALL) { - if ($return = $this->get_feed_tags($namespace, $tag)) { - return $return; - } - } - if ($type & self::TYPE_RSS_10) { - if ($channel = $this->get_feed_tags(self::NAMESPACE_RSS_10, 'channel')) { - if (isset($channel[0]['child'][$namespace][$tag])) { - return $channel[0]['child'][$namespace][$tag]; - } - } - } - if ($type & self::TYPE_RSS_090) { - if ($channel = $this->get_feed_tags(self::NAMESPACE_RSS_090, 'channel')) { - if (isset($channel[0]['child'][$namespace][$tag])) { - return $channel[0]['child'][$namespace][$tag]; - } - } - } - if ($type & self::TYPE_RSS_SYNDICATION) { - if ($channel = $this->get_feed_tags(self::NAMESPACE_RSS_20, 'channel')) { - if (isset($channel[0]['child'][$namespace][$tag])) { - return $channel[0]['child'][$namespace][$tag]; - } - } - } - return null; - } - - /** - * Get data for an channel-level element - * - * This method allows you to get access to ANY element/attribute in the - * image/logo section of the feed. - * - * See {@see SimplePie::get_feed_tags()} for a description of the return value - * - * @since 1.0 - * @see http://simplepie.org/wiki/faq/supported_xml_namespaces - * @param string $namespace The URL of the XML namespace of the elements you're trying to access - * @param string $tag Tag name - * @return array<array<string, mixed>>|null - */ - public function get_image_tags(string $namespace, string $tag) - { - $type = $this->get_type(); - if ($type & self::TYPE_RSS_10) { - if ($image = $this->get_feed_tags(self::NAMESPACE_RSS_10, 'image')) { - if (isset($image[0]['child'][$namespace][$tag])) { - return $image[0]['child'][$namespace][$tag]; - } - } - } - if ($type & self::TYPE_RSS_090) { - if ($image = $this->get_feed_tags(self::NAMESPACE_RSS_090, 'image')) { - if (isset($image[0]['child'][$namespace][$tag])) { - return $image[0]['child'][$namespace][$tag]; - } - } - } - if ($type & self::TYPE_RSS_SYNDICATION) { - if ($image = $this->get_channel_tags(self::NAMESPACE_RSS_20, 'image')) { - if (isset($image[0]['child'][$namespace][$tag])) { - return $image[0]['child'][$namespace][$tag]; - } - } - } - return null; - } - - /** - * Get the base URL value from the feed - * - * Uses `<xml:base>` if available, - * otherwise uses the first 'self' link or the first 'alternate' link of the feed, - * or failing that, the URL of the feed itself. - * - * @see get_link - * @see subscribe_url - * - * @param array<string, mixed> $element - * @return string - */ - public function get_base(array $element = []) - { - if (!empty($element['xml_base_explicit']) && isset($element['xml_base'])) { - return $element['xml_base']; - } - if (($link = $this->get_link(0, 'alternate')) !== null) { - return $link; - } - if (($link = $this->get_link(0, 'self')) !== null) { - return $link; - } - - return $this->subscribe_url() ?? ''; - } - - /** - * Sanitize feed data - * - * @access private - * @see Sanitize::sanitize() - * @param string $data Data to sanitize - * @param int-mask-of<SimplePie::CONSTRUCT_*> $type - * @param string $base Base URL to resolve URLs against - * @return string Sanitized data - */ - public function sanitize(string $data, int $type, string $base = '') - { - try { - // This really returns string|false but changing encoding is uncommon and we are going to deprecate it, so let’s just lie to PHPStan in the interest of cleaner annotations. - return $this->sanitize->sanitize($data, $type, $base); - } catch (SimplePieException $e) { - if (!$this->enable_exceptions) { - $this->error = $e->getMessage(); - $this->registry->call(Misc::class, 'error', [$this->error, E_USER_WARNING, $e->getFile(), $e->getLine()]); - return ''; - } - - throw $e; - } - } - - /** - * Get the title of the feed - * - * Uses `<atom:title>`, `<title>` or `<dc:title>` - * - * @since 1.0 (previously called `get_feed_title` since 0.8) - * @return string|null - */ - public function get_title() - { - if ($return = $this->get_channel_tags(self::NAMESPACE_ATOM_10, 'title')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_ATOM_03, 'title')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_RSS_10, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_RSS_090, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_RSS_20, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_DC_11, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_DC_10, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } - - return null; - } - - /** - * Get a category for the feed - * - * @since Unknown - * @param int $key The category that you want to return. Remember that arrays begin with 0, not 1 - * @return Category|null - */ - public function get_category(int $key = 0) - { - $categories = $this->get_categories(); - if (isset($categories[$key])) { - return $categories[$key]; - } - - return null; - } - - /** - * Get all categories for the feed - * - * Uses `<atom:category>`, `<category>` or `<dc:subject>` - * - * @since Unknown - * @return array<Category>|null List of {@see Category} objects - */ - public function get_categories() - { - $categories = []; - - foreach ((array) $this->get_channel_tags(self::NAMESPACE_ATOM_10, 'category') as $category) { - $term = null; - $scheme = null; - $label = null; - if (isset($category['attribs']['']['term'])) { - $term = $this->sanitize($category['attribs']['']['term'], self::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['scheme'])) { - $scheme = $this->sanitize($category['attribs']['']['scheme'], self::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['label'])) { - $label = $this->sanitize($category['attribs']['']['label'], self::CONSTRUCT_TEXT); - } - $categories[] = $this->registry->create(Category::class, [$term, $scheme, $label]); - } - foreach ((array) $this->get_channel_tags(self::NAMESPACE_RSS_20, 'category') as $category) { - // This is really the label, but keep this as the term also for BC. - // Label will also work on retrieving because that falls back to term. - $term = $this->sanitize($category['data'], self::CONSTRUCT_TEXT); - if (isset($category['attribs']['']['domain'])) { - $scheme = $this->sanitize($category['attribs']['']['domain'], self::CONSTRUCT_TEXT); - } else { - $scheme = null; - } - $categories[] = $this->registry->create(Category::class, [$term, $scheme, null]); - } - foreach ((array) $this->get_channel_tags(self::NAMESPACE_DC_11, 'subject') as $category) { - $categories[] = $this->registry->create(Category::class, [$this->sanitize($category['data'], self::CONSTRUCT_TEXT), null, null]); - } - foreach ((array) $this->get_channel_tags(self::NAMESPACE_DC_10, 'subject') as $category) { - $categories[] = $this->registry->create(Category::class, [$this->sanitize($category['data'], self::CONSTRUCT_TEXT), null, null]); - } - - if (!empty($categories)) { - return array_unique($categories); - } - - return null; - } - - /** - * Get an author for the feed - * - * @since 1.1 - * @param int $key The author that you want to return. Remember that arrays begin with 0, not 1 - * @return Author|null - */ - public function get_author(int $key = 0) - { - $authors = $this->get_authors(); - if (isset($authors[$key])) { - return $authors[$key]; - } - - return null; - } - - /** - * Get all authors for the feed - * - * Uses `<atom:author>`, `<author>`, `<dc:creator>` or `<itunes:author>` - * - * @since 1.1 - * @return array<Author>|null List of {@see Author} objects - */ - public function get_authors() - { - $authors = []; - foreach ((array) $this->get_channel_tags(self::NAMESPACE_ATOM_10, 'author') as $author) { - $name = null; - $uri = null; - $email = null; - if (isset($author['child'][self::NAMESPACE_ATOM_10]['name'][0]['data'])) { - $name = $this->sanitize($author['child'][self::NAMESPACE_ATOM_10]['name'][0]['data'], self::CONSTRUCT_TEXT); - } - if (isset($author['child'][self::NAMESPACE_ATOM_10]['uri'][0]['data'])) { - $uri = $author['child'][self::NAMESPACE_ATOM_10]['uri'][0]; - $uri = $this->sanitize($uri['data'], self::CONSTRUCT_IRI, $this->get_base($uri)); - } - if (isset($author['child'][self::NAMESPACE_ATOM_10]['email'][0]['data'])) { - $email = $this->sanitize($author['child'][self::NAMESPACE_ATOM_10]['email'][0]['data'], self::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $uri !== null) { - $authors[] = $this->registry->create(Author::class, [$name, $uri, $email]); - } - } - if ($author = $this->get_channel_tags(self::NAMESPACE_ATOM_03, 'author')) { - $name = null; - $url = null; - $email = null; - if (isset($author[0]['child'][self::NAMESPACE_ATOM_03]['name'][0]['data'])) { - $name = $this->sanitize($author[0]['child'][self::NAMESPACE_ATOM_03]['name'][0]['data'], self::CONSTRUCT_TEXT); - } - if (isset($author[0]['child'][self::NAMESPACE_ATOM_03]['url'][0]['data'])) { - $url = $author[0]['child'][self::NAMESPACE_ATOM_03]['url'][0]; - $url = $this->sanitize($url['data'], self::CONSTRUCT_IRI, $this->get_base($url)); - } - if (isset($author[0]['child'][self::NAMESPACE_ATOM_03]['email'][0]['data'])) { - $email = $this->sanitize($author[0]['child'][self::NAMESPACE_ATOM_03]['email'][0]['data'], self::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $url !== null) { - $authors[] = $this->registry->create(Author::class, [$name, $url, $email]); - } - } - foreach ((array) $this->get_channel_tags(self::NAMESPACE_DC_11, 'creator') as $author) { - $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], self::CONSTRUCT_TEXT), null, null]); - } - foreach ((array) $this->get_channel_tags(self::NAMESPACE_DC_10, 'creator') as $author) { - $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], self::CONSTRUCT_TEXT), null, null]); - } - foreach ((array) $this->get_channel_tags(self::NAMESPACE_ITUNES, 'author') as $author) { - $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], self::CONSTRUCT_TEXT), null, null]); - } - - if (!empty($authors)) { - return array_unique($authors); - } - - return null; - } - - /** - * Get a contributor for the feed - * - * @since 1.1 - * @param int $key The contrbutor that you want to return. Remember that arrays begin with 0, not 1 - * @return Author|null - */ - public function get_contributor(int $key = 0) - { - $contributors = $this->get_contributors(); - if (isset($contributors[$key])) { - return $contributors[$key]; - } - - return null; - } - - /** - * Get all contributors for the feed - * - * Uses `<atom:contributor>` - * - * @since 1.1 - * @return array<Author>|null List of {@see Author} objects - */ - public function get_contributors() - { - $contributors = []; - foreach ((array) $this->get_channel_tags(self::NAMESPACE_ATOM_10, 'contributor') as $contributor) { - $name = null; - $uri = null; - $email = null; - if (isset($contributor['child'][self::NAMESPACE_ATOM_10]['name'][0]['data'])) { - $name = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_10]['name'][0]['data'], self::CONSTRUCT_TEXT); - } - if (isset($contributor['child'][self::NAMESPACE_ATOM_10]['uri'][0]['data'])) { - $uri = $contributor['child'][self::NAMESPACE_ATOM_10]['uri'][0]; - $uri = $this->sanitize($uri['data'], self::CONSTRUCT_IRI, $this->get_base($uri)); - } - if (isset($contributor['child'][self::NAMESPACE_ATOM_10]['email'][0]['data'])) { - $email = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_10]['email'][0]['data'], self::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $uri !== null) { - $contributors[] = $this->registry->create(Author::class, [$name, $uri, $email]); - } - } - foreach ((array) $this->get_channel_tags(self::NAMESPACE_ATOM_03, 'contributor') as $contributor) { - $name = null; - $url = null; - $email = null; - if (isset($contributor['child'][self::NAMESPACE_ATOM_03]['name'][0]['data'])) { - $name = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_03]['name'][0]['data'], self::CONSTRUCT_TEXT); - } - if (isset($contributor['child'][self::NAMESPACE_ATOM_03]['url'][0]['data'])) { - $url = $contributor['child'][self::NAMESPACE_ATOM_03]['url'][0]; - $url = $this->sanitize($url['data'], self::CONSTRUCT_IRI, $this->get_base($url)); - } - if (isset($contributor['child'][self::NAMESPACE_ATOM_03]['email'][0]['data'])) { - $email = $this->sanitize($contributor['child'][self::NAMESPACE_ATOM_03]['email'][0]['data'], self::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $url !== null) { - $contributors[] = $this->registry->create(Author::class, [$name, $url, $email]); - } - } - - if (!empty($contributors)) { - return array_unique($contributors); - } - - return null; - } - - /** - * Get a single link for the feed - * - * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8) - * @param int $key The link that you want to return. Remember that arrays begin with 0, not 1 - * @param string $rel The relationship of the link to return - * @return string|null Link URL - */ - public function get_link(int $key = 0, string $rel = 'alternate') - { - $links = $this->get_links($rel); - if (isset($links[$key])) { - return $links[$key]; - } - - return null; - } - - /** - * Get the permalink for the item - * - * Returns the first link available with a relationship of "alternate". - * Identical to {@see get_link()} with key 0 - * - * @see get_link - * @since 1.0 (previously called `get_feed_link` since Preview Release, `get_feed_permalink()` since 0.8) - * @internal Added for parity between the parent-level and the item/entry-level. - * @return string|null Link URL - */ - public function get_permalink() - { - return $this->get_link(0); - } - - /** - * Get all links for the feed - * - * Uses `<atom:link>` or `<link>` - * - * @since Beta 2 - * @param string $rel The relationship of links to return - * @return array<string>|null Links found for the feed (strings) - */ - public function get_links(string $rel = 'alternate') - { - if (!isset($this->data['links'])) { - $this->data['links'] = []; - if ($links = $this->get_channel_tags(self::NAMESPACE_ATOM_10, 'link')) { - foreach ($links as $link) { - if (isset($link['attribs']['']['href'])) { - $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; - $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], self::CONSTRUCT_IRI, $this->get_base($link)); - } - } - } - if ($links = $this->get_channel_tags(self::NAMESPACE_ATOM_03, 'link')) { - foreach ($links as $link) { - if (isset($link['attribs']['']['href'])) { - $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; - $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], self::CONSTRUCT_IRI, $this->get_base($link)); - } - } - } - if ($links = $this->get_channel_tags(self::NAMESPACE_RSS_10, 'link')) { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], self::CONSTRUCT_IRI, $this->get_base($links[0])); - } - if ($links = $this->get_channel_tags(self::NAMESPACE_RSS_090, 'link')) { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], self::CONSTRUCT_IRI, $this->get_base($links[0])); - } - if ($links = $this->get_channel_tags(self::NAMESPACE_RSS_20, 'link')) { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], self::CONSTRUCT_IRI, $this->get_base($links[0])); - } - - $keys = array_keys($this->data['links']); - foreach ($keys as $key) { - if ($this->registry->call(Misc::class, 'is_isegment_nz_nc', [$key])) { - if (isset($this->data['links'][self::IANA_LINK_RELATIONS_REGISTRY . $key])) { - $this->data['links'][self::IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][self::IANA_LINK_RELATIONS_REGISTRY . $key]); - $this->data['links'][$key] = &$this->data['links'][self::IANA_LINK_RELATIONS_REGISTRY . $key]; - } else { - $this->data['links'][self::IANA_LINK_RELATIONS_REGISTRY . $key] = &$this->data['links'][$key]; - } - } elseif (substr($key, 0, 41) === self::IANA_LINK_RELATIONS_REGISTRY) { - $this->data['links'][substr($key, 41)] = &$this->data['links'][$key]; - } - $this->data['links'][$key] = array_unique($this->data['links'][$key]); - } - } - - if (isset($this->data['headers']['link'])) { - $link_headers = $this->data['headers']['link']; - if (is_array($link_headers)) { - $link_headers = implode(',', $link_headers); - } - // https://datatracker.ietf.org/doc/html/rfc8288 - if (is_string($link_headers) && - preg_match_all('/<(?P<uri>[^>]+)>\s*;\s*rel\s*=\s*(?P<quote>"?)' . preg_quote($rel) . '(?P=quote)\s*(?=,|$)/i', $link_headers, $matches)) { - return $matches['uri']; - } - } - - if (isset($this->data['links'][$rel])) { - return $this->data['links'][$rel]; - } - - return null; - } - - /** - * @return ?array<Response> - */ - public function get_all_discovered_feeds() - { - return $this->all_discovered_feeds; - } - - /** - * Get the content for the item - * - * Uses `<atom:subtitle>`, `<atom:tagline>`, `<description>`, - * `<dc:description>`, `<itunes:summary>` or `<itunes:subtitle>` - * - * @since 1.0 (previously called `get_feed_description()` since 0.8) - * @return string|null - */ - public function get_description() - { - if ($return = $this->get_channel_tags(self::NAMESPACE_ATOM_10, 'subtitle')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_ATOM_03, 'tagline')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_RSS_10, 'description')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_RSS_090, 'description')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_RSS_20, 'description')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_DC_11, 'description')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_DC_10, 'description')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_ITUNES, 'summary')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_ITUNES, 'subtitle')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_HTML, $this->get_base($return[0])); - } - - return null; - } - - /** - * Get the copyright info for the feed - * - * Uses `<atom:rights>`, `<atom:copyright>` or `<dc:rights>` - * - * @since 1.0 (previously called `get_feed_copyright()` since 0.8) - * @return string|null - */ - public function get_copyright() - { - if ($return = $this->get_channel_tags(self::NAMESPACE_ATOM_10, 'rights')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_ATOM_03, 'copyright')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_RSS_20, 'copyright')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_DC_11, 'rights')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_DC_10, 'rights')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } - - return null; - } - - /** - * Get the language for the feed - * - * Uses `<language>`, `<dc:language>`, or @xml_lang - * - * @since 1.0 (previously called `get_feed_language()` since 0.8) - * @return string|null - */ - public function get_language() - { - if ($return = $this->get_channel_tags(self::NAMESPACE_RSS_20, 'language')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_DC_11, 'language')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_DC_10, 'language')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif (isset($this->data['child'][self::NAMESPACE_ATOM_10]['feed'][0]['xml_lang'])) { - return $this->sanitize($this->data['child'][self::NAMESPACE_ATOM_10]['feed'][0]['xml_lang'], self::CONSTRUCT_TEXT); - } elseif (isset($this->data['child'][self::NAMESPACE_ATOM_03]['feed'][0]['xml_lang'])) { - return $this->sanitize($this->data['child'][self::NAMESPACE_ATOM_03]['feed'][0]['xml_lang'], self::CONSTRUCT_TEXT); - } elseif (isset($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['xml_lang'])) { - return $this->sanitize($this->data['child'][self::NAMESPACE_RDF]['RDF'][0]['xml_lang'], self::CONSTRUCT_TEXT); - } elseif (isset($this->data['headers']['content-language'])) { - return $this->sanitize($this->data['headers']['content-language'], self::CONSTRUCT_TEXT); - } - - return null; - } - - /** - * Get the latitude coordinates for the item - * - * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications - * - * Uses `<geo:lat>` or `<georss:point>` - * - * @since 1.0 - * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo - * @link http://www.georss.org/ GeoRSS - * @return float|null - */ - public function get_latitude() - { - if ($return = $this->get_channel_tags(self::NAMESPACE_W3C_BASIC_GEO, 'lat')) { - return (float) $return[0]['data']; - } elseif (($return = $this->get_channel_tags(self::NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { - return (float) $match[1]; - } - - return null; - } - - /** - * Get the longitude coordinates for the feed - * - * Compatible with the W3C WGS84 Basic Geo and GeoRSS specifications - * - * Uses `<geo:long>`, `<geo:lon>` or `<georss:point>` - * - * @since 1.0 - * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo - * @link http://www.georss.org/ GeoRSS - * @return float|null - */ - public function get_longitude() - { - if ($return = $this->get_channel_tags(self::NAMESPACE_W3C_BASIC_GEO, 'long')) { - return (float) $return[0]['data']; - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_W3C_BASIC_GEO, 'lon')) { - return (float) $return[0]['data']; - } elseif (($return = $this->get_channel_tags(self::NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { - return (float) $match[2]; - } - - return null; - } - - /** - * Get the feed logo's title - * - * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" title. - * - * Uses `<image><title>` or `<image><dc:title>` - * - * @return string|null - */ - public function get_image_title() - { - if ($return = $this->get_image_tags(self::NAMESPACE_RSS_10, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_image_tags(self::NAMESPACE_RSS_090, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_image_tags(self::NAMESPACE_RSS_20, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_image_tags(self::NAMESPACE_DC_11, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } elseif ($return = $this->get_image_tags(self::NAMESPACE_DC_10, 'title')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_TEXT); - } - - return null; - } - - /** - * Get the feed logo's URL - * - * RSS 0.9.0, 2.0, Atom 1.0, and feeds with iTunes RSS tags are allowed to - * have a "feed logo" URL. This points directly to the image itself. - * - * Uses `<itunes:image>`, `<atom:logo>`, `<atom:icon>`, - * `<image><title>` or `<image><dc:title>` - * - * @return string|null - */ - public function get_image_url() - { - if ($return = $this->get_channel_tags(self::NAMESPACE_ITUNES, 'image')) { - return $this->sanitize($return[0]['attribs']['']['href'], self::CONSTRUCT_IRI); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_ATOM_10, 'logo')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_IRI, $this->get_base($return[0])); - } elseif ($return = $this->get_channel_tags(self::NAMESPACE_ATOM_10, 'icon')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_IRI, $this->get_base($return[0])); - } elseif ($return = $this->get_image_tags(self::NAMESPACE_RSS_10, 'url')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_IRI, $this->get_base($return[0])); - } elseif ($return = $this->get_image_tags(self::NAMESPACE_RSS_090, 'url')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_IRI, $this->get_base($return[0])); - } elseif ($return = $this->get_image_tags(self::NAMESPACE_RSS_20, 'url')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_IRI, $this->get_base($return[0])); - } - - return null; - } - - - /** - * Get the feed logo's link - * - * RSS 0.9.0, 1.0 and 2.0 feeds are allowed to have a "feed logo" link. This - * points to a human-readable page that the image should link to. - * - * Uses `<itunes:image>`, `<atom:logo>`, `<atom:icon>`, - * `<image><title>` or `<image><dc:title>` - * - * @return string|null - */ - public function get_image_link() - { - if ($return = $this->get_image_tags(self::NAMESPACE_RSS_10, 'link')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_IRI, $this->get_base($return[0])); - } elseif ($return = $this->get_image_tags(self::NAMESPACE_RSS_090, 'link')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_IRI, $this->get_base($return[0])); - } elseif ($return = $this->get_image_tags(self::NAMESPACE_RSS_20, 'link')) { - return $this->sanitize($return[0]['data'], self::CONSTRUCT_IRI, $this->get_base($return[0])); - } - - return null; - } - - /** - * Get the feed logo's link - * - * RSS 2.0 feeds are allowed to have a "feed logo" width. - * - * Uses `<image><width>` or defaults to 88 if no width is specified and - * the feed is an RSS 2.0 feed. - * - * @return int|null - */ - public function get_image_width() - { - if ($return = $this->get_image_tags(self::NAMESPACE_RSS_20, 'width')) { - return intval($return[0]['data']); - } elseif ($this->get_type() & self::TYPE_RSS_SYNDICATION && $this->get_image_tags(self::NAMESPACE_RSS_20, 'url')) { - return 88; - } - - return null; - } - - /** - * Get the feed logo's height - * - * RSS 2.0 feeds are allowed to have a "feed logo" height. - * - * Uses `<image><height>` or defaults to 31 if no height is specified and - * the feed is an RSS 2.0 feed. - * - * @return int|null - */ - public function get_image_height() - { - if ($return = $this->get_image_tags(self::NAMESPACE_RSS_20, 'height')) { - return intval($return[0]['data']); - } elseif ($this->get_type() & self::TYPE_RSS_SYNDICATION && $this->get_image_tags(self::NAMESPACE_RSS_20, 'url')) { - return 31; - } - - return null; - } - - /** - * Get the number of items in the feed - * - * This is well-suited for {@link http://php.net/for for()} loops with - * {@see get_item()} - * - * @param int $max Maximum value to return. 0 for no limit - * @return int Number of items in the feed - */ - public function get_item_quantity(int $max = 0) - { - $qty = count($this->get_items()); - if ($max === 0) { - return $qty; - } - - return min($qty, $max); - } - - /** - * Get a single item from the feed - * - * This is better suited for {@link http://php.net/for for()} loops, whereas - * {@see get_items()} is better suited for - * {@link http://php.net/foreach foreach()} loops. - * - * @see get_item_quantity() - * @since Beta 2 - * @param int $key The item that you want to return. Remember that arrays begin with 0, not 1 - * @return Item|null - */ - public function get_item(int $key = 0) - { - $items = $this->get_items(); - if (isset($items[$key])) { - return $items[$key]; - } - - return null; - } - - /** - * Get all items from the feed - * - * This is better suited for {@link http://php.net/for for()} loops, whereas - * {@see get_items()} is better suited for - * {@link http://php.net/foreach foreach()} loops. - * - * @see get_item_quantity - * @since Beta 2 - * @param int $start Index to start at - * @param int $end Number of items to return. 0 for all items after `$start` - * @return Item[] List of {@see Item} objects - */ - public function get_items(int $start = 0, int $end = 0) - { - if (!isset($this->data['items'])) { - if (!empty($this->multifeed_objects)) { - $this->data['items'] = SimplePie::merge_items($this->multifeed_objects, $start, $end, $this->item_limit); - if (empty($this->data['items'])) { - return []; - } - return $this->data['items']; - } - $this->data['items'] = []; - if ($items = $this->get_feed_tags(self::NAMESPACE_ATOM_10, 'entry')) { - $keys = array_keys($items); - foreach ($keys as $key) { - $this->data['items'][] = $this->make_item($items[$key]); - } - } - if ($items = $this->get_feed_tags(self::NAMESPACE_ATOM_03, 'entry')) { - $keys = array_keys($items); - foreach ($keys as $key) { - $this->data['items'][] = $this->make_item($items[$key]); - } - } - if ($items = $this->get_feed_tags(self::NAMESPACE_RSS_10, 'item')) { - $keys = array_keys($items); - foreach ($keys as $key) { - $this->data['items'][] = $this->make_item($items[$key]); - } - } - if ($items = $this->get_feed_tags(self::NAMESPACE_RSS_090, 'item')) { - $keys = array_keys($items); - foreach ($keys as $key) { - $this->data['items'][] = $this->make_item($items[$key]); - } - } - if ($items = $this->get_channel_tags(self::NAMESPACE_RSS_20, 'item')) { - $keys = array_keys($items); - foreach ($keys as $key) { - $this->data['items'][] = $this->make_item($items[$key]); - } - } - } - - if (empty($this->data['items'])) { - return []; - } - - if ($this->order_by_date) { - if (!isset($this->data['ordered_items'])) { - $this->data['ordered_items'] = $this->data['items']; - usort($this->data['ordered_items'], [get_class($this), 'sort_items']); - } - $items = $this->data['ordered_items']; - } else { - $items = $this->data['items']; - } - // Slice the data as desired - if ($end === 0) { - return array_slice($items, $start); - } - - return array_slice($items, $start, $end); - } - - /** - * Set the favicon handler - * - * @deprecated Use your own favicon handling instead - * @param string|false $page - * @return bool - */ - public function set_favicon_handler($page = false, string $qs = 'i') - { - trigger_error('Favicon handling has been removed since SimplePie 1.3, please use your own handling', \E_USER_DEPRECATED); - return false; - } - - /** - * Get the favicon for the current feed - * - * @deprecated Use your own favicon handling instead - * @return string|bool - */ - public function get_favicon() - { - trigger_error('Favicon handling has been removed since SimplePie 1.3, please use your own handling', \E_USER_DEPRECATED); - - if (($url = $this->get_link()) !== null) { - return 'https://www.google.com/s2/favicons?domain=' . urlencode($url); - } - - return false; - } - - /** - * Magic method handler - * - * @param string $method Method name - * @param array<mixed> $args Arguments to the method - * @return mixed - */ - public function __call(string $method, array $args) - { - if (strpos($method, 'subscribe_') === 0) { - trigger_error('subscribe_*() has been deprecated since SimplePie 1.3, implement the callback yourself', \E_USER_DEPRECATED); - return ''; - } - if ($method === 'enable_xml_dump') { - trigger_error('enable_xml_dump() has been deprecated since SimplePie 1.3, use get_raw_data() instead', \E_USER_DEPRECATED); - return false; - } - - $class = get_class($this); - $trace = debug_backtrace(); - $file = $trace[0]['file'] ?? ''; - $line = $trace[0]['line'] ?? ''; - throw new SimplePieException("Call to undefined method $class::$method() in $file on line $line"); - } - - /** - * Item factory - * - * @param array<string, mixed> $data - */ - private function make_item(array $data): Item - { - $item = $this->registry->create(Item::class, [$this, $data]); - $item->set_sanitize($this->sanitize); - - return $item; - } - - /** - * Sorting callback for items - * - * @access private - * @param Item $a - * @param Item $b - * @return -1|0|1 - */ - public static function sort_items(Item $a, Item $b) - { - $a_date = $a->get_date('U'); - $b_date = $b->get_date('U'); - if ($a_date && $b_date) { - return $a_date > $b_date ? -1 : 1; - } - // Sort items without dates to the top. - if ($a_date) { - return 1; - } - if ($b_date) { - return -1; - } - return 0; - } - - /** - * Merge items from several feeds into one - * - * If you're merging multiple feeds together, they need to all have dates - * for the items or else SimplePie will refuse to sort them. - * - * @link http://simplepie.org/wiki/tutorial/sort_multiple_feeds_by_time_and_date#if_feeds_require_separate_per-feed_settings - * @param array<SimplePie> $urls List of SimplePie feed objects to merge - * @param int $start Starting item - * @param int $end Number of items to return - * @param int $limit Maximum number of items per feed - * @return array<Item> - */ - public static function merge_items(array $urls, int $start = 0, int $end = 0, int $limit = 0) - { - if (count($urls) > 0) { - $items = []; - foreach ($urls as $arg) { - if ($arg instanceof SimplePie) { - $items = array_merge($items, $arg->get_items(0, $limit)); - - // @phpstan-ignore-next-line Enforce PHPDoc type. - } else { - trigger_error('Arguments must be SimplePie objects', E_USER_WARNING); - } - } - - usort($items, [get_class($urls[0]), 'sort_items']); - - if ($end === 0) { - return array_slice($items, $start); - } - - return array_slice($items, $start, $end); - } - - trigger_error('Cannot merge zero SimplePie objects', E_USER_WARNING); - return []; - } - - /** - * Store PubSubHubbub links as headers - * - * There is no way to find PuSH links in the body of a microformats feed, - * so they are added to the headers when found, to be used later by get_links. - */ - private function store_links(Response $file, ?string $hub, ?string $self): Response - { - $linkHeaderLine = $file->get_header_line('link'); - $linkHeader = $file->get_header('link'); - - if ($hub && !preg_match('/rel=hub/', $linkHeaderLine)) { - $linkHeader[] = '<'.$hub.'>; rel=hub'; - } - - if ($self && !preg_match('/rel=self/', $linkHeaderLine)) { - $linkHeader[] = '<'.$self.'>; rel=self'; - } - - if (count($linkHeader) > 0) { - $file = $file->with_header('link', $linkHeader); - } - - return $file; - } - - /** - * Get a DataCache - * - * @param string $feed_url Only needed for BC, can be removed in SimplePie 2.0.0 - * - * @return DataCache - */ - private function get_cache(string $feed_url = ''): DataCache - { - if ($this->cache === null) { - // @trigger_error(sprintf('Not providing as PSR-16 cache implementation is deprecated since SimplePie 1.8.0, please use "SimplePie\SimplePie::set_cache()".'), \E_USER_DEPRECATED); - $cache = $this->registry->call(Cache::class, 'get_handler', [ - $this->cache_location, - $this->get_cache_filename($feed_url), - Base::TYPE_FEED - ]); - - return new BaseDataCache($cache); - } - - return $this->cache; - } - - /** - * Get a HTTP client - */ - private function get_http_client(): Client - { - if ($this->http_client === null) { - $this->http_client = new FileClient( - $this->get_registry(), - [ - 'timeout' => $this->timeout, - 'redirects' => 5, - 'useragent' => $this->useragent, - 'force_fsockopen' => $this->force_fsockopen, - 'curl_options' => $this->curl_options, - ] - ); - $this->http_client_injected = true; - } - - return $this->http_client; - } -} - -class_alias('SimplePie\SimplePie', 'SimplePie'); diff --git a/core/vendor/simplepie/simplepie/src/Source.php b/core/vendor/simplepie/simplepie/src/Source.php deleted file mode 100644 index 932fb84d96..0000000000 --- a/core/vendor/simplepie/simplepie/src/Source.php +++ /dev/null @@ -1,512 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie; - -/** - * Handles `<atom:source>` - * - * Used by {@see \SimplePie\Item::get_source()} - * - * This class can be overloaded with {@see \SimplePie::set_source_class()} - */ -class Source implements RegistryAware -{ - /** @var Item */ - public $item; - /** @var array<string, mixed> */ - public $data = []; - /** @var Registry */ - protected $registry; - - /** - * @param array<string, mixed> $data - */ - public function __construct(Item $item, array $data) - { - $this->item = $item; - $this->data = $data; - } - - /** - * @return void - */ - public function set_registry(\SimplePie\Registry $registry) - { - $this->registry = $registry; - } - - /** - * @return string - */ - public function __toString() - { - return md5(serialize($this->data)); - } - - /** - * @param string $namespace - * @param string $tag - * @return array<array<string, mixed>>|null - */ - public function get_source_tags(string $namespace, string $tag) - { - if (isset($this->data['child'][$namespace][$tag])) { - return $this->data['child'][$namespace][$tag]; - } - - return null; - } - - /** - * @param array<string, mixed> $element - * @return string - */ - public function get_base(array $element = []) - { - return $this->item->get_base($element); - } - - /** - * @param string $data - * @param int-mask-of<SimplePie::CONSTRUCT_*> $type - * @param string $base - * @return string - */ - public function sanitize(string $data, $type, string $base = '') - { - return $this->item->sanitize($data, $type, $base); - } - - /** - * @return Item - */ - public function get_item() - { - return $this->item; - } - - /** - * @return string|null - */ - public function get_title() - { - if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'title')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'title')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'title')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'title')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'title')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'title')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'title')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - - return null; - } - - /** - * @param int $key - * @return Category|null - */ - public function get_category(int $key = 0) - { - $categories = $this->get_categories(); - if (isset($categories[$key])) { - return $categories[$key]; - } - - return null; - } - - /** - * @return array<Category>|null - */ - public function get_categories() - { - $categories = []; - - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'category') as $category) { - $term = null; - $scheme = null; - $label = null; - if (isset($category['attribs']['']['term'])) { - $term = $this->sanitize($category['attribs']['']['term'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['scheme'])) { - $scheme = $this->sanitize($category['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($category['attribs']['']['label'])) { - $label = $this->sanitize($category['attribs']['']['label'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - $categories[] = $this->registry->create(Category::class, [$term, $scheme, $label]); - } - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'category') as $category) { - // This is really the label, but keep this as the term also for BC. - // Label will also work on retrieving because that falls back to term. - $term = $this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - if (isset($category['attribs']['']['domain'])) { - $scheme = $this->sanitize($category['attribs']['']['domain'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } else { - $scheme = null; - } - $categories[] = $this->registry->create(Category::class, [$term, $scheme, null]); - } - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'subject') as $category) { - $categories[] = $this->registry->create(Category::class, [$this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); - } - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'subject') as $category) { - $categories[] = $this->registry->create(Category::class, [$this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); - } - - if (!empty($categories)) { - return array_unique($categories); - } - - return null; - } - - /** - * @param int $key - * @return Author|null - */ - public function get_author(int $key = 0) - { - $authors = $this->get_authors(); - if (isset($authors[$key])) { - return $authors[$key]; - } - - return null; - } - - /** - * @return array<Author>|null - */ - public function get_authors() - { - $authors = []; - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'author') as $author) { - $name = null; - $uri = null; - $email = null; - if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'])) { - $name = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) { - $uri = $author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]; - $uri = $this->sanitize($uri['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($uri)); - } - if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) { - $email = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $uri !== null) { - $authors[] = $this->registry->create(Author::class, [$name, $uri, $email]); - } - } - if ($author = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'author')) { - $name = null; - $url = null; - $email = null; - if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'])) { - $name = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) { - $url = $author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]; - $url = $this->sanitize($url['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($url)); - } - if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) { - $email = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $url !== null) { - $authors[] = $this->registry->create(Author::class, [$name, $url, $email]); - } - } - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'creator') as $author) { - $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); - } - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'creator') as $author) { - $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); - } - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'author') as $author) { - $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); - } - - if (!empty($authors)) { - return array_unique($authors); - } - - return null; - } - - /** - * @param int $key - * @return Author|null - */ - public function get_contributor(int $key = 0) - { - $contributors = $this->get_contributors(); - if (isset($contributors[$key])) { - return $contributors[$key]; - } - - return null; - } - - /** - * @return array<Author>|null - */ - public function get_contributors() - { - $contributors = []; - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'contributor') as $contributor) { - $name = null; - $uri = null; - $email = null; - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'])) { - $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) { - $uri = $contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]; - $uri = $this->sanitize($uri['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($uri)); - } - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) { - $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $uri !== null) { - $contributors[] = $this->registry->create(Author::class, [$name, $uri, $email]); - } - } - foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'contributor') as $contributor) { - $name = null; - $url = null; - $email = null; - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'])) { - $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) { - $url = $contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]; - $url = $this->sanitize($url['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($url)); - } - if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) { - $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - if ($name !== null || $email !== null || $url !== null) { - $contributors[] = $this->registry->create(Author::class, [$name, $url, $email]); - } - } - - if (!empty($contributors)) { - return array_unique($contributors); - } - - return null; - } - - /** - * @param int $key - * @param string $rel - * @return string|null - */ - public function get_link(int $key = 0, string $rel = 'alternate') - { - $links = $this->get_links($rel); - if (isset($links[$key])) { - return $links[$key]; - } - - return null; - } - - /** - * Added for parity between the parent-level and the item/entry-level. - * - * @return string|null - */ - public function get_permalink() - { - return $this->get_link(0); - } - - /** - * @param string $rel - * @return array<string>|null - */ - public function get_links(string $rel = 'alternate') - { - if (!isset($this->data['links'])) { - $this->data['links'] = []; - if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'link')) { - foreach ($links as $link) { - if (isset($link['attribs']['']['href'])) { - $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; - $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($link)); - } - } - } - if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'link')) { - foreach ($links as $link) { - if (isset($link['attribs']['']['href'])) { - $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; - $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($link)); - } - } - } - if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'link')) { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0])); - } - if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'link')) { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0])); - } - if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'link')) { - $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0])); - } - - $keys = array_keys($this->data['links']); - foreach ($keys as $key) { - $key = (string) $key; - - if ($this->registry->call(Misc::class, 'is_isegment_nz_nc', [$key])) { - if (isset($this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key])) { - $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key]); - $this->data['links'][$key] = &$this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key]; - } else { - $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key] = &$this->data['links'][$key]; - } - } elseif (substr($key, 0, 41) === \SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY) { - $this->data['links'][substr($key, 41)] = &$this->data['links'][$key]; - } - $this->data['links'][$key] = array_unique($this->data['links'][$key]); - } - } - - if (isset($this->data['links'][$rel])) { - return $this->data['links'][$rel]; - } - - return null; - } - - /** - * @return string|null - */ - public function get_description() - { - if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'subtitle')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'tagline')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'description')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'description')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'description')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'description')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'description')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'summary')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_HTML, $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'subtitle')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_HTML, $this->get_base($return[0])); - } - - return null; - } - - /** - * @return string|null - */ - public function get_copyright() - { - if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'rights')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'copyright')) { - return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'copyright')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'rights')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'rights')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - - return null; - } - - /** - * @return string|null - */ - public function get_language() - { - if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'language')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'language')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'language')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } elseif (isset($this->data['xml_lang'])) { - return $this->sanitize($this->data['xml_lang'], \SimplePie\SimplePie::CONSTRUCT_TEXT); - } - - return null; - } - - /** - * @return float|null - */ - public function get_latitude() - { - if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'lat')) { - return (float) $return[0]['data']; - } elseif (($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { - return (float) $match[1]; - } - - return null; - } - - /** - * @return float|null - */ - public function get_longitude() - { - if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'long')) { - return (float) $return[0]['data']; - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'lon')) { - return (float) $return[0]['data']; - } elseif (($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { - return (float) $match[2]; - } - - return null; - } - - /** - * @return string|null - */ - public function get_image_url() - { - if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'image')) { - return $this->sanitize($return[0]['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'logo')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($return[0])); - } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'icon')) { - return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($return[0])); - } - - return null; - } -} - -class_alias('SimplePie\Source', 'SimplePie_Source'); diff --git a/core/vendor/simplepie/simplepie/src/XML/Declaration/Parser.php b/core/vendor/simplepie/simplepie/src/XML/Declaration/Parser.php deleted file mode 100644 index 1fcd22b9f0..0000000000 --- a/core/vendor/simplepie/simplepie/src/XML/Declaration/Parser.php +++ /dev/null @@ -1,308 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2004-2023 Ryan Parman, Sam Sneddon, Ryan McCue -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePie\XML\Declaration; - -/** - * Parses the XML Declaration - */ -class Parser -{ - /** - * XML Version - * - * @access public - * @var string - */ - public $version = '1.0'; - - /** - * Encoding - * - * @access public - * @var string - */ - public $encoding = 'UTF-8'; - - /** - * Standalone - * - * @access public - * @var bool - */ - public $standalone = false; - - private const STATE_BEFORE_VERSION_NAME = 'before_version_name'; - - private const STATE_VERSION_NAME = 'version_name'; - - private const STATE_VERSION_EQUALS = 'version_equals'; - - private const STATE_VERSION_VALUE = 'version_value'; - - private const STATE_ENCODING_NAME = 'encoding_name'; - - private const STATE_EMIT = 'emit'; - - private const STATE_ENCODING_EQUALS = 'encoding_equals'; - - private const STATE_STANDALONE_NAME = 'standalone_name'; - - private const STATE_ENCODING_VALUE = 'encoding_value'; - - private const STATE_STANDALONE_EQUALS = 'standalone_equals'; - - private const STATE_STANDALONE_VALUE = 'standalone_value'; - - private const STATE_ERROR = false; - - /** - * Current state of the state machine - * - * @access private - * @var self::STATE_* - */ - public $state = self::STATE_BEFORE_VERSION_NAME; - - /** - * Input data - * - * @access private - * @var string - */ - public $data = ''; - - /** - * Input data length (to avoid calling strlen() everytime this is needed) - * - * @access private - * @var int - */ - public $data_length = 0; - - /** - * Current position of the pointer - * - * @var int - * @access private - */ - public $position = 0; - - /** - * Create an instance of the class with the input data - * - * @access public - * @param string $data Input data - */ - public function __construct(string $data) - { - $this->data = $data; - $this->data_length = strlen($this->data); - } - - /** - * Parse the input data - * - * @access public - * @return bool true on success, false on failure - */ - public function parse(): bool - { - while ($this->state && $this->state !== self::STATE_EMIT && $this->has_data()) { - $state = $this->state; - $this->$state(); - } - $this->data = ''; - if ($this->state === self::STATE_EMIT) { - return true; - } - - // Reset the parser state. - $this->version = '1.0'; - $this->encoding = 'UTF-8'; - $this->standalone = false; - return false; - } - - /** - * Check whether there is data beyond the pointer - * - * @access private - * @return bool true if there is further data, false if not - */ - public function has_data(): bool - { - return (bool) ($this->position < $this->data_length); - } - - /** - * Advance past any whitespace - * - * @return int Number of whitespace characters passed - */ - public function skip_whitespace() - { - $whitespace = strspn($this->data, "\x09\x0A\x0D\x20", $this->position); - $this->position += $whitespace; - return $whitespace; - } - - /** - * Read value - * - * @return string|false - */ - public function get_value() - { - $quote = substr($this->data, $this->position, 1); - if ($quote === '"' || $quote === "'") { - $this->position++; - $len = strcspn($this->data, $quote, $this->position); - if ($this->has_data()) { - $value = substr($this->data, $this->position, $len); - $this->position += $len + 1; - return $value; - } - } - return false; - } - - public function before_version_name(): void - { - if ($this->skip_whitespace()) { - $this->state = self::STATE_VERSION_NAME; - } else { - $this->state = self::STATE_ERROR; - } - } - - public function version_name(): void - { - if (substr($this->data, $this->position, 7) === 'version') { - $this->position += 7; - $this->skip_whitespace(); - $this->state = self::STATE_VERSION_EQUALS; - } else { - $this->state = self::STATE_ERROR; - } - } - - public function version_equals(): void - { - if (substr($this->data, $this->position, 1) === '=') { - $this->position++; - $this->skip_whitespace(); - $this->state = self::STATE_VERSION_VALUE; - } else { - $this->state = self::STATE_ERROR; - } - } - - public function version_value(): void - { - if ($version = $this->get_value()) { - $this->version = $version; - $this->skip_whitespace(); - if ($this->has_data()) { - $this->state = self::STATE_ENCODING_NAME; - } else { - $this->state = self::STATE_EMIT; - } - } else { - $this->state = self::STATE_ERROR; - } - } - - public function encoding_name(): void - { - if (substr($this->data, $this->position, 8) === 'encoding') { - $this->position += 8; - $this->skip_whitespace(); - $this->state = self::STATE_ENCODING_EQUALS; - } else { - $this->state = self::STATE_STANDALONE_NAME; - } - } - - public function encoding_equals(): void - { - if (substr($this->data, $this->position, 1) === '=') { - $this->position++; - $this->skip_whitespace(); - $this->state = self::STATE_ENCODING_VALUE; - } else { - $this->state = self::STATE_ERROR; - } - } - - public function encoding_value(): void - { - if ($encoding = $this->get_value()) { - $this->encoding = $encoding; - $this->skip_whitespace(); - if ($this->has_data()) { - $this->state = self::STATE_STANDALONE_NAME; - } else { - $this->state = self::STATE_EMIT; - } - } else { - $this->state = self::STATE_ERROR; - } - } - - public function standalone_name(): void - { - if (substr($this->data, $this->position, 10) === 'standalone') { - $this->position += 10; - $this->skip_whitespace(); - $this->state = self::STATE_STANDALONE_EQUALS; - } else { - $this->state = self::STATE_ERROR; - } - } - - public function standalone_equals(): void - { - if (substr($this->data, $this->position, 1) === '=') { - $this->position++; - $this->skip_whitespace(); - $this->state = self::STATE_STANDALONE_VALUE; - } else { - $this->state = self::STATE_ERROR; - } - } - - public function standalone_value(): void - { - if ($standalone = $this->get_value()) { - switch ($standalone) { - case 'yes': - $this->standalone = true; - break; - - case 'no': - $this->standalone = false; - break; - - default: - $this->state = self::STATE_ERROR; - return; - } - - $this->skip_whitespace(); - if ($this->has_data()) { - $this->state = self::STATE_ERROR; - } else { - $this->state = self::STATE_EMIT; - } - } else { - $this->state = self::STATE_ERROR; - } - } -} - -class_alias('SimplePie\XML\Declaration\Parser', 'SimplePie_XML_Declaration_Parser'); diff --git a/core/vendor/simplepie/simplepie/utils/PHPStan/README.md b/core/vendor/simplepie/simplepie/utils/PHPStan/README.md deleted file mode 100644 index bd0cdb030a..0000000000 --- a/core/vendor/simplepie/simplepie/utils/PHPStan/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# SimplePie PHPStan extension - -**This extension is considered unstable, use at your own risk.** - -It provides: - -- Correct return type for `Registry::call()` diff --git a/core/vendor/simplepie/simplepie/utils/PHPStan/RegistryCallMethodReturnTypeExtension.php b/core/vendor/simplepie/simplepie/utils/PHPStan/RegistryCallMethodReturnTypeExtension.php deleted file mode 100644 index 564ba0dfa4..0000000000 --- a/core/vendor/simplepie/simplepie/utils/PHPStan/RegistryCallMethodReturnTypeExtension.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php - -// SPDX-FileCopyrightText: 2024 Jan Tojnar -// SPDX-License-Identifier: BSD-3-Clause - -declare(strict_types=1); - -namespace SimplePieUtils\PHPStan; - -use PHPStan\Analyser\Scope; -use PHPStan\Reflection\MethodReflection; -use PHPStan\Reflection\ParametersAcceptorSelector; -use PHPStan\Type\DynamicMethodReturnTypeExtension; -use PHPStan\Type\Type; -use PHPStan\Reflection\ReflectionProvider; -use PhpParser\Node\Expr\MethodCall; -use PHPStan\Type\Constant\ConstantStringType; -use PHPStan\Type\Constant\ConstantArrayType; -use PHPStan\Type\ArrayType; -use PHPStan\Type\MixedType; - -/** - * Fixes return type for `Registry::call()` to match the called method. - */ -class RegistryCallMethodReturnTypeExtension implements DynamicMethodReturnTypeExtension -{ - /** @var ReflectionProvider */ - private $reflectionProvider; - - public function __construct(ReflectionProvider $reflectionProvider) - { - $this->reflectionProvider = $reflectionProvider; - } - - public function getClass(): string - { - return 'SimplePie\Registry'; - } - - public function isMethodSupported(MethodReflection $methodReflection): bool - { - return $methodReflection->getName() === 'call'; - } - - public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type - { - // The method will be called as `$registry->call($className, $methodName, $arguments)`. - $args = $methodCall->getArgs(); - - if (count($args) < 2) { - // Not enough arguments to determine the return type. - return new MixedType(); - } - - $classNameArg = $args[0]->value; - $methodNameArg = $args[1]->value; - $argumentsArg = $args[2]->value ?? null; - - $classType = $scope->getType($classNameArg); - $methodType = $scope->getType($methodNameArg); - - if (!$classType instanceof ConstantStringType || !$methodType instanceof ConstantStringType) { - return new MixedType(); - } - - $className = $classType->getValue(); - if (!$this->reflectionProvider->hasClass($className)) { - return new MixedType(); - } - - $classReflection = $this->reflectionProvider->getClass($className); - - $methodName = $methodType->getValue(); - if (!$classReflection->hasMethod($methodName)) { - return new MixedType(); - } - - $methodReflection = $classReflection->getMethod($methodName, $scope); - - $argumentTypes = []; - if ($argumentsArg !== null) { - $argumentsType = $scope->getType($argumentsArg); - - if ($argumentsType instanceof ConstantArrayType) { - $argumentTypes = $argumentsType->getValueTypes(); - } elseif ($argumentsType instanceof ArrayType) { - $argumentTypes = [$argumentsType->getItemType()]; - } else { - return new MixedType(); - } - } - - $parametersAcceptor = ParametersAcceptorSelector::selectFromTypes( - $argumentTypes, - $methodReflection->getVariants(), - false - ); - - return $parametersAcceptor->getReturnType(); - } -} diff --git a/core/vendor/simplepie/simplepie/utils/PHPStan/extension.neon b/core/vendor/simplepie/simplepie/utils/PHPStan/extension.neon deleted file mode 100644 index 3b6811a202..0000000000 --- a/core/vendor/simplepie/simplepie/utils/PHPStan/extension.neon +++ /dev/null @@ -1,6 +0,0 @@ - -services: - - - class: SimplePieUtils\PHPStan\RegistryCallMethodReturnTypeExtension - tags: - - phpstan.broker.dynamicMethodReturnTypeExtension diff --git a/core/vendor/symfony/console/Formatter/OutputFormatter.php b/core/vendor/symfony/console/Formatter/OutputFormatter.php index 6e402ec42b..1e757183e1 100644 --- a/core/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/core/vendor/symfony/console/Formatter/OutputFormatter.php @@ -123,10 +123,6 @@ public function formatAndWrap(?string $message, int $width): string return ''; } - // For ASCII-only strings, byte positions equal character positions, - // so we can use native strlen/substr which is much faster than Helper::length/substr. - $isAscii = !preg_match('/[\x80-\xFF]/', $message); - $offset = 0; $output = ''; $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; @@ -141,17 +137,10 @@ public function formatAndWrap(?string $message, int $width): string continue; } - if ($isAscii) { - // For ASCII, byte position = character position, no conversion needed - $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); - $offset = $pos + \strlen($text); - } else { - // convert byte position to character position. - $pos = Helper::length(substr($message, 0, $pos)); - // add the text up to the next tag - $output .= $this->applyCurrentStyle(Helper::substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); - $offset = $pos + Helper::length($text); - } + // tags are delimited by "<" and ">", which are ASCII, so a tag offset can never + // fall inside a multibyte sequence: slicing by bytes is safe here + $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); + $offset = $pos + \strlen($text); // opening tag? if ($open = '/' !== $text[1]) { @@ -172,7 +161,7 @@ public function formatAndWrap(?string $message, int $width): string } } - $output .= $this->applyCurrentStyle($isAscii ? substr($message, $offset) : Helper::substr($message, $offset), $output, $width, $currentLineLength); + $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']); } diff --git a/core/vendor/symfony/error-handler/Error/FatalError.php b/core/vendor/symfony/error-handler/Error/FatalError.php index 85bd0a95ab..e1a21d51c2 100644 --- a/core/vendor/symfony/error-handler/Error/FatalError.php +++ b/core/vendor/symfony/error-handler/Error/FatalError.php @@ -26,6 +26,9 @@ public function __construct( ) { parent::__construct($message, $code); + // the backtrace is exposed by getTrace(), keeping a copy here would leak it and its arguments when the error is dumped + unset($this->error['trace']); + if (null !== $trace) { if (!$traceArgs) { foreach ($trace as $index => $frame) { diff --git a/core/vendor/symfony/error-handler/ErrorHandler.php b/core/vendor/symfony/error-handler/ErrorHandler.php index b85afb42e6..0b95b8922b 100644 --- a/core/vendor/symfony/error-handler/ErrorHandler.php +++ b/core/vendor/symfony/error-handler/ErrorHandler.php @@ -499,6 +499,7 @@ public function handleError(int $type, string $message, string $file, int $line) public function handleException(\Throwable $exception): void { $handlerException = null; + $loggerFailed = false; if (!$exception instanceof FatalError) { self::$exitCode = 255; @@ -526,6 +527,7 @@ public function handleException(\Throwable $exception): void try { $this->loggers[$type][0]->log($this->loggers[$type][1], $message, ['exception' => $exception]); } catch (\Throwable $handlerException) { + $loggerFailed = true; } } @@ -553,7 +555,8 @@ public function handleException(\Throwable $exception): void } $loggedErrors = $this->loggedErrors; - if ($exception === $handlerException) { + if ($exception === $handlerException || $loggerFailed) { + // the logger for that type is what threw, so calling it again would recurse forever $this->loggedErrors &= ~$type; } @@ -622,7 +625,8 @@ public static function handleFatalError(?array $error = null): void if ($error && $error['type'] &= \E_PARSE | \E_ERROR | \E_CORE_ERROR | \E_COMPILE_ERROR) { // Let's not throw anymore but keep logging $handler->throwAt(0, true); - $trace = $error['backtrace'] ?? null; + // "trace" is set by PHP >= 8.5 when fatal_error_backtraces is enabled + $trace = $error['trace'] ?? null; if (str_starts_with($error['message'], 'Allowed memory') || str_starts_with($error['message'], 'Out of memory')) { $fatalError = new OutOfMemoryError($handler->levels[$error['type']].': '.$error['message'], 0, $error, 2, false, $trace); diff --git a/core/vendor/symfony/finder/Glob.php b/core/vendor/symfony/finder/Glob.php index d950e48fc7..ac11e8e0de 100644 --- a/core/vendor/symfony/finder/Glob.php +++ b/core/vendor/symfony/finder/Glob.php @@ -77,7 +77,10 @@ public static function toRegex(string $glob, bool $strictLeadingDot = true, bool if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { $regex .= "\\$car"; } elseif ('*' === $car) { - $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); + if ($escaping || $strictWildcardSlash || !str_ends_with($regex, '.*')) { + // ".*.*" matches the same as ".*" but backtracks quadratically + $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); + } } elseif ('?' === $car) { $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); } elseif ('{' === $car) { diff --git a/core/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/core/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php index 9e69d0e319..3715e269ed 100644 --- a/core/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +++ b/core/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php @@ -39,7 +39,7 @@ public function __construct(\Iterator $iterator, string $baseDir) $this->baseDir = $this->normalizePath(realpath($baseDir) ?: $baseDir); foreach ([$this->baseDir, ...$this->parentDirectoriesUpwards($this->baseDir)] as $directory) { - if (@is_dir("{$directory}/.git")) { + if (@file_exists("{$directory}/.git")) { $this->baseDir = $directory; break; } diff --git a/core/vendor/symfony/http-foundation/Request.php b/core/vendor/symfony/http-foundation/Request.php index 6a9651f428..03b9c237c3 100644 --- a/core/vendor/symfony/http-foundation/Request.php +++ b/core/vendor/symfony/http-foundation/Request.php @@ -2220,17 +2220,15 @@ private function normalizeAndFilterClientIps(array $clientIps, string $ip): arra $firstTrustedIp = null; foreach ($clientIps as $key => $clientIp) { - if (strpos($clientIp, '.')) { - // Strip :port from IPv4 addresses. This is allowed in Forwarded - // and may occur in X-Forwarded-For. - $i = strpos($clientIp, ':'); - if ($i) { - $clientIps[$key] = $clientIp = substr($clientIp, 0, $i); - } - } elseif (str_starts_with($clientIp, '[')) { + if (str_starts_with($clientIp, '[')) { // Strip brackets and :port from IPv6 addresses. $i = strpos($clientIp, ']', 1); $clientIps[$key] = $clientIp = substr($clientIp, 1, $i - 1); + } elseif (strpos($clientIp, '.') && 1 === substr_count($clientIp, ':')) { + // Strip :port from IPv4 addresses. This is allowed in Forwarded + // and may occur in X-Forwarded-For. An IPv6 address with an + // embedded IPv4 address has at least two colons and is kept. + $clientIps[$key] = $clientIp = strstr($clientIp, ':', true); } if (!filter_var($clientIp, \FILTER_VALIDATE_IP)) { diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php index 2bed90f01f..f4195e56c4 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php @@ -28,6 +28,16 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess private ?string $newSessionId = null; private string $igbinaryEmptyData; + public function __serialize(): array + { + throw new \BadMethodCallException('Cannot serialize '.static::class); + } + + public function __unserialize(array $data): void + { + throw new \BadMethodCallException('Cannot unserialize '.static::class); + } + public function open(string $savePath, string $sessionName): bool { $this->sessionName = $sessionName; diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php index 48349a67bd..5d66f37d05 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php @@ -24,6 +24,16 @@ public function __construct( ) { } + public function __serialize(): array + { + throw new \BadMethodCallException('Cannot serialize '.__CLASS__); + } + + public function __unserialize(array $data): void + { + throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); + } + public function open(string $savePath, string $name): bool { return $this->handler->open($savePath, $name); diff --git a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php index 3ee51e5d6e..991bf8955a 100644 --- a/core/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php +++ b/core/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php @@ -38,6 +38,16 @@ public function __construct(\SessionHandlerInterface $currentHandler, \SessionHa $this->writeOnlyHandler = $writeOnlyHandler; } + public function __serialize(): array + { + throw new \BadMethodCallException('Cannot serialize '.__CLASS__); + } + + public function __unserialize(array $data): void + { + throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); + } + /** * @return string */ diff --git a/core/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php b/core/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php index 3a94dbc323..861f0063c1 100644 --- a/core/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php +++ b/core/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php @@ -31,6 +31,8 @@ class EventDataCollector extends DataCollector implements LateDataCollectorInter /** @var iterable<EventDispatcherInterface> */ private iterable $dispatchers; private ?Request $currentRequest = null; + // the default value is used by collectors unserialized from a profile, since only their data is serialized + private string $defaultDispatcher = 'event_dispatcher'; /** * @param iterable<EventDispatcherInterface>|EventDispatcherInterface|null $dispatchers @@ -38,8 +40,9 @@ class EventDataCollector extends DataCollector implements LateDataCollectorInter public function __construct( iterable|EventDispatcherInterface|null $dispatchers = null, private ?RequestStack $requestStack = null, - private string $defaultDispatcher = 'event_dispatcher', + string $defaultDispatcher = 'event_dispatcher', ) { + $this->defaultDispatcher = $defaultDispatcher; if ($dispatchers instanceof EventDispatcherInterface) { $dispatchers = [$this->defaultDispatcher => $dispatchers]; } diff --git a/core/vendor/symfony/http-kernel/EventListener/ErrorListener.php b/core/vendor/symfony/http-kernel/EventListener/ErrorListener.php index 81f5dfb7fc..4b0f34e257 100644 --- a/core/vendor/symfony/http-kernel/EventListener/ErrorListener.php +++ b/core/vendor/symfony/http-kernel/EventListener/ErrorListener.php @@ -47,8 +47,7 @@ public function __construct( public function logKernelException(ExceptionEvent $event): void { - $throwable = $event->getThrowable(); - $logLevel = $this->resolveLogLevel($throwable); + $originalThrowable = $throwable = $event->getThrowable(); $logChannel = $this->resolveLogChannel($throwable); foreach ($this->exceptionsMapping as $class => $config) { @@ -69,6 +68,7 @@ public function logKernelException(ExceptionEvent $event): void $event->setThrowable($throwable); } + $logLevel = $this->resolveLogLevel($originalThrowable, $throwable); $e = FlattenException::createFromThrowable($throwable); $this->logException($throwable, \sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', $e->getClass(), $e->getMessage(), basename($e->getFile()), $e->getLine()), $logLevel, $logChannel); @@ -180,7 +180,7 @@ protected function logException(\Throwable $exception, string $message, ?string /** * Resolves the level to be used when logging the exception. */ - private function resolveLogLevel(\Throwable $throwable): string + private function resolveLogLevel(\Throwable $throwable, ?\Throwable $convertedThrowable = null): string { foreach ($this->exceptionsMapping as $class => $config) { if ($throwable instanceof $class && $config['log_level']) { @@ -192,6 +192,8 @@ private function resolveLogLevel(\Throwable $throwable): string return $withLogLevel->level; } + $throwable = $convertedThrowable ?? $throwable; + if (!$throwable instanceof HttpExceptionInterface || $throwable->getStatusCode() >= 500) { return LogLevel::CRITICAL; } diff --git a/core/vendor/symfony/http-kernel/HttpKernel.php b/core/vendor/symfony/http-kernel/HttpKernel.php index 91764366cd..8032030c42 100644 --- a/core/vendor/symfony/http-kernel/HttpKernel.php +++ b/core/vendor/symfony/http-kernel/HttpKernel.php @@ -138,7 +138,9 @@ public function terminateWithException(\Throwable $exception, ?Request $request } } - $response->sendHeaders(); + if (!headers_sent()) { + $response->sendHeaders(); + } $response->sendContent(); $this->terminate($request, $response); diff --git a/core/vendor/symfony/http-kernel/Kernel.php b/core/vendor/symfony/http-kernel/Kernel.php index d96e684844..e14d23cecd 100644 --- a/core/vendor/symfony/http-kernel/Kernel.php +++ b/core/vendor/symfony/http-kernel/Kernel.php @@ -74,11 +74,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl */ private static array $freshCache = []; - public const VERSION = '7.4.19'; - public const VERSION_ID = 70419; + public const VERSION = '7.4.20'; + public const VERSION_ID = 70420; public const MAJOR_VERSION = 7; public const MINOR_VERSION = 4; - public const RELEASE_VERSION = 19; + public const RELEASE_VERSION = 20; public const EXTRA_VERSION = ''; public const END_OF_MAINTENANCE = '11/2028'; diff --git a/core/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/core/vendor/symfony/polyfill-intl-grapheme/Grapheme.php index cad3b8387c..94d080ac9b 100644 --- a/core/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ b/core/vendor/symfony/polyfill-intl-grapheme/Grapheme.php @@ -40,6 +40,10 @@ final class Grapheme // This regular expression is a work around for http://bugs.exim.org/1279 public const GRAPHEME_CLUSTER_RX = '(?:\r\n|[\x{1F1E6}-\x{1F1FF}][\x{1F1E6}-\x{1F1FF}]?|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Mc}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{1D165}\x{1D16E}-\x{1D172}\x{1F3FB}-\x{1F3FF}\x{FE0E}-\x{FE0F}\x{E0020}-\x{E007F}]*(?:\x{200D}(?:[\x{1F1E6}-\x{1F1FF}]|[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가-힣]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Mc}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{1D165}\x{1D16E}-\x{1D172}\x{1F3FB}-\x{1F3FF}\x{FE0E}-\x{FE0F}\x{E0020}-\x{E007F}]*)*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; + // Table 3-7 of the Unicode standard for the well-formed byte sequences (group 1), + // then the maximal subparts an ill-formed sequence is made of (group 2). + private const UTF8_CHAR_OR_SUBPART_RX = '/([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|[\xEE-\xEF][\x80-\xBF]{2}|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})|(\xF0[\x90-\xBF][\x80-\xBF]?|[\xF1-\xF3][\x80-\xBF]{1,2}|\xF4[\x80-\x8F][\x80-\xBF]?|\xE0[\xA0-\xBF]|[\xE1-\xEC][\x80-\xBF]|\xED[\x80-\x9F]|[\xEE-\xEF][\x80-\xBF]|[\x80-\xFF])/s'; + private const CASE_FOLD = [ ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], @@ -130,6 +134,10 @@ public static function grapheme_substr($s, $start, $len = null) $len = 2147483647; } + if (!self::isUtf8($s)) { + return false; + } + preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s, $s); $slen = \count($s[0]); @@ -189,33 +197,47 @@ public static function grapheme_strripos($s, $needle, $offset = 0) public static function grapheme_stristr($s, $needle, $beforeNeedle = false) { + if (!self::isUtf8($s) || !self::isUtf8($needle)) { + return false; + } + return mb_stristr($s, $needle, $beforeNeedle, 'UTF-8'); } public static function grapheme_strstr($s, $needle, $beforeNeedle = false) { + if (!self::isUtf8($s) || !self::isUtf8($needle)) { + return false; + } + return mb_strstr($s, $needle, $beforeNeedle, 'UTF-8'); } public static function grapheme_str_split($s, $len = 1) { - if (0 > $len || 1073741823 < $len) { - throw new \ValueError('grapheme_str_split(): Argument #2 ($length) must be greater than 0 and less than or equal to 1073741823.'); + if (0 >= $len || 1073741823 < $len) { + throw new \ValueError('grapheme_str_split(): Argument #2 ($length) must be greater than 0 and less than or equal to 1073741823'); } if ('' === $s) { return []; } - if (!preg_match_all('/('.SYMFONY_GRAPHEME_CLUSTER_RX.')/u', $s, $matches)) { + if (preg_match_all('/('.SYMFONY_GRAPHEME_CLUSTER_RX.')/u', $s, $matches)) { + $graphemes = $matches[0]; + } else { + $graphemes = self::splitIllFormed($s); + } + + if (!$graphemes) { return false; } if (1 === $len) { - return $matches[0]; + return $graphemes; } - $chunks = array_chunk($matches[0], $len); + $chunks = array_chunk($graphemes, $len); foreach ($chunks as &$chunk) { $chunk = implode('', $chunk); @@ -224,14 +246,20 @@ public static function grapheme_str_split($s, $len = 1) return $chunks; } - public static function grapheme_levenshtein($s1, $s2, $insertion_cost = 1, $replacement_cost = 1, $deletion_cost = 1) + public static function grapheme_levenshtein($s1, $s2, $insertion_cost = 1, $replacement_cost = 1, $deletion_cost = 1, $locale = '') { - if (!preg_match('//u', $s1) || !preg_match('//u', $s2)) { - return false; + if ($insertion_cost <= 0 || $insertion_cost > 1073741823) { + throw new \ValueError('grapheme_levenshtein(): Argument #3 ($insertion_cost) must be greater than 0 and less than or equal to 1073741823'); + } + if ($replacement_cost <= 0 || $replacement_cost > 1073741823) { + throw new \ValueError('grapheme_levenshtein(): Argument #4 ($replacement_cost) must be greater than 0 and less than or equal to 1073741823'); + } + if ($deletion_cost <= 0 || $deletion_cost > 1073741823) { + throw new \ValueError('grapheme_levenshtein(): Argument #5 ($deletion_cost) must be greater than 0 and less than or equal to 1073741823'); } - if (0 > $insertion_cost || 0 > $replacement_cost || 0 > $deletion_cost) { - throw new \ValueError('grapheme_levenshtein(): Argument #3 ($insertion_cost), #4 ($replacement_cost), and #5 ($deletion_cost) must be greater than or equal to 0'); + if (!preg_match('//u', $s1) || !preg_match('//u', $s2)) { + return false; } preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s1, $s1); @@ -239,33 +267,58 @@ public static function grapheme_levenshtein($s1, $s2, $insertion_cost = 1, $repl $s1 = $s1[0]; $s2 = $s2[0]; + $l1 = \count($s1); $l2 = \count($s2); - if (0 === $l1) { - return $l2 * $insertion_cost; + // Keep the rows as short as possible. Reversing the transformation + // swaps the meaning of insertion and deletion. + if ($l1 < $l2) { + [$s1, $s2] = [$s2, $s1]; + [$l1, $l2] = [$l2, $l1]; + [$insertion_cost, $deletion_cost] = [$deletion_cost, $insertion_cost]; } + if (0 === $l2) { return $l1 * $deletion_cost; } - $dp = array_fill(0, $l1 + 1, array_fill(0, $l2 + 1, 0)); - - for ($i = 1; $i <= $l1; ++$i) { - $dp[$i][0] = $dp[$i - 1][0] + $deletion_cost; + if (\extension_loaded('intl')) { + // Graphemes are equal when the collator says so, as with ucol_strcoll() in intl + try { + $collator = new \Collator('' === $locale ? 'root' : $locale); + } catch (\IntlException $e) { + return false; + } + $s1 = array_map([$collator, 'getSortKey'], $s1); + $s2 = array_map([$collator, 'getSortKey'], $s2); + } elseif (class_exists(\Normalizer::class)) { + // Without a collator, at least treat canonically equivalent graphemes as equal + foreach ($s1 as $i => $g) { + $s1[$i] = \Normalizer::normalize($g, \Normalizer::FORM_D); + } + foreach ($s2 as $i => $g) { + $s2[$i] = \Normalizer::normalize($g, \Normalizer::FORM_D); + } } + + $previousRow = $currentRow = array_fill(0, $l2 + 1, 0); for ($j = 1; $j <= $l2; ++$j) { - $dp[0][$j] = $dp[0][$j - 1] + $insertion_cost; + $previousRow[$j] = $previousRow[$j - 1] + $insertion_cost; } for ($i = 1; $i <= $l1; ++$i) { + $currentRow[0] = $previousRow[0] + $deletion_cost; + for ($j = 1; $j <= $l2; ++$j) { $cost = ($s1[$i - 1] === $s2[$j - 1]) ? 0 : $replacement_cost; - $dp[$i][$j] = min($dp[$i - 1][$j] + $deletion_cost, $dp[$i][$j - 1] + $insertion_cost, $dp[$i - 1][$j - 1] + $cost); + $currentRow[$j] = min($previousRow[$j] + $deletion_cost, $currentRow[$j - 1] + $insertion_cost, $previousRow[$j - 1] + $cost); } + + [$previousRow, $currentRow] = [$currentRow, $previousRow]; } - return $dp[$l1][$l2]; + return $previousRow[$l2]; } private static function grapheme_position($s, $needle, $offset, $mode) @@ -335,16 +388,69 @@ private static function grapheme_position($s, $needle, $offset, $mode) public static function grapheme_strrev(string $string) { - if (!preg_match('//u', $string)) { - return false; + if (\extension_loaded('intl')) { + $iterator = \IntlBreakIterator::createCharacterInstance(); + $iterator->setText($string); + $reversed = ''; + $end = $iterator->last(); + + while (\IntlBreakIterator::DONE !== $start = $iterator->previous()) { + $reversed .= substr($string, $start, $end - $start); + $end = $start; + } + + return $reversed; } - $units = grapheme_str_split($string); + return implode('', array_reverse(self::grapheme_str_split($string))); + } - if (false === $units) { - return false; + private static function isUtf8(?string $s) + { + $s = $s ?? ''; + + return '' === $s || preg_match('/./us', $s); + } + + /** + * Splits a string that is not valid UTF-8 into grapheme clusters. + * + * The intl extension keeps the ill-formed bytes and breaks around them the + * way it would around the U+FFFD each maximal subpart stands for. Standing + * one in for real makes the cluster regexp applicable, then each cluster is + * mapped back to the bytes it was made of. + */ + private static function splitIllFormed($s) + { + preg_match_all(self::UTF8_CHAR_OR_SUBPART_RX, $s, $matches, \PREG_SET_ORDER); + + $segments = []; + $segmentAt = []; + $sanitized = ''; + + foreach ($matches as $m) { + $segmentAt[\strlen($sanitized)] = \count($segments); + + if (isset($m[2]) && '' !== $m[2]) { + $segments[] = $m[2]; + $sanitized .= "\xEF\xBF\xBD"; + } else { + $segments[] = $m[1]; + $sanitized .= $m[1]; + } + } + + $segmentAt[\strlen($sanitized)] = \count($segments); + + preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $sanitized, $clusters, \PREG_OFFSET_CAPTURE); + + $graphemes = []; + + foreach ($clusters[0] as $cluster) { + $start = $segmentAt[$cluster[1]]; + $graphemes[] = implode('', \array_slice($segments, $start, $segmentAt[$cluster[1] + \strlen($cluster[0])] - $start)); } - return implode('', array_reverse($units)); + return $graphemes; } } diff --git a/core/vendor/symfony/polyfill-intl-grapheme/bootstrap.php b/core/vendor/symfony/polyfill-intl-grapheme/bootstrap.php index 4fd8774194..d6795031cc 100644 --- a/core/vendor/symfony/polyfill-intl-grapheme/bootstrap.php +++ b/core/vendor/symfony/polyfill-intl-grapheme/bootstrap.php @@ -62,7 +62,7 @@ function grapheme_substr($string, $offset, $length = null) { return p\Grapheme:: function grapheme_str_split(string $string, int $length = 1) { return p\Grapheme::grapheme_str_split($string, $length); } } if (!function_exists('grapheme_levenshtein')) { - function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = '') { return p\Grapheme::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); } + function grapheme_levenshtein(string $string1, string $string2, ?int $insertion_cost = 1, ?int $replacement_cost = 1, ?int $deletion_cost = 1, string $locale = '') { return p\Grapheme::grapheme_levenshtein($string1, $string2, (int) $insertion_cost, (int) $replacement_cost, (int) $deletion_cost, $locale); } } if (!function_exists('grapheme_strrev')) { function grapheme_strrev(string $string) { return p\Grapheme::grapheme_strrev($string); } diff --git a/core/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php b/core/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php index b05cfde556..c913b00bc0 100644 --- a/core/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php +++ b/core/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php @@ -15,7 +15,7 @@ function grapheme_str_split(string $string, int $length = 1): array|false { return p\Grapheme::grapheme_str_split($string, $length); } } if (!function_exists('grapheme_levenshtein')) { - function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = ''): int|false { return p\Grapheme::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); } + function grapheme_levenshtein(string $string1, string $string2, ?int $insertion_cost = 1, ?int $replacement_cost = 1, ?int $deletion_cost = 1, string $locale = ''): int|false { return p\Grapheme::grapheme_levenshtein($string1, $string2, (int) $insertion_cost, (int) $replacement_cost, (int) $deletion_cost, $locale); } } if (!function_exists('grapheme_strrev')) { function grapheme_strrev(string $string): string|false { return p\Grapheme::grapheme_strrev($string); } diff --git a/core/vendor/symfony/polyfill-intl-idn/Idn.php b/core/vendor/symfony/polyfill-intl-idn/Idn.php index 8cad7cc70a..2dfefd41be 100644 --- a/core/vendor/symfony/polyfill-intl-idn/Idn.php +++ b/core/vendor/symfony/polyfill-intl-idn/Idn.php @@ -261,27 +261,34 @@ private static function isValidContextJ(array $codePoints, $label) self::$virama = require __DIR__.\DIRECTORY_SEPARATOR.'Resources'.\DIRECTORY_SEPARATOR.'unidata'.\DIRECTORY_SEPARATOR.'virama.php'; } - $offset = 0; + $offset = $joinerOffset = 0; foreach ($codePoints as $i => $codePoint) { if (0x200C !== $codePoint && 0x200D !== $codePoint) { continue; } + $currentOffset = strpos($label, 0x200C === $codePoint ? "\xE2\x80\x8C" : "\xE2\x80\x8D", $joinerOffset); + $joinerOffset = $currentOffset + 3; + if (!isset($codePoints[$i - 1])) { return false; } // If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True; if (isset(self::$virama[$codePoints[$i - 1]])) { + $offset = $joinerOffset; + continue; } // If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C(Joining_Type:T)*(Joining_Type:{R,D})) Then // True; // Generated RegExp = ([Joining_Type:{L,D}][Joining_Type:T]*\u200C[Joining_Type:T]*)[Joining_Type:{R,D}] - if (0x200C === $codePoint && 1 === preg_match(Regex::ZWNJ, $label, $matches, \PREG_OFFSET_CAPTURE, $offset)) { - $offset += \strlen($matches[1][0]); + if (0x200C === $codePoint + && preg_match(Regex::ZWNJ, $label, $matches, \PREG_OFFSET_CAPTURE, $offset) + && $currentOffset === $matches[1][1] + strpos($matches[1][0], "\xE2\x80\x8C")) { + $offset = $matches[1][1] + \strlen($matches[1][0]); continue; } @@ -700,6 +707,11 @@ private static function punycodeDecode($input) $n += intdiv($i, $outPlusOne); $i %= $outPlusOne; + + if ($n > 0x10FFFF || ($n >= 0xD800 && $n <= 0xDFFF)) { + throw new \Exception('Invalid code point'); + } + array_splice($output, $i++, 0, [mb_chr($n, 'utf-8')]); } diff --git a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php index d285acd13e..83eda60453 100644 --- a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php +++ b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php @@ -27,10 +27,6 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 2155 && $codePoint <= 2207) { - return true; - } - if ($codePoint >= 3676 && $codePoint <= 3712) { return true; } @@ -47,15 +43,11 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 6849 && $codePoint <= 6911) { - return true; - } - - if ($codePoint >= 11859 && $codePoint <= 11903) { + if ($codePoint >= 6863 && $codePoint <= 6911) { return true; } - if ($codePoint >= 42955 && $codePoint <= 42996) { + if ($codePoint >= 11870 && $codePoint <= 11903) { return true; } @@ -91,11 +83,11 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 66928 && $codePoint <= 67071) { + if ($codePoint >= 67005 && $codePoint <= 67071) { return true; } - if ($codePoint >= 67432 && $codePoint <= 67583) { + if ($codePoint >= 67515 && $codePoint <= 67583) { return true; } @@ -123,15 +115,15 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 69298 && $codePoint <= 69375) { + if ($codePoint >= 69298 && $codePoint <= 69372) { return true; } - if ($codePoint >= 69466 && $codePoint <= 69551) { + if ($codePoint >= 69514 && $codePoint <= 69551) { return true; } - if ($codePoint >= 70207 && $codePoint <= 70271) { + if ($codePoint >= 70210 && $codePoint <= 70271) { return true; } @@ -151,7 +143,7 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 71488 && $codePoint <= 71679) { + if ($codePoint >= 71495 && $codePoint <= 71679) { return true; } @@ -163,7 +155,7 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 72441 && $codePoint <= 72703) { + if ($codePoint >= 72458 && $codePoint <= 72703) { return true; } @@ -175,7 +167,7 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 73465 && $codePoint <= 73647) { + if ($codePoint >= 73562 && $codePoint <= 73647) { return true; } @@ -183,11 +175,11 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 75076 && $codePoint <= 77823) { + if ($codePoint >= 75076 && $codePoint <= 77711) { return true; } - if ($codePoint >= 78905 && $codePoint <= 82943) { + if ($codePoint >= 78934 && $codePoint <= 82943) { return true; } @@ -195,10 +187,6 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 92784 && $codePoint <= 92879) { - return true; - } - if ($codePoint >= 93072 && $codePoint <= 93759) { return true; } @@ -215,23 +203,23 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 101641 && $codePoint <= 110591) { + if ($codePoint >= 101641 && $codePoint <= 110575) { return true; } - if ($codePoint >= 110879 && $codePoint <= 110927) { + if ($codePoint >= 111356 && $codePoint <= 113663) { return true; } - if ($codePoint >= 111356 && $codePoint <= 113663) { + if ($codePoint >= 113828 && $codePoint <= 118527) { return true; } - if ($codePoint >= 113828 && $codePoint <= 118783) { + if ($codePoint >= 118724 && $codePoint <= 118783) { return true; } - if ($codePoint >= 119366 && $codePoint <= 119519) { + if ($codePoint >= 119366 && $codePoint <= 119487) { return true; } @@ -239,19 +227,31 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 121520 && $codePoint <= 122879) { + if ($codePoint >= 121520 && $codePoint <= 122623) { return true; } - if ($codePoint >= 122923 && $codePoint <= 123135) { + if ($codePoint >= 122667 && $codePoint <= 122879) { return true; } - if ($codePoint >= 123216 && $codePoint <= 123583) { + if ($codePoint >= 122990 && $codePoint <= 123022) { return true; } - if ($codePoint >= 123648 && $codePoint <= 124927) { + if ($codePoint >= 123024 && $codePoint <= 123135) { + return true; + } + + if ($codePoint >= 123216 && $codePoint <= 123535) { + return true; + } + + if ($codePoint >= 123648 && $codePoint <= 124111) { + return true; + } + + if ($codePoint >= 124154 && $codePoint <= 124895) { return true; } @@ -291,10 +291,6 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 129751 && $codePoint <= 129791) { - return true; - } - if ($codePoint >= 129995 && $codePoint <= 130031) { return true; } @@ -303,11 +299,11 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 173790 && $codePoint <= 173823) { + if ($codePoint >= 173792 && $codePoint <= 173823) { return true; } - if ($codePoint >= 191457 && $codePoint <= 194559) { + if ($codePoint >= 192094 && $codePoint <= 194559) { return true; } @@ -315,7 +311,7 @@ public static function inRange($codePoint) return true; } - if ($codePoint >= 201547 && $codePoint <= 262141) { + if ($codePoint >= 205744 && $codePoint <= 262141) { return true; } diff --git a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php index 3c6af0c132..455e233487 100644 --- a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php +++ b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php @@ -16,18 +16,18 @@ */ final class Regex { - const COMBINING_MARK = '/^[\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{0903}\x{093A}\x{093B}\x{093C}\x{093E}-\x{0940}\x{0941}-\x{0948}\x{0949}-\x{094C}\x{094D}\x{094E}-\x{094F}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{0982}-\x{0983}\x{09BC}\x{09BE}-\x{09C0}\x{09C1}-\x{09C4}\x{09C7}-\x{09C8}\x{09CB}-\x{09CC}\x{09CD}\x{09D7}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A03}\x{0A3C}\x{0A3E}-\x{0A40}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0A83}\x{0ABC}\x{0ABE}-\x{0AC0}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0AC9}\x{0ACB}-\x{0ACC}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B02}-\x{0B03}\x{0B3C}\x{0B3E}\x{0B3F}\x{0B40}\x{0B41}-\x{0B44}\x{0B47}-\x{0B48}\x{0B4B}-\x{0B4C}\x{0B4D}\x{0B55}-\x{0B56}\x{0B57}\x{0B62}-\x{0B63}\x{0B82}\x{0BBE}-\x{0BBF}\x{0BC0}\x{0BC1}-\x{0BC2}\x{0BC6}-\x{0BC8}\x{0BCA}-\x{0BCC}\x{0BCD}\x{0BD7}\x{0C00}\x{0C01}-\x{0C03}\x{0C04}\x{0C3E}-\x{0C40}\x{0C41}-\x{0C44}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0C82}-\x{0C83}\x{0CBC}\x{0CBE}\x{0CBF}\x{0CC0}-\x{0CC4}\x{0CC6}\x{0CC7}-\x{0CC8}\x{0CCA}-\x{0CCB}\x{0CCC}-\x{0CCD}\x{0CD5}-\x{0CD6}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D02}-\x{0D03}\x{0D3B}-\x{0D3C}\x{0D3E}-\x{0D40}\x{0D41}-\x{0D44}\x{0D46}-\x{0D48}\x{0D4A}-\x{0D4C}\x{0D4D}\x{0D57}\x{0D62}-\x{0D63}\x{0D81}\x{0D82}-\x{0D83}\x{0DCA}\x{0DCF}-\x{0DD1}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0DD8}-\x{0DDF}\x{0DF2}-\x{0DF3}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3E}-\x{0F3F}\x{0F71}-\x{0F7E}\x{0F7F}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102B}-\x{102C}\x{102D}-\x{1030}\x{1031}\x{1032}-\x{1037}\x{1038}\x{1039}-\x{103A}\x{103B}-\x{103C}\x{103D}-\x{103E}\x{1056}-\x{1057}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1062}-\x{1064}\x{1067}-\x{106D}\x{1071}-\x{1074}\x{1082}\x{1083}-\x{1084}\x{1085}-\x{1086}\x{1087}-\x{108C}\x{108D}\x{108F}\x{109A}-\x{109C}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B6}\x{17B7}-\x{17BD}\x{17BE}-\x{17C5}\x{17C6}\x{17C7}-\x{17C8}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1923}-\x{1926}\x{1927}-\x{1928}\x{1929}-\x{192B}\x{1930}-\x{1931}\x{1932}\x{1933}-\x{1938}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A19}-\x{1A1A}\x{1A1B}\x{1A55}\x{1A56}\x{1A57}\x{1A58}-\x{1A5E}\x{1A60}\x{1A61}\x{1A62}\x{1A63}-\x{1A64}\x{1A65}-\x{1A6C}\x{1A6D}-\x{1A72}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B04}\x{1B34}\x{1B35}\x{1B36}-\x{1B3A}\x{1B3B}\x{1B3C}\x{1B3D}-\x{1B41}\x{1B42}\x{1B43}-\x{1B44}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1B82}\x{1BA1}\x{1BA2}-\x{1BA5}\x{1BA6}-\x{1BA7}\x{1BA8}-\x{1BA9}\x{1BAA}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE7}\x{1BE8}-\x{1BE9}\x{1BEA}-\x{1BEC}\x{1BED}\x{1BEE}\x{1BEF}-\x{1BF1}\x{1BF2}-\x{1BF3}\x{1C24}-\x{1C2B}\x{1C2C}-\x{1C33}\x{1C34}-\x{1C35}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE1}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF7}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{302E}-\x{302F}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A823}-\x{A824}\x{A825}-\x{A826}\x{A827}\x{A82C}\x{A880}-\x{A881}\x{A8B4}-\x{A8C3}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A952}-\x{A953}\x{A980}-\x{A982}\x{A983}\x{A9B3}\x{A9B4}-\x{A9B5}\x{A9B6}-\x{A9B9}\x{A9BA}-\x{A9BB}\x{A9BC}-\x{A9BD}\x{A9BE}-\x{A9C0}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA2F}-\x{AA30}\x{AA31}-\x{AA32}\x{AA33}-\x{AA34}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA4D}\x{AA7B}\x{AA7C}\x{AA7D}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEB}\x{AAEC}-\x{AAED}\x{AAEE}-\x{AAEF}\x{AAF5}\x{AAF6}\x{ABE3}-\x{ABE4}\x{ABE5}\x{ABE6}-\x{ABE7}\x{ABE8}\x{ABE9}-\x{ABEA}\x{ABEC}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11000}\x{11001}\x{11002}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{11082}\x{110B0}-\x{110B2}\x{110B3}-\x{110B6}\x{110B7}-\x{110B8}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112C}\x{1112D}-\x{11134}\x{11145}-\x{11146}\x{11173}\x{11180}-\x{11181}\x{11182}\x{111B3}-\x{111B5}\x{111B6}-\x{111BE}\x{111BF}-\x{111C0}\x{111C9}-\x{111CC}\x{111CE}\x{111CF}\x{1122C}-\x{1122E}\x{1122F}-\x{11231}\x{11232}-\x{11233}\x{11234}\x{11235}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E0}-\x{112E2}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{11302}-\x{11303}\x{1133B}-\x{1133C}\x{1133E}-\x{1133F}\x{11340}\x{11341}-\x{11344}\x{11347}-\x{11348}\x{1134B}-\x{1134D}\x{11357}\x{11362}-\x{11363}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11435}-\x{11437}\x{11438}-\x{1143F}\x{11440}-\x{11441}\x{11442}-\x{11444}\x{11445}\x{11446}\x{1145E}\x{114B0}-\x{114B2}\x{114B3}-\x{114B8}\x{114B9}\x{114BA}\x{114BB}-\x{114BE}\x{114BF}-\x{114C0}\x{114C1}\x{114C2}-\x{114C3}\x{115AF}-\x{115B1}\x{115B2}-\x{115B5}\x{115B8}-\x{115BB}\x{115BC}-\x{115BD}\x{115BE}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11630}-\x{11632}\x{11633}-\x{1163A}\x{1163B}-\x{1163C}\x{1163D}\x{1163E}\x{1163F}-\x{11640}\x{116AB}\x{116AC}\x{116AD}\x{116AE}-\x{116AF}\x{116B0}-\x{116B5}\x{116B6}\x{116B7}\x{1171D}-\x{1171F}\x{11720}-\x{11721}\x{11722}-\x{11725}\x{11726}\x{11727}-\x{1172B}\x{1182C}-\x{1182E}\x{1182F}-\x{11837}\x{11838}\x{11839}-\x{1183A}\x{11930}-\x{11935}\x{11937}-\x{11938}\x{1193B}-\x{1193C}\x{1193D}\x{1193E}\x{11940}\x{11942}\x{11943}\x{119D1}-\x{119D3}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119DC}-\x{119DF}\x{119E0}\x{119E4}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A39}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A57}-\x{11A58}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A97}\x{11A98}-\x{11A99}\x{11C2F}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3E}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CA9}\x{11CAA}-\x{11CB0}\x{11CB1}\x{11CB2}-\x{11CB3}\x{11CB4}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D8A}-\x{11D8E}\x{11D90}-\x{11D91}\x{11D93}-\x{11D94}\x{11D95}\x{11D96}\x{11D97}\x{11EF3}-\x{11EF4}\x{11EF5}-\x{11EF6}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F51}-\x{16F87}\x{16F8F}-\x{16F92}\x{16FE4}\x{16FF0}-\x{16FF1}\x{1BC9D}-\x{1BC9E}\x{1D165}-\x{1D166}\x{1D167}-\x{1D169}\x{1D16D}-\x{1D172}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{E0100}-\x{E01EF}]/u'; + const COMBINING_MARK = '/^[\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{0898}-\x{089F}\x{08CA}-\x{08E1}\x{08E3}-\x{0902}\x{0903}\x{093A}\x{093B}\x{093C}\x{093E}-\x{0940}\x{0941}-\x{0948}\x{0949}-\x{094C}\x{094D}\x{094E}-\x{094F}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{0982}-\x{0983}\x{09BC}\x{09BE}-\x{09C0}\x{09C1}-\x{09C4}\x{09C7}-\x{09C8}\x{09CB}-\x{09CC}\x{09CD}\x{09D7}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A03}\x{0A3C}\x{0A3E}-\x{0A40}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0A83}\x{0ABC}\x{0ABE}-\x{0AC0}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0AC9}\x{0ACB}-\x{0ACC}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B02}-\x{0B03}\x{0B3C}\x{0B3E}\x{0B3F}\x{0B40}\x{0B41}-\x{0B44}\x{0B47}-\x{0B48}\x{0B4B}-\x{0B4C}\x{0B4D}\x{0B55}-\x{0B56}\x{0B57}\x{0B62}-\x{0B63}\x{0B82}\x{0BBE}-\x{0BBF}\x{0BC0}\x{0BC1}-\x{0BC2}\x{0BC6}-\x{0BC8}\x{0BCA}-\x{0BCC}\x{0BCD}\x{0BD7}\x{0C00}\x{0C01}-\x{0C03}\x{0C04}\x{0C3C}\x{0C3E}-\x{0C40}\x{0C41}-\x{0C44}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0C82}-\x{0C83}\x{0CBC}\x{0CBE}\x{0CBF}\x{0CC0}-\x{0CC4}\x{0CC6}\x{0CC7}-\x{0CC8}\x{0CCA}-\x{0CCB}\x{0CCC}-\x{0CCD}\x{0CD5}-\x{0CD6}\x{0CE2}-\x{0CE3}\x{0CF3}\x{0D00}-\x{0D01}\x{0D02}-\x{0D03}\x{0D3B}-\x{0D3C}\x{0D3E}-\x{0D40}\x{0D41}-\x{0D44}\x{0D46}-\x{0D48}\x{0D4A}-\x{0D4C}\x{0D4D}\x{0D57}\x{0D62}-\x{0D63}\x{0D81}\x{0D82}-\x{0D83}\x{0DCA}\x{0DCF}-\x{0DD1}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0DD8}-\x{0DDF}\x{0DF2}-\x{0DF3}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECE}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3E}-\x{0F3F}\x{0F71}-\x{0F7E}\x{0F7F}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102B}-\x{102C}\x{102D}-\x{1030}\x{1031}\x{1032}-\x{1037}\x{1038}\x{1039}-\x{103A}\x{103B}-\x{103C}\x{103D}-\x{103E}\x{1056}-\x{1057}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1062}-\x{1064}\x{1067}-\x{106D}\x{1071}-\x{1074}\x{1082}\x{1083}-\x{1084}\x{1085}-\x{1086}\x{1087}-\x{108C}\x{108D}\x{108F}\x{109A}-\x{109C}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1715}\x{1732}-\x{1733}\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B6}\x{17B7}-\x{17BD}\x{17BE}-\x{17C5}\x{17C6}\x{17C7}-\x{17C8}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{180F}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1923}-\x{1926}\x{1927}-\x{1928}\x{1929}-\x{192B}\x{1930}-\x{1931}\x{1932}\x{1933}-\x{1938}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A19}-\x{1A1A}\x{1A1B}\x{1A55}\x{1A56}\x{1A57}\x{1A58}-\x{1A5E}\x{1A60}\x{1A61}\x{1A62}\x{1A63}-\x{1A64}\x{1A65}-\x{1A6C}\x{1A6D}-\x{1A72}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1ACE}\x{1B00}-\x{1B03}\x{1B04}\x{1B34}\x{1B35}\x{1B36}-\x{1B3A}\x{1B3B}\x{1B3C}\x{1B3D}-\x{1B41}\x{1B42}\x{1B43}-\x{1B44}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1B82}\x{1BA1}\x{1BA2}-\x{1BA5}\x{1BA6}-\x{1BA7}\x{1BA8}-\x{1BA9}\x{1BAA}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE7}\x{1BE8}-\x{1BE9}\x{1BEA}-\x{1BEC}\x{1BED}\x{1BEE}\x{1BEF}-\x{1BF1}\x{1BF2}-\x{1BF3}\x{1C24}-\x{1C2B}\x{1C2C}-\x{1C33}\x{1C34}-\x{1C35}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE1}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF7}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DFF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{302E}-\x{302F}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A823}-\x{A824}\x{A825}-\x{A826}\x{A827}\x{A82C}\x{A880}-\x{A881}\x{A8B4}-\x{A8C3}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A952}-\x{A953}\x{A980}-\x{A982}\x{A983}\x{A9B3}\x{A9B4}-\x{A9B5}\x{A9B6}-\x{A9B9}\x{A9BA}-\x{A9BB}\x{A9BC}-\x{A9BD}\x{A9BE}-\x{A9C0}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA2F}-\x{AA30}\x{AA31}-\x{AA32}\x{AA33}-\x{AA34}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA4D}\x{AA7B}\x{AA7C}\x{AA7D}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEB}\x{AAEC}-\x{AAED}\x{AAEE}-\x{AAEF}\x{AAF5}\x{AAF6}\x{ABE3}-\x{ABE4}\x{ABE5}\x{ABE6}-\x{ABE7}\x{ABE8}\x{ABE9}-\x{ABEA}\x{ABEC}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10EFD}-\x{10EFF}\x{10F46}-\x{10F50}\x{10F82}-\x{10F85}\x{11000}\x{11001}\x{11002}\x{11038}-\x{11046}\x{11070}\x{11073}-\x{11074}\x{1107F}-\x{11081}\x{11082}\x{110B0}-\x{110B2}\x{110B3}-\x{110B6}\x{110B7}-\x{110B8}\x{110B9}-\x{110BA}\x{110C2}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112C}\x{1112D}-\x{11134}\x{11145}-\x{11146}\x{11173}\x{11180}-\x{11181}\x{11182}\x{111B3}-\x{111B5}\x{111B6}-\x{111BE}\x{111BF}-\x{111C0}\x{111C9}-\x{111CC}\x{111CE}\x{111CF}\x{1122C}-\x{1122E}\x{1122F}-\x{11231}\x{11232}-\x{11233}\x{11234}\x{11235}\x{11236}-\x{11237}\x{1123E}\x{11241}\x{112DF}\x{112E0}-\x{112E2}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{11302}-\x{11303}\x{1133B}-\x{1133C}\x{1133E}-\x{1133F}\x{11340}\x{11341}-\x{11344}\x{11347}-\x{11348}\x{1134B}-\x{1134D}\x{11357}\x{11362}-\x{11363}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11435}-\x{11437}\x{11438}-\x{1143F}\x{11440}-\x{11441}\x{11442}-\x{11444}\x{11445}\x{11446}\x{1145E}\x{114B0}-\x{114B2}\x{114B3}-\x{114B8}\x{114B9}\x{114BA}\x{114BB}-\x{114BE}\x{114BF}-\x{114C0}\x{114C1}\x{114C2}-\x{114C3}\x{115AF}-\x{115B1}\x{115B2}-\x{115B5}\x{115B8}-\x{115BB}\x{115BC}-\x{115BD}\x{115BE}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11630}-\x{11632}\x{11633}-\x{1163A}\x{1163B}-\x{1163C}\x{1163D}\x{1163E}\x{1163F}-\x{11640}\x{116AB}\x{116AC}\x{116AD}\x{116AE}-\x{116AF}\x{116B0}-\x{116B5}\x{116B6}\x{116B7}\x{1171D}-\x{1171F}\x{11720}-\x{11721}\x{11722}-\x{11725}\x{11726}\x{11727}-\x{1172B}\x{1182C}-\x{1182E}\x{1182F}-\x{11837}\x{11838}\x{11839}-\x{1183A}\x{11930}-\x{11935}\x{11937}-\x{11938}\x{1193B}-\x{1193C}\x{1193D}\x{1193E}\x{11940}\x{11942}\x{11943}\x{119D1}-\x{119D3}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119DC}-\x{119DF}\x{119E0}\x{119E4}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A39}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A57}-\x{11A58}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A97}\x{11A98}-\x{11A99}\x{11C2F}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3E}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CA9}\x{11CAA}-\x{11CB0}\x{11CB1}\x{11CB2}-\x{11CB3}\x{11CB4}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D8A}-\x{11D8E}\x{11D90}-\x{11D91}\x{11D93}-\x{11D94}\x{11D95}\x{11D96}\x{11D97}\x{11EF3}-\x{11EF4}\x{11EF5}-\x{11EF6}\x{11F00}-\x{11F01}\x{11F03}\x{11F34}-\x{11F35}\x{11F36}-\x{11F3A}\x{11F3E}-\x{11F3F}\x{11F40}\x{11F41}\x{11F42}\x{13440}\x{13447}-\x{13455}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F51}-\x{16F87}\x{16F8F}-\x{16F92}\x{16FE4}\x{16FF0}-\x{16FF1}\x{1BC9D}-\x{1BC9E}\x{1CF00}-\x{1CF2D}\x{1CF30}-\x{1CF46}\x{1D165}-\x{1D166}\x{1D167}-\x{1D169}\x{1D16D}-\x{1D172}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E08F}\x{1E130}-\x{1E136}\x{1E2AE}\x{1E2EC}-\x{1E2EF}\x{1E4EC}-\x{1E4EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{E0100}-\x{E01EF}]/u'; - const RTL_LABEL = '/[\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06DD}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08E2}\x{200F}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFE}-\x{FDFF}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}]/u'; + const RTL_LABEL = '/[\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06DD}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{0887}\x{0888}\x{0889}-\x{088E}\x{088F}\x{0890}-\x{0891}\x{0892}-\x{0897}\x{08A0}-\x{08C8}\x{08C9}\x{08E2}\x{200F}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC2}\x{FBC3}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCE}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EBF}\x{10EC0}-\x{10EFC}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10F81}\x{10F86}-\x{10F89}\x{10F8A}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}]/u'; - const BIDI_STEP_1_LTR = '/^[^\x{0000}-\x{0008}\x{0009}\x{000A}\x{000B}\x{000C}\x{000D}\x{000E}-\x{001B}\x{001C}-\x{001E}\x{001F}\x{0020}\x{0021}-\x{0022}\x{0023}\x{0024}\x{0025}\x{0026}-\x{0027}\x{0028}\x{0029}\x{002A}\x{002B}\x{002C}\x{002D}\x{002E}-\x{002F}\x{0030}-\x{0039}\x{003A}\x{003B}\x{003C}-\x{003E}\x{003F}-\x{0040}\x{005B}\x{005C}\x{005D}\x{005E}\x{005F}\x{0060}\x{007B}\x{007C}\x{007D}\x{007E}\x{007F}-\x{0084}\x{0085}\x{0086}-\x{009F}\x{00A0}\x{00A1}\x{00A2}-\x{00A5}\x{00A6}\x{00A7}\x{00A8}\x{00A9}\x{00AB}\x{00AC}\x{00AD}\x{00AE}\x{00AF}\x{00B0}\x{00B1}\x{00B2}-\x{00B3}\x{00B4}\x{00B6}-\x{00B7}\x{00B8}\x{00B9}\x{00BB}\x{00BC}-\x{00BE}\x{00BF}\x{00D7}\x{00F7}\x{02B9}-\x{02BA}\x{02C2}-\x{02C5}\x{02C6}-\x{02CF}\x{02D2}-\x{02DF}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037E}\x{0384}-\x{0385}\x{0387}\x{03F6}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{058A}\x{058D}-\x{058E}\x{058F}\x{0590}\x{0591}-\x{05BD}\x{05BE}\x{05BF}\x{05C0}\x{05C1}-\x{05C2}\x{05C3}\x{05C4}-\x{05C5}\x{05C6}\x{05C7}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0606}-\x{0607}\x{0608}\x{0609}-\x{060A}\x{060B}\x{060C}\x{060D}\x{060E}-\x{060F}\x{0610}-\x{061A}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{064B}-\x{065F}\x{0660}-\x{0669}\x{066A}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0670}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06D6}-\x{06DC}\x{06DD}\x{06DE}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06E9}\x{06EA}-\x{06ED}\x{06EE}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0711}\x{0712}-\x{072F}\x{0730}-\x{074A}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07A6}-\x{07B0}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07F6}\x{07F7}-\x{07F9}\x{07FA}\x{07FB}-\x{07FC}\x{07FD}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{0859}-\x{085B}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08D3}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09F2}-\x{09F3}\x{09FB}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AF1}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0BF3}-\x{0BF8}\x{0BF9}\x{0BFA}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C78}-\x{0C7E}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E3F}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3A}\x{0F3B}\x{0F3C}\x{0F3D}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1390}-\x{1399}\x{1400}\x{1680}\x{169B}\x{169C}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DB}\x{17DD}\x{17F0}-\x{17F9}\x{1800}-\x{1805}\x{1806}\x{1807}-\x{180A}\x{180B}-\x{180D}\x{180E}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1940}\x{1944}-\x{1945}\x{19DE}-\x{19FF}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{2000}-\x{200A}\x{200B}-\x{200D}\x{200F}\x{2010}-\x{2015}\x{2016}-\x{2017}\x{2018}\x{2019}\x{201A}\x{201B}-\x{201C}\x{201D}\x{201E}\x{201F}\x{2020}-\x{2027}\x{2028}\x{2029}\x{202A}\x{202B}\x{202C}\x{202D}\x{202E}\x{202F}\x{2030}-\x{2034}\x{2035}-\x{2038}\x{2039}\x{203A}\x{203B}-\x{203E}\x{203F}-\x{2040}\x{2041}-\x{2043}\x{2044}\x{2045}\x{2046}\x{2047}-\x{2051}\x{2052}\x{2053}\x{2054}\x{2055}-\x{205E}\x{205F}\x{2060}-\x{2064}\x{2065}\x{2066}\x{2067}\x{2068}\x{2069}\x{206A}-\x{206F}\x{2070}\x{2074}-\x{2079}\x{207A}-\x{207B}\x{207C}\x{207D}\x{207E}\x{2080}-\x{2089}\x{208A}-\x{208B}\x{208C}\x{208D}\x{208E}\x{20A0}-\x{20BF}\x{20C0}-\x{20CF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2100}-\x{2101}\x{2103}-\x{2106}\x{2108}-\x{2109}\x{2114}\x{2116}-\x{2117}\x{2118}\x{211E}-\x{2123}\x{2125}\x{2127}\x{2129}\x{212E}\x{213A}-\x{213B}\x{2140}-\x{2144}\x{214A}\x{214B}\x{214C}-\x{214D}\x{2150}-\x{215F}\x{2189}\x{218A}-\x{218B}\x{2190}-\x{2194}\x{2195}-\x{2199}\x{219A}-\x{219B}\x{219C}-\x{219F}\x{21A0}\x{21A1}-\x{21A2}\x{21A3}\x{21A4}-\x{21A5}\x{21A6}\x{21A7}-\x{21AD}\x{21AE}\x{21AF}-\x{21CD}\x{21CE}-\x{21CF}\x{21D0}-\x{21D1}\x{21D2}\x{21D3}\x{21D4}\x{21D5}-\x{21F3}\x{21F4}-\x{2211}\x{2212}\x{2213}\x{2214}-\x{22FF}\x{2300}-\x{2307}\x{2308}\x{2309}\x{230A}\x{230B}\x{230C}-\x{231F}\x{2320}-\x{2321}\x{2322}-\x{2328}\x{2329}\x{232A}\x{232B}-\x{2335}\x{237B}\x{237C}\x{237D}-\x{2394}\x{2396}-\x{239A}\x{239B}-\x{23B3}\x{23B4}-\x{23DB}\x{23DC}-\x{23E1}\x{23E2}-\x{2426}\x{2440}-\x{244A}\x{2460}-\x{2487}\x{2488}-\x{249B}\x{24EA}-\x{24FF}\x{2500}-\x{25B6}\x{25B7}\x{25B8}-\x{25C0}\x{25C1}\x{25C2}-\x{25F7}\x{25F8}-\x{25FF}\x{2600}-\x{266E}\x{266F}\x{2670}-\x{26AB}\x{26AD}-\x{2767}\x{2768}\x{2769}\x{276A}\x{276B}\x{276C}\x{276D}\x{276E}\x{276F}\x{2770}\x{2771}\x{2772}\x{2773}\x{2774}\x{2775}\x{2776}-\x{2793}\x{2794}-\x{27BF}\x{27C0}-\x{27C4}\x{27C5}\x{27C6}\x{27C7}-\x{27E5}\x{27E6}\x{27E7}\x{27E8}\x{27E9}\x{27EA}\x{27EB}\x{27EC}\x{27ED}\x{27EE}\x{27EF}\x{27F0}-\x{27FF}\x{2900}-\x{2982}\x{2983}\x{2984}\x{2985}\x{2986}\x{2987}\x{2988}\x{2989}\x{298A}\x{298B}\x{298C}\x{298D}\x{298E}\x{298F}\x{2990}\x{2991}\x{2992}\x{2993}\x{2994}\x{2995}\x{2996}\x{2997}\x{2998}\x{2999}-\x{29D7}\x{29D8}\x{29D9}\x{29DA}\x{29DB}\x{29DC}-\x{29FB}\x{29FC}\x{29FD}\x{29FE}-\x{2AFF}\x{2B00}-\x{2B2F}\x{2B30}-\x{2B44}\x{2B45}-\x{2B46}\x{2B47}-\x{2B4C}\x{2B4D}-\x{2B73}\x{2B76}-\x{2B95}\x{2B97}-\x{2BFF}\x{2CE5}-\x{2CEA}\x{2CEF}-\x{2CF1}\x{2CF9}-\x{2CFC}\x{2CFD}\x{2CFE}-\x{2CFF}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E00}-\x{2E01}\x{2E02}\x{2E03}\x{2E04}\x{2E05}\x{2E06}-\x{2E08}\x{2E09}\x{2E0A}\x{2E0B}\x{2E0C}\x{2E0D}\x{2E0E}-\x{2E16}\x{2E17}\x{2E18}-\x{2E19}\x{2E1A}\x{2E1B}\x{2E1C}\x{2E1D}\x{2E1E}-\x{2E1F}\x{2E20}\x{2E21}\x{2E22}\x{2E23}\x{2E24}\x{2E25}\x{2E26}\x{2E27}\x{2E28}\x{2E29}\x{2E2A}-\x{2E2E}\x{2E2F}\x{2E30}-\x{2E39}\x{2E3A}-\x{2E3B}\x{2E3C}-\x{2E3F}\x{2E40}\x{2E41}\x{2E42}\x{2E43}-\x{2E4F}\x{2E50}-\x{2E51}\x{2E52}\x{2E80}-\x{2E99}\x{2E9B}-\x{2EF3}\x{2F00}-\x{2FD5}\x{2FF0}-\x{2FFB}\x{3000}\x{3001}-\x{3003}\x{3004}\x{3008}\x{3009}\x{300A}\x{300B}\x{300C}\x{300D}\x{300E}\x{300F}\x{3010}\x{3011}\x{3012}-\x{3013}\x{3014}\x{3015}\x{3016}\x{3017}\x{3018}\x{3019}\x{301A}\x{301B}\x{301C}\x{301D}\x{301E}-\x{301F}\x{3020}\x{302A}-\x{302D}\x{3030}\x{3036}-\x{3037}\x{303D}\x{303E}-\x{303F}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{30A0}\x{30FB}\x{31C0}-\x{31E3}\x{321D}-\x{321E}\x{3250}\x{3251}-\x{325F}\x{327C}-\x{327E}\x{32B1}-\x{32BF}\x{32CC}-\x{32CF}\x{3377}-\x{337A}\x{33DE}-\x{33DF}\x{33FF}\x{4DC0}-\x{4DFF}\x{A490}-\x{A4C6}\x{A60D}-\x{A60F}\x{A66F}\x{A670}-\x{A672}\x{A673}\x{A674}-\x{A67D}\x{A67E}\x{A67F}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A788}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A828}-\x{A82B}\x{A82C}\x{A838}\x{A839}\x{A874}-\x{A877}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{AB6A}-\x{AB6B}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1D}\x{FB1E}\x{FB1F}-\x{FB28}\x{FB29}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD3E}\x{FD3F}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDD0}-\x{FDEF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFD}\x{FDFE}-\x{FDFF}\x{FE00}-\x{FE0F}\x{FE10}-\x{FE16}\x{FE17}\x{FE18}\x{FE19}\x{FE20}-\x{FE2F}\x{FE30}\x{FE31}-\x{FE32}\x{FE33}-\x{FE34}\x{FE35}\x{FE36}\x{FE37}\x{FE38}\x{FE39}\x{FE3A}\x{FE3B}\x{FE3C}\x{FE3D}\x{FE3E}\x{FE3F}\x{FE40}\x{FE41}\x{FE42}\x{FE43}\x{FE44}\x{FE45}-\x{FE46}\x{FE47}\x{FE48}\x{FE49}-\x{FE4C}\x{FE4D}-\x{FE4F}\x{FE50}\x{FE51}\x{FE52}\x{FE54}\x{FE55}\x{FE56}-\x{FE57}\x{FE58}\x{FE59}\x{FE5A}\x{FE5B}\x{FE5C}\x{FE5D}\x{FE5E}\x{FE5F}\x{FE60}-\x{FE61}\x{FE62}\x{FE63}\x{FE64}-\x{FE66}\x{FE68}\x{FE69}\x{FE6A}\x{FE6B}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FEFF}\x{FF01}-\x{FF02}\x{FF03}\x{FF04}\x{FF05}\x{FF06}-\x{FF07}\x{FF08}\x{FF09}\x{FF0A}\x{FF0B}\x{FF0C}\x{FF0D}\x{FF0E}-\x{FF0F}\x{FF10}-\x{FF19}\x{FF1A}\x{FF1B}\x{FF1C}-\x{FF1E}\x{FF1F}-\x{FF20}\x{FF3B}\x{FF3C}\x{FF3D}\x{FF3E}\x{FF3F}\x{FF40}\x{FF5B}\x{FF5C}\x{FF5D}\x{FF5E}\x{FF5F}\x{FF60}\x{FF61}\x{FF62}\x{FF63}\x{FF64}-\x{FF65}\x{FFE0}-\x{FFE1}\x{FFE2}\x{FFE3}\x{FFE4}\x{FFE5}-\x{FFE6}\x{FFE8}\x{FFE9}-\x{FFEC}\x{FFED}-\x{FFEE}\x{FFF0}-\x{FFF8}\x{FFF9}-\x{FFFB}\x{FFFC}-\x{FFFD}\x{FFFE}-\x{FFFF}\x{10101}\x{10140}-\x{10174}\x{10175}-\x{10178}\x{10179}-\x{10189}\x{1018A}-\x{1018B}\x{1018C}\x{10190}-\x{1019C}\x{101A0}\x{101FD}\x{102E0}\x{102E1}-\x{102FB}\x{10376}-\x{1037A}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{1091F}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A01}-\x{10A03}\x{10A04}\x{10A05}-\x{10A06}\x{10A07}-\x{10A0B}\x{10A0C}-\x{10A0F}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A38}-\x{10A3A}\x{10A3B}-\x{10A3E}\x{10A3F}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE5}-\x{10AE6}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B39}-\x{10B3F}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D24}-\x{10D27}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAB}-\x{10EAC}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F46}-\x{10F50}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{11001}\x{11038}-\x{11046}\x{11052}-\x{11065}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{11660}-\x{1166C}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11FD5}-\x{11FDC}\x{11FDD}-\x{11FE0}\x{11FE1}-\x{11FF1}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE2}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D200}-\x{1D241}\x{1D242}-\x{1D244}\x{1D245}\x{1D300}-\x{1D356}\x{1D6DB}\x{1D715}\x{1D74F}\x{1D789}\x{1D7C3}\x{1D7CE}-\x{1D7FF}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E2FF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D0}-\x{1E8D6}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E944}-\x{1E94A}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF0}-\x{1EEF1}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F000}-\x{1F02B}\x{1F030}-\x{1F093}\x{1F0A0}-\x{1F0AE}\x{1F0B1}-\x{1F0BF}\x{1F0C1}-\x{1F0CF}\x{1F0D1}-\x{1F0F5}\x{1F100}-\x{1F10A}\x{1F10B}-\x{1F10C}\x{1F10D}-\x{1F10F}\x{1F12F}\x{1F16A}-\x{1F16F}\x{1F1AD}\x{1F260}-\x{1F265}\x{1F300}-\x{1F3FA}\x{1F3FB}-\x{1F3FF}\x{1F400}-\x{1F6D7}\x{1F6E0}-\x{1F6EC}\x{1F6F0}-\x{1F6FC}\x{1F700}-\x{1F773}\x{1F780}-\x{1F7D8}\x{1F7E0}-\x{1F7EB}\x{1F800}-\x{1F80B}\x{1F810}-\x{1F847}\x{1F850}-\x{1F859}\x{1F860}-\x{1F887}\x{1F890}-\x{1F8AD}\x{1F8B0}-\x{1F8B1}\x{1F900}-\x{1F978}\x{1F97A}-\x{1F9CB}\x{1F9CD}-\x{1FA53}\x{1FA60}-\x{1FA6D}\x{1FA70}-\x{1FA74}\x{1FA78}-\x{1FA7A}\x{1FA80}-\x{1FA86}\x{1FA90}-\x{1FAA8}\x{1FAB0}-\x{1FAB6}\x{1FAC0}-\x{1FAC2}\x{1FAD0}-\x{1FAD6}\x{1FB00}-\x{1FB92}\x{1FB94}-\x{1FBCA}\x{1FBF0}-\x{1FBF9}\x{1FFFE}-\x{1FFFF}\x{2FFFE}-\x{2FFFF}\x{3FFFE}-\x{3FFFF}\x{4FFFE}-\x{4FFFF}\x{5FFFE}-\x{5FFFF}\x{6FFFE}-\x{6FFFF}\x{7FFFE}-\x{7FFFF}\x{8FFFE}-\x{8FFFF}\x{9FFFE}-\x{9FFFF}\x{AFFFE}-\x{AFFFF}\x{BFFFE}-\x{BFFFF}\x{CFFFE}-\x{CFFFF}\x{DFFFE}-\x{E0000}\x{E0001}\x{E0002}-\x{E001F}\x{E0020}-\x{E007F}\x{E0080}-\x{E00FF}\x{E0100}-\x{E01EF}\x{E01F0}-\x{E0FFF}\x{EFFFE}-\x{EFFFF}\x{FFFFE}-\x{FFFFF}\x{10FFFE}-\x{10FFFF}]/u'; - const BIDI_STEP_1_RTL = '/^[\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{200F}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFE}-\x{FDFF}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}]/u'; - const BIDI_STEP_2 = '/[^\x{0000}-\x{0008}\x{000E}-\x{001B}\x{0021}-\x{0022}\x{0023}\x{0024}\x{0025}\x{0026}-\x{0027}\x{0028}\x{0029}\x{002A}\x{002B}\x{002C}\x{002D}\x{002E}-\x{002F}\x{0030}-\x{0039}\x{003A}\x{003B}\x{003C}-\x{003E}\x{003F}-\x{0040}\x{005B}\x{005C}\x{005D}\x{005E}\x{005F}\x{0060}\x{007B}\x{007C}\x{007D}\x{007E}\x{007F}-\x{0084}\x{0086}-\x{009F}\x{00A0}\x{00A1}\x{00A2}-\x{00A5}\x{00A6}\x{00A7}\x{00A8}\x{00A9}\x{00AB}\x{00AC}\x{00AD}\x{00AE}\x{00AF}\x{00B0}\x{00B1}\x{00B2}-\x{00B3}\x{00B4}\x{00B6}-\x{00B7}\x{00B8}\x{00B9}\x{00BB}\x{00BC}-\x{00BE}\x{00BF}\x{00D7}\x{00F7}\x{02B9}-\x{02BA}\x{02C2}-\x{02C5}\x{02C6}-\x{02CF}\x{02D2}-\x{02DF}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037E}\x{0384}-\x{0385}\x{0387}\x{03F6}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{058A}\x{058D}-\x{058E}\x{058F}\x{0590}\x{0591}-\x{05BD}\x{05BE}\x{05BF}\x{05C0}\x{05C1}-\x{05C2}\x{05C3}\x{05C4}-\x{05C5}\x{05C6}\x{05C7}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0606}-\x{0607}\x{0608}\x{0609}-\x{060A}\x{060B}\x{060C}\x{060D}\x{060E}-\x{060F}\x{0610}-\x{061A}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{064B}-\x{065F}\x{0660}-\x{0669}\x{066A}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0670}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06D6}-\x{06DC}\x{06DD}\x{06DE}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06E9}\x{06EA}-\x{06ED}\x{06EE}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0711}\x{0712}-\x{072F}\x{0730}-\x{074A}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07A6}-\x{07B0}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07F6}\x{07F7}-\x{07F9}\x{07FA}\x{07FB}-\x{07FC}\x{07FD}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{0859}-\x{085B}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08D3}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09F2}-\x{09F3}\x{09FB}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AF1}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0BF3}-\x{0BF8}\x{0BF9}\x{0BFA}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C78}-\x{0C7E}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E3F}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3A}\x{0F3B}\x{0F3C}\x{0F3D}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1390}-\x{1399}\x{1400}\x{169B}\x{169C}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DB}\x{17DD}\x{17F0}-\x{17F9}\x{1800}-\x{1805}\x{1806}\x{1807}-\x{180A}\x{180B}-\x{180D}\x{180E}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1940}\x{1944}-\x{1945}\x{19DE}-\x{19FF}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{200B}-\x{200D}\x{200F}\x{2010}-\x{2015}\x{2016}-\x{2017}\x{2018}\x{2019}\x{201A}\x{201B}-\x{201C}\x{201D}\x{201E}\x{201F}\x{2020}-\x{2027}\x{202F}\x{2030}-\x{2034}\x{2035}-\x{2038}\x{2039}\x{203A}\x{203B}-\x{203E}\x{203F}-\x{2040}\x{2041}-\x{2043}\x{2044}\x{2045}\x{2046}\x{2047}-\x{2051}\x{2052}\x{2053}\x{2054}\x{2055}-\x{205E}\x{2060}-\x{2064}\x{2065}\x{206A}-\x{206F}\x{2070}\x{2074}-\x{2079}\x{207A}-\x{207B}\x{207C}\x{207D}\x{207E}\x{2080}-\x{2089}\x{208A}-\x{208B}\x{208C}\x{208D}\x{208E}\x{20A0}-\x{20BF}\x{20C0}-\x{20CF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2100}-\x{2101}\x{2103}-\x{2106}\x{2108}-\x{2109}\x{2114}\x{2116}-\x{2117}\x{2118}\x{211E}-\x{2123}\x{2125}\x{2127}\x{2129}\x{212E}\x{213A}-\x{213B}\x{2140}-\x{2144}\x{214A}\x{214B}\x{214C}-\x{214D}\x{2150}-\x{215F}\x{2189}\x{218A}-\x{218B}\x{2190}-\x{2194}\x{2195}-\x{2199}\x{219A}-\x{219B}\x{219C}-\x{219F}\x{21A0}\x{21A1}-\x{21A2}\x{21A3}\x{21A4}-\x{21A5}\x{21A6}\x{21A7}-\x{21AD}\x{21AE}\x{21AF}-\x{21CD}\x{21CE}-\x{21CF}\x{21D0}-\x{21D1}\x{21D2}\x{21D3}\x{21D4}\x{21D5}-\x{21F3}\x{21F4}-\x{2211}\x{2212}\x{2213}\x{2214}-\x{22FF}\x{2300}-\x{2307}\x{2308}\x{2309}\x{230A}\x{230B}\x{230C}-\x{231F}\x{2320}-\x{2321}\x{2322}-\x{2328}\x{2329}\x{232A}\x{232B}-\x{2335}\x{237B}\x{237C}\x{237D}-\x{2394}\x{2396}-\x{239A}\x{239B}-\x{23B3}\x{23B4}-\x{23DB}\x{23DC}-\x{23E1}\x{23E2}-\x{2426}\x{2440}-\x{244A}\x{2460}-\x{2487}\x{2488}-\x{249B}\x{24EA}-\x{24FF}\x{2500}-\x{25B6}\x{25B7}\x{25B8}-\x{25C0}\x{25C1}\x{25C2}-\x{25F7}\x{25F8}-\x{25FF}\x{2600}-\x{266E}\x{266F}\x{2670}-\x{26AB}\x{26AD}-\x{2767}\x{2768}\x{2769}\x{276A}\x{276B}\x{276C}\x{276D}\x{276E}\x{276F}\x{2770}\x{2771}\x{2772}\x{2773}\x{2774}\x{2775}\x{2776}-\x{2793}\x{2794}-\x{27BF}\x{27C0}-\x{27C4}\x{27C5}\x{27C6}\x{27C7}-\x{27E5}\x{27E6}\x{27E7}\x{27E8}\x{27E9}\x{27EA}\x{27EB}\x{27EC}\x{27ED}\x{27EE}\x{27EF}\x{27F0}-\x{27FF}\x{2900}-\x{2982}\x{2983}\x{2984}\x{2985}\x{2986}\x{2987}\x{2988}\x{2989}\x{298A}\x{298B}\x{298C}\x{298D}\x{298E}\x{298F}\x{2990}\x{2991}\x{2992}\x{2993}\x{2994}\x{2995}\x{2996}\x{2997}\x{2998}\x{2999}-\x{29D7}\x{29D8}\x{29D9}\x{29DA}\x{29DB}\x{29DC}-\x{29FB}\x{29FC}\x{29FD}\x{29FE}-\x{2AFF}\x{2B00}-\x{2B2F}\x{2B30}-\x{2B44}\x{2B45}-\x{2B46}\x{2B47}-\x{2B4C}\x{2B4D}-\x{2B73}\x{2B76}-\x{2B95}\x{2B97}-\x{2BFF}\x{2CE5}-\x{2CEA}\x{2CEF}-\x{2CF1}\x{2CF9}-\x{2CFC}\x{2CFD}\x{2CFE}-\x{2CFF}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E00}-\x{2E01}\x{2E02}\x{2E03}\x{2E04}\x{2E05}\x{2E06}-\x{2E08}\x{2E09}\x{2E0A}\x{2E0B}\x{2E0C}\x{2E0D}\x{2E0E}-\x{2E16}\x{2E17}\x{2E18}-\x{2E19}\x{2E1A}\x{2E1B}\x{2E1C}\x{2E1D}\x{2E1E}-\x{2E1F}\x{2E20}\x{2E21}\x{2E22}\x{2E23}\x{2E24}\x{2E25}\x{2E26}\x{2E27}\x{2E28}\x{2E29}\x{2E2A}-\x{2E2E}\x{2E2F}\x{2E30}-\x{2E39}\x{2E3A}-\x{2E3B}\x{2E3C}-\x{2E3F}\x{2E40}\x{2E41}\x{2E42}\x{2E43}-\x{2E4F}\x{2E50}-\x{2E51}\x{2E52}\x{2E80}-\x{2E99}\x{2E9B}-\x{2EF3}\x{2F00}-\x{2FD5}\x{2FF0}-\x{2FFB}\x{3001}-\x{3003}\x{3004}\x{3008}\x{3009}\x{300A}\x{300B}\x{300C}\x{300D}\x{300E}\x{300F}\x{3010}\x{3011}\x{3012}-\x{3013}\x{3014}\x{3015}\x{3016}\x{3017}\x{3018}\x{3019}\x{301A}\x{301B}\x{301C}\x{301D}\x{301E}-\x{301F}\x{3020}\x{302A}-\x{302D}\x{3030}\x{3036}-\x{3037}\x{303D}\x{303E}-\x{303F}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{30A0}\x{30FB}\x{31C0}-\x{31E3}\x{321D}-\x{321E}\x{3250}\x{3251}-\x{325F}\x{327C}-\x{327E}\x{32B1}-\x{32BF}\x{32CC}-\x{32CF}\x{3377}-\x{337A}\x{33DE}-\x{33DF}\x{33FF}\x{4DC0}-\x{4DFF}\x{A490}-\x{A4C6}\x{A60D}-\x{A60F}\x{A66F}\x{A670}-\x{A672}\x{A673}\x{A674}-\x{A67D}\x{A67E}\x{A67F}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A788}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A828}-\x{A82B}\x{A82C}\x{A838}\x{A839}\x{A874}-\x{A877}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{AB6A}-\x{AB6B}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1D}\x{FB1E}\x{FB1F}-\x{FB28}\x{FB29}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD3E}\x{FD3F}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDD0}-\x{FDEF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFD}\x{FDFE}-\x{FDFF}\x{FE00}-\x{FE0F}\x{FE10}-\x{FE16}\x{FE17}\x{FE18}\x{FE19}\x{FE20}-\x{FE2F}\x{FE30}\x{FE31}-\x{FE32}\x{FE33}-\x{FE34}\x{FE35}\x{FE36}\x{FE37}\x{FE38}\x{FE39}\x{FE3A}\x{FE3B}\x{FE3C}\x{FE3D}\x{FE3E}\x{FE3F}\x{FE40}\x{FE41}\x{FE42}\x{FE43}\x{FE44}\x{FE45}-\x{FE46}\x{FE47}\x{FE48}\x{FE49}-\x{FE4C}\x{FE4D}-\x{FE4F}\x{FE50}\x{FE51}\x{FE52}\x{FE54}\x{FE55}\x{FE56}-\x{FE57}\x{FE58}\x{FE59}\x{FE5A}\x{FE5B}\x{FE5C}\x{FE5D}\x{FE5E}\x{FE5F}\x{FE60}-\x{FE61}\x{FE62}\x{FE63}\x{FE64}-\x{FE66}\x{FE68}\x{FE69}\x{FE6A}\x{FE6B}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FEFF}\x{FF01}-\x{FF02}\x{FF03}\x{FF04}\x{FF05}\x{FF06}-\x{FF07}\x{FF08}\x{FF09}\x{FF0A}\x{FF0B}\x{FF0C}\x{FF0D}\x{FF0E}-\x{FF0F}\x{FF10}-\x{FF19}\x{FF1A}\x{FF1B}\x{FF1C}-\x{FF1E}\x{FF1F}-\x{FF20}\x{FF3B}\x{FF3C}\x{FF3D}\x{FF3E}\x{FF3F}\x{FF40}\x{FF5B}\x{FF5C}\x{FF5D}\x{FF5E}\x{FF5F}\x{FF60}\x{FF61}\x{FF62}\x{FF63}\x{FF64}-\x{FF65}\x{FFE0}-\x{FFE1}\x{FFE2}\x{FFE3}\x{FFE4}\x{FFE5}-\x{FFE6}\x{FFE8}\x{FFE9}-\x{FFEC}\x{FFED}-\x{FFEE}\x{FFF0}-\x{FFF8}\x{FFF9}-\x{FFFB}\x{FFFC}-\x{FFFD}\x{FFFE}-\x{FFFF}\x{10101}\x{10140}-\x{10174}\x{10175}-\x{10178}\x{10179}-\x{10189}\x{1018A}-\x{1018B}\x{1018C}\x{10190}-\x{1019C}\x{101A0}\x{101FD}\x{102E0}\x{102E1}-\x{102FB}\x{10376}-\x{1037A}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{1091F}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A01}-\x{10A03}\x{10A04}\x{10A05}-\x{10A06}\x{10A07}-\x{10A0B}\x{10A0C}-\x{10A0F}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A38}-\x{10A3A}\x{10A3B}-\x{10A3E}\x{10A3F}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE5}-\x{10AE6}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B39}-\x{10B3F}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D24}-\x{10D27}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAB}-\x{10EAC}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F46}-\x{10F50}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{11001}\x{11038}-\x{11046}\x{11052}-\x{11065}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{11660}-\x{1166C}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11FD5}-\x{11FDC}\x{11FDD}-\x{11FE0}\x{11FE1}-\x{11FF1}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE2}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D200}-\x{1D241}\x{1D242}-\x{1D244}\x{1D245}\x{1D300}-\x{1D356}\x{1D6DB}\x{1D715}\x{1D74F}\x{1D789}\x{1D7C3}\x{1D7CE}-\x{1D7FF}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E2FF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D0}-\x{1E8D6}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E944}-\x{1E94A}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF0}-\x{1EEF1}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F000}-\x{1F02B}\x{1F030}-\x{1F093}\x{1F0A0}-\x{1F0AE}\x{1F0B1}-\x{1F0BF}\x{1F0C1}-\x{1F0CF}\x{1F0D1}-\x{1F0F5}\x{1F100}-\x{1F10A}\x{1F10B}-\x{1F10C}\x{1F10D}-\x{1F10F}\x{1F12F}\x{1F16A}-\x{1F16F}\x{1F1AD}\x{1F260}-\x{1F265}\x{1F300}-\x{1F3FA}\x{1F3FB}-\x{1F3FF}\x{1F400}-\x{1F6D7}\x{1F6E0}-\x{1F6EC}\x{1F6F0}-\x{1F6FC}\x{1F700}-\x{1F773}\x{1F780}-\x{1F7D8}\x{1F7E0}-\x{1F7EB}\x{1F800}-\x{1F80B}\x{1F810}-\x{1F847}\x{1F850}-\x{1F859}\x{1F860}-\x{1F887}\x{1F890}-\x{1F8AD}\x{1F8B0}-\x{1F8B1}\x{1F900}-\x{1F978}\x{1F97A}-\x{1F9CB}\x{1F9CD}-\x{1FA53}\x{1FA60}-\x{1FA6D}\x{1FA70}-\x{1FA74}\x{1FA78}-\x{1FA7A}\x{1FA80}-\x{1FA86}\x{1FA90}-\x{1FAA8}\x{1FAB0}-\x{1FAB6}\x{1FAC0}-\x{1FAC2}\x{1FAD0}-\x{1FAD6}\x{1FB00}-\x{1FB92}\x{1FB94}-\x{1FBCA}\x{1FBF0}-\x{1FBF9}\x{1FFFE}-\x{1FFFF}\x{2FFFE}-\x{2FFFF}\x{3FFFE}-\x{3FFFF}\x{4FFFE}-\x{4FFFF}\x{5FFFE}-\x{5FFFF}\x{6FFFE}-\x{6FFFF}\x{7FFFE}-\x{7FFFF}\x{8FFFE}-\x{8FFFF}\x{9FFFE}-\x{9FFFF}\x{AFFFE}-\x{AFFFF}\x{BFFFE}-\x{BFFFF}\x{CFFFE}-\x{CFFFF}\x{DFFFE}-\x{E0000}\x{E0001}\x{E0002}-\x{E001F}\x{E0020}-\x{E007F}\x{E0080}-\x{E00FF}\x{E0100}-\x{E01EF}\x{E01F0}-\x{E0FFF}\x{EFFFE}-\x{EFFFF}\x{FFFFE}-\x{FFFFF}\x{10FFFE}-\x{10FFFF}]/u'; - const BIDI_STEP_3 = '/[\x{0030}-\x{0039}\x{00B2}-\x{00B3}\x{00B9}\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06DD}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08E2}\x{200F}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2488}-\x{249B}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFE}-\x{FDFF}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FF10}-\x{FF19}\x{102E1}-\x{102FB}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1D7CE}-\x{1D7FF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F100}-\x{1F10A}\x{1FBF0}-\x{1FBF9}][\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1D167}-\x{1D169}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{E0100}-\x{E01EF}]*$/u'; - const BIDI_STEP_4_AN = '/[\x{0600}-\x{0605}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{06DD}\x{08E2}\x{10D30}-\x{10D39}\x{10E60}-\x{10E7E}]/u'; + const BIDI_STEP_1_LTR = '/^[^\x{0000}-\x{0008}\x{0009}\x{000A}\x{000B}\x{000C}\x{000D}\x{000E}-\x{001B}\x{001C}-\x{001E}\x{001F}\x{0020}\x{0021}-\x{0022}\x{0023}\x{0024}\x{0025}\x{0026}-\x{0027}\x{0028}\x{0029}\x{002A}\x{002B}\x{002C}\x{002D}\x{002E}-\x{002F}\x{0030}-\x{0039}\x{003A}\x{003B}\x{003C}-\x{003E}\x{003F}-\x{0040}\x{005B}\x{005C}\x{005D}\x{005E}\x{005F}\x{0060}\x{007B}\x{007C}\x{007D}\x{007E}\x{007F}-\x{0084}\x{0085}\x{0086}-\x{009F}\x{00A0}\x{00A1}\x{00A2}-\x{00A5}\x{00A6}\x{00A7}\x{00A8}\x{00A9}\x{00AB}\x{00AC}\x{00AD}\x{00AE}\x{00AF}\x{00B0}\x{00B1}\x{00B2}-\x{00B3}\x{00B4}\x{00B6}-\x{00B7}\x{00B8}\x{00B9}\x{00BB}\x{00BC}-\x{00BE}\x{00BF}\x{00D7}\x{00F7}\x{02B9}-\x{02BA}\x{02C2}-\x{02C5}\x{02C6}-\x{02CF}\x{02D2}-\x{02DF}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037E}\x{0384}-\x{0385}\x{0387}\x{03F6}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{058A}\x{058D}-\x{058E}\x{058F}\x{0590}\x{0591}-\x{05BD}\x{05BE}\x{05BF}\x{05C0}\x{05C1}-\x{05C2}\x{05C3}\x{05C4}-\x{05C5}\x{05C6}\x{05C7}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0606}-\x{0607}\x{0608}\x{0609}-\x{060A}\x{060B}\x{060C}\x{060D}\x{060E}-\x{060F}\x{0610}-\x{061A}\x{061B}\x{061C}\x{061D}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{064B}-\x{065F}\x{0660}-\x{0669}\x{066A}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0670}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06D6}-\x{06DC}\x{06DD}\x{06DE}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06E9}\x{06EA}-\x{06ED}\x{06EE}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0711}\x{0712}-\x{072F}\x{0730}-\x{074A}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07A6}-\x{07B0}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07F6}\x{07F7}-\x{07F9}\x{07FA}\x{07FB}-\x{07FC}\x{07FD}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{0859}-\x{085B}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{0887}\x{0888}\x{0889}-\x{088E}\x{088F}\x{0890}-\x{0891}\x{0892}-\x{0897}\x{0898}-\x{089F}\x{08A0}-\x{08C8}\x{08C9}\x{08CA}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09F2}-\x{09F3}\x{09FB}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AF1}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0BF3}-\x{0BF8}\x{0BF9}\x{0BFA}\x{0C00}\x{0C04}\x{0C3C}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C78}-\x{0C7E}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E3F}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECE}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3A}\x{0F3B}\x{0F3C}\x{0F3D}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1390}-\x{1399}\x{1400}\x{1680}\x{169B}\x{169C}\x{1712}-\x{1714}\x{1732}-\x{1733}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DB}\x{17DD}\x{17F0}-\x{17F9}\x{1800}-\x{1805}\x{1806}\x{1807}-\x{180A}\x{180B}-\x{180D}\x{180E}\x{180F}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1940}\x{1944}-\x{1945}\x{19DE}-\x{19FF}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1ACE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{2000}-\x{200A}\x{200B}-\x{200D}\x{200F}\x{2010}-\x{2015}\x{2016}-\x{2017}\x{2018}\x{2019}\x{201A}\x{201B}-\x{201C}\x{201D}\x{201E}\x{201F}\x{2020}-\x{2027}\x{2028}\x{2029}\x{202A}\x{202B}\x{202C}\x{202D}\x{202E}\x{202F}\x{2030}-\x{2034}\x{2035}-\x{2038}\x{2039}\x{203A}\x{203B}-\x{203E}\x{203F}-\x{2040}\x{2041}-\x{2043}\x{2044}\x{2045}\x{2046}\x{2047}-\x{2051}\x{2052}\x{2053}\x{2054}\x{2055}-\x{205E}\x{205F}\x{2060}-\x{2064}\x{2065}\x{2066}\x{2067}\x{2068}\x{2069}\x{206A}-\x{206F}\x{2070}\x{2074}-\x{2079}\x{207A}-\x{207B}\x{207C}\x{207D}\x{207E}\x{2080}-\x{2089}\x{208A}-\x{208B}\x{208C}\x{208D}\x{208E}\x{20A0}-\x{20C0}\x{20C1}-\x{20CF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2100}-\x{2101}\x{2103}-\x{2106}\x{2108}-\x{2109}\x{2114}\x{2116}-\x{2117}\x{2118}\x{211E}-\x{2123}\x{2125}\x{2127}\x{2129}\x{212E}\x{213A}-\x{213B}\x{2140}-\x{2144}\x{214A}\x{214B}\x{214C}-\x{214D}\x{2150}-\x{215F}\x{2189}\x{218A}-\x{218B}\x{2190}-\x{2194}\x{2195}-\x{2199}\x{219A}-\x{219B}\x{219C}-\x{219F}\x{21A0}\x{21A1}-\x{21A2}\x{21A3}\x{21A4}-\x{21A5}\x{21A6}\x{21A7}-\x{21AD}\x{21AE}\x{21AF}-\x{21CD}\x{21CE}-\x{21CF}\x{21D0}-\x{21D1}\x{21D2}\x{21D3}\x{21D4}\x{21D5}-\x{21F3}\x{21F4}-\x{2211}\x{2212}\x{2213}\x{2214}-\x{22FF}\x{2300}-\x{2307}\x{2308}\x{2309}\x{230A}\x{230B}\x{230C}-\x{231F}\x{2320}-\x{2321}\x{2322}-\x{2328}\x{2329}\x{232A}\x{232B}-\x{2335}\x{237B}\x{237C}\x{237D}-\x{2394}\x{2396}-\x{239A}\x{239B}-\x{23B3}\x{23B4}-\x{23DB}\x{23DC}-\x{23E1}\x{23E2}-\x{2426}\x{2440}-\x{244A}\x{2460}-\x{2487}\x{2488}-\x{249B}\x{24EA}-\x{24FF}\x{2500}-\x{25B6}\x{25B7}\x{25B8}-\x{25C0}\x{25C1}\x{25C2}-\x{25F7}\x{25F8}-\x{25FF}\x{2600}-\x{266E}\x{266F}\x{2670}-\x{26AB}\x{26AD}-\x{2767}\x{2768}\x{2769}\x{276A}\x{276B}\x{276C}\x{276D}\x{276E}\x{276F}\x{2770}\x{2771}\x{2772}\x{2773}\x{2774}\x{2775}\x{2776}-\x{2793}\x{2794}-\x{27BF}\x{27C0}-\x{27C4}\x{27C5}\x{27C6}\x{27C7}-\x{27E5}\x{27E6}\x{27E7}\x{27E8}\x{27E9}\x{27EA}\x{27EB}\x{27EC}\x{27ED}\x{27EE}\x{27EF}\x{27F0}-\x{27FF}\x{2900}-\x{2982}\x{2983}\x{2984}\x{2985}\x{2986}\x{2987}\x{2988}\x{2989}\x{298A}\x{298B}\x{298C}\x{298D}\x{298E}\x{298F}\x{2990}\x{2991}\x{2992}\x{2993}\x{2994}\x{2995}\x{2996}\x{2997}\x{2998}\x{2999}-\x{29D7}\x{29D8}\x{29D9}\x{29DA}\x{29DB}\x{29DC}-\x{29FB}\x{29FC}\x{29FD}\x{29FE}-\x{2AFF}\x{2B00}-\x{2B2F}\x{2B30}-\x{2B44}\x{2B45}-\x{2B46}\x{2B47}-\x{2B4C}\x{2B4D}-\x{2B73}\x{2B76}-\x{2B95}\x{2B97}-\x{2BFF}\x{2CE5}-\x{2CEA}\x{2CEF}-\x{2CF1}\x{2CF9}-\x{2CFC}\x{2CFD}\x{2CFE}-\x{2CFF}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E00}-\x{2E01}\x{2E02}\x{2E03}\x{2E04}\x{2E05}\x{2E06}-\x{2E08}\x{2E09}\x{2E0A}\x{2E0B}\x{2E0C}\x{2E0D}\x{2E0E}-\x{2E16}\x{2E17}\x{2E18}-\x{2E19}\x{2E1A}\x{2E1B}\x{2E1C}\x{2E1D}\x{2E1E}-\x{2E1F}\x{2E20}\x{2E21}\x{2E22}\x{2E23}\x{2E24}\x{2E25}\x{2E26}\x{2E27}\x{2E28}\x{2E29}\x{2E2A}-\x{2E2E}\x{2E2F}\x{2E30}-\x{2E39}\x{2E3A}-\x{2E3B}\x{2E3C}-\x{2E3F}\x{2E40}\x{2E41}\x{2E42}\x{2E43}-\x{2E4F}\x{2E50}-\x{2E51}\x{2E52}-\x{2E54}\x{2E55}\x{2E56}\x{2E57}\x{2E58}\x{2E59}\x{2E5A}\x{2E5B}\x{2E5C}\x{2E5D}\x{2E80}-\x{2E99}\x{2E9B}-\x{2EF3}\x{2F00}-\x{2FD5}\x{2FF0}-\x{2FFF}\x{3000}\x{3001}-\x{3003}\x{3004}\x{3008}\x{3009}\x{300A}\x{300B}\x{300C}\x{300D}\x{300E}\x{300F}\x{3010}\x{3011}\x{3012}-\x{3013}\x{3014}\x{3015}\x{3016}\x{3017}\x{3018}\x{3019}\x{301A}\x{301B}\x{301C}\x{301D}\x{301E}-\x{301F}\x{3020}\x{302A}-\x{302D}\x{3030}\x{3036}-\x{3037}\x{303D}\x{303E}-\x{303F}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{30A0}\x{30FB}\x{31C0}-\x{31E3}\x{31EF}\x{321D}-\x{321E}\x{3250}\x{3251}-\x{325F}\x{327C}-\x{327E}\x{32B1}-\x{32BF}\x{32CC}-\x{32CF}\x{3377}-\x{337A}\x{33DE}-\x{33DF}\x{33FF}\x{4DC0}-\x{4DFF}\x{A490}-\x{A4C6}\x{A60D}-\x{A60F}\x{A66F}\x{A670}-\x{A672}\x{A673}\x{A674}-\x{A67D}\x{A67E}\x{A67F}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A788}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A828}-\x{A82B}\x{A82C}\x{A838}\x{A839}\x{A874}-\x{A877}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{AB6A}-\x{AB6B}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1D}\x{FB1E}\x{FB1F}-\x{FB28}\x{FB29}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC2}\x{FBC3}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD3E}\x{FD3F}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCE}\x{FDCF}\x{FDD0}-\x{FDEF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFD}-\x{FDFF}\x{FE00}-\x{FE0F}\x{FE10}-\x{FE16}\x{FE17}\x{FE18}\x{FE19}\x{FE20}-\x{FE2F}\x{FE30}\x{FE31}-\x{FE32}\x{FE33}-\x{FE34}\x{FE35}\x{FE36}\x{FE37}\x{FE38}\x{FE39}\x{FE3A}\x{FE3B}\x{FE3C}\x{FE3D}\x{FE3E}\x{FE3F}\x{FE40}\x{FE41}\x{FE42}\x{FE43}\x{FE44}\x{FE45}-\x{FE46}\x{FE47}\x{FE48}\x{FE49}-\x{FE4C}\x{FE4D}-\x{FE4F}\x{FE50}\x{FE51}\x{FE52}\x{FE54}\x{FE55}\x{FE56}-\x{FE57}\x{FE58}\x{FE59}\x{FE5A}\x{FE5B}\x{FE5C}\x{FE5D}\x{FE5E}\x{FE5F}\x{FE60}-\x{FE61}\x{FE62}\x{FE63}\x{FE64}-\x{FE66}\x{FE68}\x{FE69}\x{FE6A}\x{FE6B}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FEFF}\x{FF01}-\x{FF02}\x{FF03}\x{FF04}\x{FF05}\x{FF06}-\x{FF07}\x{FF08}\x{FF09}\x{FF0A}\x{FF0B}\x{FF0C}\x{FF0D}\x{FF0E}-\x{FF0F}\x{FF10}-\x{FF19}\x{FF1A}\x{FF1B}\x{FF1C}-\x{FF1E}\x{FF1F}-\x{FF20}\x{FF3B}\x{FF3C}\x{FF3D}\x{FF3E}\x{FF3F}\x{FF40}\x{FF5B}\x{FF5C}\x{FF5D}\x{FF5E}\x{FF5F}\x{FF60}\x{FF61}\x{FF62}\x{FF63}\x{FF64}-\x{FF65}\x{FFE0}-\x{FFE1}\x{FFE2}\x{FFE3}\x{FFE4}\x{FFE5}-\x{FFE6}\x{FFE8}\x{FFE9}-\x{FFEC}\x{FFED}-\x{FFEE}\x{FFF0}-\x{FFF8}\x{FFF9}-\x{FFFB}\x{FFFC}-\x{FFFD}\x{FFFE}-\x{FFFF}\x{10101}\x{10140}-\x{10174}\x{10175}-\x{10178}\x{10179}-\x{10189}\x{1018A}-\x{1018B}\x{1018C}\x{10190}-\x{1019C}\x{101A0}\x{101FD}\x{102E0}\x{102E1}-\x{102FB}\x{10376}-\x{1037A}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{1091F}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A01}-\x{10A03}\x{10A04}\x{10A05}-\x{10A06}\x{10A07}-\x{10A0B}\x{10A0C}-\x{10A0F}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A38}-\x{10A3A}\x{10A3B}-\x{10A3E}\x{10A3F}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE5}-\x{10AE6}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B39}-\x{10B3F}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D24}-\x{10D27}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAB}-\x{10EAC}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EBF}\x{10EC0}-\x{10EFC}\x{10EFD}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F46}-\x{10F50}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10F81}\x{10F82}-\x{10F85}\x{10F86}-\x{10F89}\x{10F8A}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{11001}\x{11038}-\x{11046}\x{11052}-\x{11065}\x{11070}\x{11073}-\x{11074}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110C2}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{11241}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{11660}-\x{1166C}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11F00}-\x{11F01}\x{11F36}-\x{11F3A}\x{11F40}\x{11F42}\x{11FD5}-\x{11FDC}\x{11FDD}-\x{11FE0}\x{11FE1}-\x{11FF1}\x{13440}\x{13447}-\x{13455}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE2}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1CF00}-\x{1CF2D}\x{1CF30}-\x{1CF46}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D1E9}-\x{1D1EA}\x{1D200}-\x{1D241}\x{1D242}-\x{1D244}\x{1D245}\x{1D300}-\x{1D356}\x{1D6DB}\x{1D715}\x{1D74F}\x{1D789}\x{1D7C3}\x{1D7CE}-\x{1D7FF}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E08F}\x{1E130}-\x{1E136}\x{1E2AE}\x{1E2EC}-\x{1E2EF}\x{1E2FF}\x{1E4EC}-\x{1E4EF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D0}-\x{1E8D6}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E944}-\x{1E94A}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF0}-\x{1EEF1}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F000}-\x{1F02B}\x{1F030}-\x{1F093}\x{1F0A0}-\x{1F0AE}\x{1F0B1}-\x{1F0BF}\x{1F0C1}-\x{1F0CF}\x{1F0D1}-\x{1F0F5}\x{1F100}-\x{1F10A}\x{1F10B}-\x{1F10C}\x{1F10D}-\x{1F10F}\x{1F12F}\x{1F16A}-\x{1F16F}\x{1F1AD}\x{1F260}-\x{1F265}\x{1F300}-\x{1F3FA}\x{1F3FB}-\x{1F3FF}\x{1F400}-\x{1F6D7}\x{1F6DC}-\x{1F6EC}\x{1F6F0}-\x{1F6FC}\x{1F700}-\x{1F776}\x{1F77B}-\x{1F7D9}\x{1F7E0}-\x{1F7EB}\x{1F7F0}\x{1F800}-\x{1F80B}\x{1F810}-\x{1F847}\x{1F850}-\x{1F859}\x{1F860}-\x{1F887}\x{1F890}-\x{1F8AD}\x{1F8B0}-\x{1F8B1}\x{1F900}-\x{1FA53}\x{1FA60}-\x{1FA6D}\x{1FA70}-\x{1FA7C}\x{1FA80}-\x{1FA88}\x{1FA90}-\x{1FABD}\x{1FABF}-\x{1FAC5}\x{1FACE}-\x{1FADB}\x{1FAE0}-\x{1FAE8}\x{1FAF0}-\x{1FAF8}\x{1FB00}-\x{1FB92}\x{1FB94}-\x{1FBCA}\x{1FBF0}-\x{1FBF9}\x{1FFFE}-\x{1FFFF}\x{2FFFE}-\x{2FFFF}\x{3FFFE}-\x{3FFFF}\x{4FFFE}-\x{4FFFF}\x{5FFFE}-\x{5FFFF}\x{6FFFE}-\x{6FFFF}\x{7FFFE}-\x{7FFFF}\x{8FFFE}-\x{8FFFF}\x{9FFFE}-\x{9FFFF}\x{AFFFE}-\x{AFFFF}\x{BFFFE}-\x{BFFFF}\x{CFFFE}-\x{CFFFF}\x{DFFFE}-\x{E0000}\x{E0001}\x{E0002}-\x{E001F}\x{E0020}-\x{E007F}\x{E0080}-\x{E00FF}\x{E0100}-\x{E01EF}\x{E01F0}-\x{E0FFF}\x{EFFFE}-\x{EFFFF}\x{FFFFE}-\x{FFFFF}\x{10FFFE}-\x{10FFFF}]/u'; + const BIDI_STEP_1_RTL = '/^[\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{0887}\x{0888}\x{0889}-\x{088E}\x{088F}\x{0892}-\x{0897}\x{08A0}-\x{08C8}\x{08C9}\x{200F}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC2}\x{FBC3}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCE}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EBF}\x{10EC0}-\x{10EFC}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10F81}\x{10F86}-\x{10F89}\x{10F8A}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}]/u'; + const BIDI_STEP_2 = '/[^\x{0000}-\x{0008}\x{000E}-\x{001B}\x{0021}-\x{0022}\x{0023}\x{0024}\x{0025}\x{0026}-\x{0027}\x{0028}\x{0029}\x{002A}\x{002B}\x{002C}\x{002D}\x{002E}-\x{002F}\x{0030}-\x{0039}\x{003A}\x{003B}\x{003C}-\x{003E}\x{003F}-\x{0040}\x{005B}\x{005C}\x{005D}\x{005E}\x{005F}\x{0060}\x{007B}\x{007C}\x{007D}\x{007E}\x{007F}-\x{0084}\x{0086}-\x{009F}\x{00A0}\x{00A1}\x{00A2}-\x{00A5}\x{00A6}\x{00A7}\x{00A8}\x{00A9}\x{00AB}\x{00AC}\x{00AD}\x{00AE}\x{00AF}\x{00B0}\x{00B1}\x{00B2}-\x{00B3}\x{00B4}\x{00B6}-\x{00B7}\x{00B8}\x{00B9}\x{00BB}\x{00BC}-\x{00BE}\x{00BF}\x{00D7}\x{00F7}\x{02B9}-\x{02BA}\x{02C2}-\x{02C5}\x{02C6}-\x{02CF}\x{02D2}-\x{02DF}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037E}\x{0384}-\x{0385}\x{0387}\x{03F6}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{058A}\x{058D}-\x{058E}\x{058F}\x{0590}\x{0591}-\x{05BD}\x{05BE}\x{05BF}\x{05C0}\x{05C1}-\x{05C2}\x{05C3}\x{05C4}-\x{05C5}\x{05C6}\x{05C7}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0606}-\x{0607}\x{0608}\x{0609}-\x{060A}\x{060B}\x{060C}\x{060D}\x{060E}-\x{060F}\x{0610}-\x{061A}\x{061B}\x{061C}\x{061D}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{064B}-\x{065F}\x{0660}-\x{0669}\x{066A}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0670}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06D6}-\x{06DC}\x{06DD}\x{06DE}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06E9}\x{06EA}-\x{06ED}\x{06EE}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0711}\x{0712}-\x{072F}\x{0730}-\x{074A}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07A6}-\x{07B0}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07F6}\x{07F7}-\x{07F9}\x{07FA}\x{07FB}-\x{07FC}\x{07FD}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{0859}-\x{085B}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{0887}\x{0888}\x{0889}-\x{088E}\x{088F}\x{0890}-\x{0891}\x{0892}-\x{0897}\x{0898}-\x{089F}\x{08A0}-\x{08C8}\x{08C9}\x{08CA}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09F2}-\x{09F3}\x{09FB}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AF1}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0BF3}-\x{0BF8}\x{0BF9}\x{0BFA}\x{0C00}\x{0C04}\x{0C3C}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C78}-\x{0C7E}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E3F}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECE}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3A}\x{0F3B}\x{0F3C}\x{0F3D}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1390}-\x{1399}\x{1400}\x{169B}\x{169C}\x{1712}-\x{1714}\x{1732}-\x{1733}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DB}\x{17DD}\x{17F0}-\x{17F9}\x{1800}-\x{1805}\x{1806}\x{1807}-\x{180A}\x{180B}-\x{180D}\x{180E}\x{180F}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1940}\x{1944}-\x{1945}\x{19DE}-\x{19FF}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1ACE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{200B}-\x{200D}\x{200F}\x{2010}-\x{2015}\x{2016}-\x{2017}\x{2018}\x{2019}\x{201A}\x{201B}-\x{201C}\x{201D}\x{201E}\x{201F}\x{2020}-\x{2027}\x{202F}\x{2030}-\x{2034}\x{2035}-\x{2038}\x{2039}\x{203A}\x{203B}-\x{203E}\x{203F}-\x{2040}\x{2041}-\x{2043}\x{2044}\x{2045}\x{2046}\x{2047}-\x{2051}\x{2052}\x{2053}\x{2054}\x{2055}-\x{205E}\x{2060}-\x{2064}\x{2065}\x{206A}-\x{206F}\x{2070}\x{2074}-\x{2079}\x{207A}-\x{207B}\x{207C}\x{207D}\x{207E}\x{2080}-\x{2089}\x{208A}-\x{208B}\x{208C}\x{208D}\x{208E}\x{20A0}-\x{20C0}\x{20C1}-\x{20CF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2100}-\x{2101}\x{2103}-\x{2106}\x{2108}-\x{2109}\x{2114}\x{2116}-\x{2117}\x{2118}\x{211E}-\x{2123}\x{2125}\x{2127}\x{2129}\x{212E}\x{213A}-\x{213B}\x{2140}-\x{2144}\x{214A}\x{214B}\x{214C}-\x{214D}\x{2150}-\x{215F}\x{2189}\x{218A}-\x{218B}\x{2190}-\x{2194}\x{2195}-\x{2199}\x{219A}-\x{219B}\x{219C}-\x{219F}\x{21A0}\x{21A1}-\x{21A2}\x{21A3}\x{21A4}-\x{21A5}\x{21A6}\x{21A7}-\x{21AD}\x{21AE}\x{21AF}-\x{21CD}\x{21CE}-\x{21CF}\x{21D0}-\x{21D1}\x{21D2}\x{21D3}\x{21D4}\x{21D5}-\x{21F3}\x{21F4}-\x{2211}\x{2212}\x{2213}\x{2214}-\x{22FF}\x{2300}-\x{2307}\x{2308}\x{2309}\x{230A}\x{230B}\x{230C}-\x{231F}\x{2320}-\x{2321}\x{2322}-\x{2328}\x{2329}\x{232A}\x{232B}-\x{2335}\x{237B}\x{237C}\x{237D}-\x{2394}\x{2396}-\x{239A}\x{239B}-\x{23B3}\x{23B4}-\x{23DB}\x{23DC}-\x{23E1}\x{23E2}-\x{2426}\x{2440}-\x{244A}\x{2460}-\x{2487}\x{2488}-\x{249B}\x{24EA}-\x{24FF}\x{2500}-\x{25B6}\x{25B7}\x{25B8}-\x{25C0}\x{25C1}\x{25C2}-\x{25F7}\x{25F8}-\x{25FF}\x{2600}-\x{266E}\x{266F}\x{2670}-\x{26AB}\x{26AD}-\x{2767}\x{2768}\x{2769}\x{276A}\x{276B}\x{276C}\x{276D}\x{276E}\x{276F}\x{2770}\x{2771}\x{2772}\x{2773}\x{2774}\x{2775}\x{2776}-\x{2793}\x{2794}-\x{27BF}\x{27C0}-\x{27C4}\x{27C5}\x{27C6}\x{27C7}-\x{27E5}\x{27E6}\x{27E7}\x{27E8}\x{27E9}\x{27EA}\x{27EB}\x{27EC}\x{27ED}\x{27EE}\x{27EF}\x{27F0}-\x{27FF}\x{2900}-\x{2982}\x{2983}\x{2984}\x{2985}\x{2986}\x{2987}\x{2988}\x{2989}\x{298A}\x{298B}\x{298C}\x{298D}\x{298E}\x{298F}\x{2990}\x{2991}\x{2992}\x{2993}\x{2994}\x{2995}\x{2996}\x{2997}\x{2998}\x{2999}-\x{29D7}\x{29D8}\x{29D9}\x{29DA}\x{29DB}\x{29DC}-\x{29FB}\x{29FC}\x{29FD}\x{29FE}-\x{2AFF}\x{2B00}-\x{2B2F}\x{2B30}-\x{2B44}\x{2B45}-\x{2B46}\x{2B47}-\x{2B4C}\x{2B4D}-\x{2B73}\x{2B76}-\x{2B95}\x{2B97}-\x{2BFF}\x{2CE5}-\x{2CEA}\x{2CEF}-\x{2CF1}\x{2CF9}-\x{2CFC}\x{2CFD}\x{2CFE}-\x{2CFF}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E00}-\x{2E01}\x{2E02}\x{2E03}\x{2E04}\x{2E05}\x{2E06}-\x{2E08}\x{2E09}\x{2E0A}\x{2E0B}\x{2E0C}\x{2E0D}\x{2E0E}-\x{2E16}\x{2E17}\x{2E18}-\x{2E19}\x{2E1A}\x{2E1B}\x{2E1C}\x{2E1D}\x{2E1E}-\x{2E1F}\x{2E20}\x{2E21}\x{2E22}\x{2E23}\x{2E24}\x{2E25}\x{2E26}\x{2E27}\x{2E28}\x{2E29}\x{2E2A}-\x{2E2E}\x{2E2F}\x{2E30}-\x{2E39}\x{2E3A}-\x{2E3B}\x{2E3C}-\x{2E3F}\x{2E40}\x{2E41}\x{2E42}\x{2E43}-\x{2E4F}\x{2E50}-\x{2E51}\x{2E52}-\x{2E54}\x{2E55}\x{2E56}\x{2E57}\x{2E58}\x{2E59}\x{2E5A}\x{2E5B}\x{2E5C}\x{2E5D}\x{2E80}-\x{2E99}\x{2E9B}-\x{2EF3}\x{2F00}-\x{2FD5}\x{2FF0}-\x{2FFF}\x{3001}-\x{3003}\x{3004}\x{3008}\x{3009}\x{300A}\x{300B}\x{300C}\x{300D}\x{300E}\x{300F}\x{3010}\x{3011}\x{3012}-\x{3013}\x{3014}\x{3015}\x{3016}\x{3017}\x{3018}\x{3019}\x{301A}\x{301B}\x{301C}\x{301D}\x{301E}-\x{301F}\x{3020}\x{302A}-\x{302D}\x{3030}\x{3036}-\x{3037}\x{303D}\x{303E}-\x{303F}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{30A0}\x{30FB}\x{31C0}-\x{31E3}\x{31EF}\x{321D}-\x{321E}\x{3250}\x{3251}-\x{325F}\x{327C}-\x{327E}\x{32B1}-\x{32BF}\x{32CC}-\x{32CF}\x{3377}-\x{337A}\x{33DE}-\x{33DF}\x{33FF}\x{4DC0}-\x{4DFF}\x{A490}-\x{A4C6}\x{A60D}-\x{A60F}\x{A66F}\x{A670}-\x{A672}\x{A673}\x{A674}-\x{A67D}\x{A67E}\x{A67F}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A788}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A828}-\x{A82B}\x{A82C}\x{A838}\x{A839}\x{A874}-\x{A877}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{AB6A}-\x{AB6B}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1D}\x{FB1E}\x{FB1F}-\x{FB28}\x{FB29}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC2}\x{FBC3}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD3E}\x{FD3F}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCE}\x{FDCF}\x{FDD0}-\x{FDEF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFD}-\x{FDFF}\x{FE00}-\x{FE0F}\x{FE10}-\x{FE16}\x{FE17}\x{FE18}\x{FE19}\x{FE20}-\x{FE2F}\x{FE30}\x{FE31}-\x{FE32}\x{FE33}-\x{FE34}\x{FE35}\x{FE36}\x{FE37}\x{FE38}\x{FE39}\x{FE3A}\x{FE3B}\x{FE3C}\x{FE3D}\x{FE3E}\x{FE3F}\x{FE40}\x{FE41}\x{FE42}\x{FE43}\x{FE44}\x{FE45}-\x{FE46}\x{FE47}\x{FE48}\x{FE49}-\x{FE4C}\x{FE4D}-\x{FE4F}\x{FE50}\x{FE51}\x{FE52}\x{FE54}\x{FE55}\x{FE56}-\x{FE57}\x{FE58}\x{FE59}\x{FE5A}\x{FE5B}\x{FE5C}\x{FE5D}\x{FE5E}\x{FE5F}\x{FE60}-\x{FE61}\x{FE62}\x{FE63}\x{FE64}-\x{FE66}\x{FE68}\x{FE69}\x{FE6A}\x{FE6B}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FEFF}\x{FF01}-\x{FF02}\x{FF03}\x{FF04}\x{FF05}\x{FF06}-\x{FF07}\x{FF08}\x{FF09}\x{FF0A}\x{FF0B}\x{FF0C}\x{FF0D}\x{FF0E}-\x{FF0F}\x{FF10}-\x{FF19}\x{FF1A}\x{FF1B}\x{FF1C}-\x{FF1E}\x{FF1F}-\x{FF20}\x{FF3B}\x{FF3C}\x{FF3D}\x{FF3E}\x{FF3F}\x{FF40}\x{FF5B}\x{FF5C}\x{FF5D}\x{FF5E}\x{FF5F}\x{FF60}\x{FF61}\x{FF62}\x{FF63}\x{FF64}-\x{FF65}\x{FFE0}-\x{FFE1}\x{FFE2}\x{FFE3}\x{FFE4}\x{FFE5}-\x{FFE6}\x{FFE8}\x{FFE9}-\x{FFEC}\x{FFED}-\x{FFEE}\x{FFF0}-\x{FFF8}\x{FFF9}-\x{FFFB}\x{FFFC}-\x{FFFD}\x{FFFE}-\x{FFFF}\x{10101}\x{10140}-\x{10174}\x{10175}-\x{10178}\x{10179}-\x{10189}\x{1018A}-\x{1018B}\x{1018C}\x{10190}-\x{1019C}\x{101A0}\x{101FD}\x{102E0}\x{102E1}-\x{102FB}\x{10376}-\x{1037A}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{1091F}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A01}-\x{10A03}\x{10A04}\x{10A05}-\x{10A06}\x{10A07}-\x{10A0B}\x{10A0C}-\x{10A0F}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A38}-\x{10A3A}\x{10A3B}-\x{10A3E}\x{10A3F}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE5}-\x{10AE6}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B39}-\x{10B3F}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D24}-\x{10D27}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAB}-\x{10EAC}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EBF}\x{10EC0}-\x{10EFC}\x{10EFD}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F46}-\x{10F50}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10F81}\x{10F82}-\x{10F85}\x{10F86}-\x{10F89}\x{10F8A}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{11001}\x{11038}-\x{11046}\x{11052}-\x{11065}\x{11070}\x{11073}-\x{11074}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110C2}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{11241}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{11660}-\x{1166C}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11F00}-\x{11F01}\x{11F36}-\x{11F3A}\x{11F40}\x{11F42}\x{11FD5}-\x{11FDC}\x{11FDD}-\x{11FE0}\x{11FE1}-\x{11FF1}\x{13440}\x{13447}-\x{13455}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE2}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1CF00}-\x{1CF2D}\x{1CF30}-\x{1CF46}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D1E9}-\x{1D1EA}\x{1D200}-\x{1D241}\x{1D242}-\x{1D244}\x{1D245}\x{1D300}-\x{1D356}\x{1D6DB}\x{1D715}\x{1D74F}\x{1D789}\x{1D7C3}\x{1D7CE}-\x{1D7FF}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E08F}\x{1E130}-\x{1E136}\x{1E2AE}\x{1E2EC}-\x{1E2EF}\x{1E2FF}\x{1E4EC}-\x{1E4EF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D0}-\x{1E8D6}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E944}-\x{1E94A}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF0}-\x{1EEF1}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F000}-\x{1F02B}\x{1F030}-\x{1F093}\x{1F0A0}-\x{1F0AE}\x{1F0B1}-\x{1F0BF}\x{1F0C1}-\x{1F0CF}\x{1F0D1}-\x{1F0F5}\x{1F100}-\x{1F10A}\x{1F10B}-\x{1F10C}\x{1F10D}-\x{1F10F}\x{1F12F}\x{1F16A}-\x{1F16F}\x{1F1AD}\x{1F260}-\x{1F265}\x{1F300}-\x{1F3FA}\x{1F3FB}-\x{1F3FF}\x{1F400}-\x{1F6D7}\x{1F6DC}-\x{1F6EC}\x{1F6F0}-\x{1F6FC}\x{1F700}-\x{1F776}\x{1F77B}-\x{1F7D9}\x{1F7E0}-\x{1F7EB}\x{1F7F0}\x{1F800}-\x{1F80B}\x{1F810}-\x{1F847}\x{1F850}-\x{1F859}\x{1F860}-\x{1F887}\x{1F890}-\x{1F8AD}\x{1F8B0}-\x{1F8B1}\x{1F900}-\x{1FA53}\x{1FA60}-\x{1FA6D}\x{1FA70}-\x{1FA7C}\x{1FA80}-\x{1FA88}\x{1FA90}-\x{1FABD}\x{1FABF}-\x{1FAC5}\x{1FACE}-\x{1FADB}\x{1FAE0}-\x{1FAE8}\x{1FAF0}-\x{1FAF8}\x{1FB00}-\x{1FB92}\x{1FB94}-\x{1FBCA}\x{1FBF0}-\x{1FBF9}\x{1FFFE}-\x{1FFFF}\x{2FFFE}-\x{2FFFF}\x{3FFFE}-\x{3FFFF}\x{4FFFE}-\x{4FFFF}\x{5FFFE}-\x{5FFFF}\x{6FFFE}-\x{6FFFF}\x{7FFFE}-\x{7FFFF}\x{8FFFE}-\x{8FFFF}\x{9FFFE}-\x{9FFFF}\x{AFFFE}-\x{AFFFF}\x{BFFFE}-\x{BFFFF}\x{CFFFE}-\x{CFFFF}\x{DFFFE}-\x{E0000}\x{E0001}\x{E0002}-\x{E001F}\x{E0020}-\x{E007F}\x{E0080}-\x{E00FF}\x{E0100}-\x{E01EF}\x{E01F0}-\x{E0FFF}\x{EFFFE}-\x{EFFFF}\x{FFFFE}-\x{FFFFF}\x{10FFFE}-\x{10FFFF}]/u'; + const BIDI_STEP_3 = '/[\x{0030}-\x{0039}\x{00B2}-\x{00B3}\x{00B9}\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06DD}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{0887}\x{0888}\x{0889}-\x{088E}\x{088F}\x{0890}-\x{0891}\x{0892}-\x{0897}\x{08A0}-\x{08C8}\x{08C9}\x{08E2}\x{200F}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2488}-\x{249B}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC2}\x{FBC3}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCE}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FF10}-\x{FF19}\x{102E1}-\x{102FB}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EBF}\x{10EC0}-\x{10EFC}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10F81}\x{10F86}-\x{10F89}\x{10F8A}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1D7CE}-\x{1D7FF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F100}-\x{1F10A}\x{1FBF0}-\x{1FBF9}][\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{0898}-\x{089F}\x{08CA}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3C}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECE}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1733}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{180F}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1ACE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DFF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10EFD}-\x{10EFF}\x{10F46}-\x{10F50}\x{10F82}-\x{10F85}\x{11001}\x{11038}-\x{11046}\x{11070}\x{11073}-\x{11074}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110C2}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{11241}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11F00}-\x{11F01}\x{11F36}-\x{11F3A}\x{11F40}\x{11F42}\x{13440}\x{13447}-\x{13455}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1CF00}-\x{1CF2D}\x{1CF30}-\x{1CF46}\x{1D167}-\x{1D169}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E08F}\x{1E130}-\x{1E136}\x{1E2AE}\x{1E2EC}-\x{1E2EF}\x{1E4EC}-\x{1E4EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{E0100}-\x{E01EF}]*$/u'; + const BIDI_STEP_4_AN = '/[\x{0600}-\x{0605}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{06DD}\x{0890}-\x{0891}\x{08E2}\x{10D30}-\x{10D39}\x{10E60}-\x{10E7E}]/u'; const BIDI_STEP_4_EN = '/[\x{0030}-\x{0039}\x{00B2}-\x{00B3}\x{00B9}\x{06F0}-\x{06F9}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2488}-\x{249B}\x{FF10}-\x{FF19}\x{102E1}-\x{102FB}\x{1D7CE}-\x{1D7FF}\x{1F100}-\x{1F10A}\x{1FBF0}-\x{1FBF9}]/u'; - const BIDI_STEP_5 = '/[\x{0009}\x{000A}\x{000B}\x{000C}\x{000D}\x{001C}-\x{001E}\x{001F}\x{0020}\x{0085}\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06DD}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08E2}\x{1680}\x{2000}-\x{200A}\x{200F}\x{2028}\x{2029}\x{202A}\x{202B}\x{202C}\x{202D}\x{202E}\x{205F}\x{2066}\x{2067}\x{2068}\x{2069}\x{3000}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFE}-\x{FDFF}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}]/u'; - const BIDI_STEP_6 = '/[^\x{0000}-\x{0008}\x{0009}\x{000A}\x{000B}\x{000C}\x{000D}\x{000E}-\x{001B}\x{001C}-\x{001E}\x{001F}\x{0020}\x{0021}-\x{0022}\x{0023}\x{0024}\x{0025}\x{0026}-\x{0027}\x{0028}\x{0029}\x{002A}\x{002B}\x{002C}\x{002D}\x{002E}-\x{002F}\x{003A}\x{003B}\x{003C}-\x{003E}\x{003F}-\x{0040}\x{005B}\x{005C}\x{005D}\x{005E}\x{005F}\x{0060}\x{007B}\x{007C}\x{007D}\x{007E}\x{007F}-\x{0084}\x{0085}\x{0086}-\x{009F}\x{00A0}\x{00A1}\x{00A2}-\x{00A5}\x{00A6}\x{00A7}\x{00A8}\x{00A9}\x{00AB}\x{00AC}\x{00AD}\x{00AE}\x{00AF}\x{00B0}\x{00B1}\x{00B4}\x{00B6}-\x{00B7}\x{00B8}\x{00BB}\x{00BC}-\x{00BE}\x{00BF}\x{00D7}\x{00F7}\x{02B9}-\x{02BA}\x{02C2}-\x{02C5}\x{02C6}-\x{02CF}\x{02D2}-\x{02DF}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037E}\x{0384}-\x{0385}\x{0387}\x{03F6}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{058A}\x{058D}-\x{058E}\x{058F}\x{0590}\x{0591}-\x{05BD}\x{05BE}\x{05BF}\x{05C0}\x{05C1}-\x{05C2}\x{05C3}\x{05C4}-\x{05C5}\x{05C6}\x{05C7}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0606}-\x{0607}\x{0608}\x{0609}-\x{060A}\x{060B}\x{060C}\x{060D}\x{060E}-\x{060F}\x{0610}-\x{061A}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{064B}-\x{065F}\x{0660}-\x{0669}\x{066A}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0670}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06D6}-\x{06DC}\x{06DD}\x{06DE}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06E9}\x{06EA}-\x{06ED}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0711}\x{0712}-\x{072F}\x{0730}-\x{074A}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07A6}-\x{07B0}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07F6}\x{07F7}-\x{07F9}\x{07FA}\x{07FB}-\x{07FC}\x{07FD}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{0859}-\x{085B}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08D3}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09F2}-\x{09F3}\x{09FB}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AF1}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0BF3}-\x{0BF8}\x{0BF9}\x{0BFA}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C78}-\x{0C7E}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E3F}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3A}\x{0F3B}\x{0F3C}\x{0F3D}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1390}-\x{1399}\x{1400}\x{1680}\x{169B}\x{169C}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DB}\x{17DD}\x{17F0}-\x{17F9}\x{1800}-\x{1805}\x{1806}\x{1807}-\x{180A}\x{180B}-\x{180D}\x{180E}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1940}\x{1944}-\x{1945}\x{19DE}-\x{19FF}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{2000}-\x{200A}\x{200B}-\x{200D}\x{200F}\x{2010}-\x{2015}\x{2016}-\x{2017}\x{2018}\x{2019}\x{201A}\x{201B}-\x{201C}\x{201D}\x{201E}\x{201F}\x{2020}-\x{2027}\x{2028}\x{2029}\x{202A}\x{202B}\x{202C}\x{202D}\x{202E}\x{202F}\x{2030}-\x{2034}\x{2035}-\x{2038}\x{2039}\x{203A}\x{203B}-\x{203E}\x{203F}-\x{2040}\x{2041}-\x{2043}\x{2044}\x{2045}\x{2046}\x{2047}-\x{2051}\x{2052}\x{2053}\x{2054}\x{2055}-\x{205E}\x{205F}\x{2060}-\x{2064}\x{2065}\x{2066}\x{2067}\x{2068}\x{2069}\x{206A}-\x{206F}\x{207A}-\x{207B}\x{207C}\x{207D}\x{207E}\x{208A}-\x{208B}\x{208C}\x{208D}\x{208E}\x{20A0}-\x{20BF}\x{20C0}-\x{20CF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2100}-\x{2101}\x{2103}-\x{2106}\x{2108}-\x{2109}\x{2114}\x{2116}-\x{2117}\x{2118}\x{211E}-\x{2123}\x{2125}\x{2127}\x{2129}\x{212E}\x{213A}-\x{213B}\x{2140}-\x{2144}\x{214A}\x{214B}\x{214C}-\x{214D}\x{2150}-\x{215F}\x{2189}\x{218A}-\x{218B}\x{2190}-\x{2194}\x{2195}-\x{2199}\x{219A}-\x{219B}\x{219C}-\x{219F}\x{21A0}\x{21A1}-\x{21A2}\x{21A3}\x{21A4}-\x{21A5}\x{21A6}\x{21A7}-\x{21AD}\x{21AE}\x{21AF}-\x{21CD}\x{21CE}-\x{21CF}\x{21D0}-\x{21D1}\x{21D2}\x{21D3}\x{21D4}\x{21D5}-\x{21F3}\x{21F4}-\x{2211}\x{2212}\x{2213}\x{2214}-\x{22FF}\x{2300}-\x{2307}\x{2308}\x{2309}\x{230A}\x{230B}\x{230C}-\x{231F}\x{2320}-\x{2321}\x{2322}-\x{2328}\x{2329}\x{232A}\x{232B}-\x{2335}\x{237B}\x{237C}\x{237D}-\x{2394}\x{2396}-\x{239A}\x{239B}-\x{23B3}\x{23B4}-\x{23DB}\x{23DC}-\x{23E1}\x{23E2}-\x{2426}\x{2440}-\x{244A}\x{2460}-\x{2487}\x{24EA}-\x{24FF}\x{2500}-\x{25B6}\x{25B7}\x{25B8}-\x{25C0}\x{25C1}\x{25C2}-\x{25F7}\x{25F8}-\x{25FF}\x{2600}-\x{266E}\x{266F}\x{2670}-\x{26AB}\x{26AD}-\x{2767}\x{2768}\x{2769}\x{276A}\x{276B}\x{276C}\x{276D}\x{276E}\x{276F}\x{2770}\x{2771}\x{2772}\x{2773}\x{2774}\x{2775}\x{2776}-\x{2793}\x{2794}-\x{27BF}\x{27C0}-\x{27C4}\x{27C5}\x{27C6}\x{27C7}-\x{27E5}\x{27E6}\x{27E7}\x{27E8}\x{27E9}\x{27EA}\x{27EB}\x{27EC}\x{27ED}\x{27EE}\x{27EF}\x{27F0}-\x{27FF}\x{2900}-\x{2982}\x{2983}\x{2984}\x{2985}\x{2986}\x{2987}\x{2988}\x{2989}\x{298A}\x{298B}\x{298C}\x{298D}\x{298E}\x{298F}\x{2990}\x{2991}\x{2992}\x{2993}\x{2994}\x{2995}\x{2996}\x{2997}\x{2998}\x{2999}-\x{29D7}\x{29D8}\x{29D9}\x{29DA}\x{29DB}\x{29DC}-\x{29FB}\x{29FC}\x{29FD}\x{29FE}-\x{2AFF}\x{2B00}-\x{2B2F}\x{2B30}-\x{2B44}\x{2B45}-\x{2B46}\x{2B47}-\x{2B4C}\x{2B4D}-\x{2B73}\x{2B76}-\x{2B95}\x{2B97}-\x{2BFF}\x{2CE5}-\x{2CEA}\x{2CEF}-\x{2CF1}\x{2CF9}-\x{2CFC}\x{2CFD}\x{2CFE}-\x{2CFF}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E00}-\x{2E01}\x{2E02}\x{2E03}\x{2E04}\x{2E05}\x{2E06}-\x{2E08}\x{2E09}\x{2E0A}\x{2E0B}\x{2E0C}\x{2E0D}\x{2E0E}-\x{2E16}\x{2E17}\x{2E18}-\x{2E19}\x{2E1A}\x{2E1B}\x{2E1C}\x{2E1D}\x{2E1E}-\x{2E1F}\x{2E20}\x{2E21}\x{2E22}\x{2E23}\x{2E24}\x{2E25}\x{2E26}\x{2E27}\x{2E28}\x{2E29}\x{2E2A}-\x{2E2E}\x{2E2F}\x{2E30}-\x{2E39}\x{2E3A}-\x{2E3B}\x{2E3C}-\x{2E3F}\x{2E40}\x{2E41}\x{2E42}\x{2E43}-\x{2E4F}\x{2E50}-\x{2E51}\x{2E52}\x{2E80}-\x{2E99}\x{2E9B}-\x{2EF3}\x{2F00}-\x{2FD5}\x{2FF0}-\x{2FFB}\x{3000}\x{3001}-\x{3003}\x{3004}\x{3008}\x{3009}\x{300A}\x{300B}\x{300C}\x{300D}\x{300E}\x{300F}\x{3010}\x{3011}\x{3012}-\x{3013}\x{3014}\x{3015}\x{3016}\x{3017}\x{3018}\x{3019}\x{301A}\x{301B}\x{301C}\x{301D}\x{301E}-\x{301F}\x{3020}\x{302A}-\x{302D}\x{3030}\x{3036}-\x{3037}\x{303D}\x{303E}-\x{303F}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{30A0}\x{30FB}\x{31C0}-\x{31E3}\x{321D}-\x{321E}\x{3250}\x{3251}-\x{325F}\x{327C}-\x{327E}\x{32B1}-\x{32BF}\x{32CC}-\x{32CF}\x{3377}-\x{337A}\x{33DE}-\x{33DF}\x{33FF}\x{4DC0}-\x{4DFF}\x{A490}-\x{A4C6}\x{A60D}-\x{A60F}\x{A66F}\x{A670}-\x{A672}\x{A673}\x{A674}-\x{A67D}\x{A67E}\x{A67F}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A788}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A828}-\x{A82B}\x{A82C}\x{A838}\x{A839}\x{A874}-\x{A877}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{AB6A}-\x{AB6B}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1D}\x{FB1E}\x{FB1F}-\x{FB28}\x{FB29}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD3E}\x{FD3F}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDD0}-\x{FDEF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFD}\x{FDFE}-\x{FDFF}\x{FE00}-\x{FE0F}\x{FE10}-\x{FE16}\x{FE17}\x{FE18}\x{FE19}\x{FE20}-\x{FE2F}\x{FE30}\x{FE31}-\x{FE32}\x{FE33}-\x{FE34}\x{FE35}\x{FE36}\x{FE37}\x{FE38}\x{FE39}\x{FE3A}\x{FE3B}\x{FE3C}\x{FE3D}\x{FE3E}\x{FE3F}\x{FE40}\x{FE41}\x{FE42}\x{FE43}\x{FE44}\x{FE45}-\x{FE46}\x{FE47}\x{FE48}\x{FE49}-\x{FE4C}\x{FE4D}-\x{FE4F}\x{FE50}\x{FE51}\x{FE52}\x{FE54}\x{FE55}\x{FE56}-\x{FE57}\x{FE58}\x{FE59}\x{FE5A}\x{FE5B}\x{FE5C}\x{FE5D}\x{FE5E}\x{FE5F}\x{FE60}-\x{FE61}\x{FE62}\x{FE63}\x{FE64}-\x{FE66}\x{FE68}\x{FE69}\x{FE6A}\x{FE6B}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FEFF}\x{FF01}-\x{FF02}\x{FF03}\x{FF04}\x{FF05}\x{FF06}-\x{FF07}\x{FF08}\x{FF09}\x{FF0A}\x{FF0B}\x{FF0C}\x{FF0D}\x{FF0E}-\x{FF0F}\x{FF1A}\x{FF1B}\x{FF1C}-\x{FF1E}\x{FF1F}-\x{FF20}\x{FF3B}\x{FF3C}\x{FF3D}\x{FF3E}\x{FF3F}\x{FF40}\x{FF5B}\x{FF5C}\x{FF5D}\x{FF5E}\x{FF5F}\x{FF60}\x{FF61}\x{FF62}\x{FF63}\x{FF64}-\x{FF65}\x{FFE0}-\x{FFE1}\x{FFE2}\x{FFE3}\x{FFE4}\x{FFE5}-\x{FFE6}\x{FFE8}\x{FFE9}-\x{FFEC}\x{FFED}-\x{FFEE}\x{FFF0}-\x{FFF8}\x{FFF9}-\x{FFFB}\x{FFFC}-\x{FFFD}\x{FFFE}-\x{FFFF}\x{10101}\x{10140}-\x{10174}\x{10175}-\x{10178}\x{10179}-\x{10189}\x{1018A}-\x{1018B}\x{1018C}\x{10190}-\x{1019C}\x{101A0}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{1091F}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A01}-\x{10A03}\x{10A04}\x{10A05}-\x{10A06}\x{10A07}-\x{10A0B}\x{10A0C}-\x{10A0F}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A38}-\x{10A3A}\x{10A3B}-\x{10A3E}\x{10A3F}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE5}-\x{10AE6}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B39}-\x{10B3F}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D24}-\x{10D27}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAB}-\x{10EAC}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F46}-\x{10F50}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{11001}\x{11038}-\x{11046}\x{11052}-\x{11065}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{11660}-\x{1166C}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11FD5}-\x{11FDC}\x{11FDD}-\x{11FE0}\x{11FE1}-\x{11FF1}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE2}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D200}-\x{1D241}\x{1D242}-\x{1D244}\x{1D245}\x{1D300}-\x{1D356}\x{1D6DB}\x{1D715}\x{1D74F}\x{1D789}\x{1D7C3}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E2FF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D0}-\x{1E8D6}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E944}-\x{1E94A}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF0}-\x{1EEF1}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F000}-\x{1F02B}\x{1F030}-\x{1F093}\x{1F0A0}-\x{1F0AE}\x{1F0B1}-\x{1F0BF}\x{1F0C1}-\x{1F0CF}\x{1F0D1}-\x{1F0F5}\x{1F10B}-\x{1F10C}\x{1F10D}-\x{1F10F}\x{1F12F}\x{1F16A}-\x{1F16F}\x{1F1AD}\x{1F260}-\x{1F265}\x{1F300}-\x{1F3FA}\x{1F3FB}-\x{1F3FF}\x{1F400}-\x{1F6D7}\x{1F6E0}-\x{1F6EC}\x{1F6F0}-\x{1F6FC}\x{1F700}-\x{1F773}\x{1F780}-\x{1F7D8}\x{1F7E0}-\x{1F7EB}\x{1F800}-\x{1F80B}\x{1F810}-\x{1F847}\x{1F850}-\x{1F859}\x{1F860}-\x{1F887}\x{1F890}-\x{1F8AD}\x{1F8B0}-\x{1F8B1}\x{1F900}-\x{1F978}\x{1F97A}-\x{1F9CB}\x{1F9CD}-\x{1FA53}\x{1FA60}-\x{1FA6D}\x{1FA70}-\x{1FA74}\x{1FA78}-\x{1FA7A}\x{1FA80}-\x{1FA86}\x{1FA90}-\x{1FAA8}\x{1FAB0}-\x{1FAB6}\x{1FAC0}-\x{1FAC2}\x{1FAD0}-\x{1FAD6}\x{1FB00}-\x{1FB92}\x{1FB94}-\x{1FBCA}\x{1FFFE}-\x{1FFFF}\x{2FFFE}-\x{2FFFF}\x{3FFFE}-\x{3FFFF}\x{4FFFE}-\x{4FFFF}\x{5FFFE}-\x{5FFFF}\x{6FFFE}-\x{6FFFF}\x{7FFFE}-\x{7FFFF}\x{8FFFE}-\x{8FFFF}\x{9FFFE}-\x{9FFFF}\x{AFFFE}-\x{AFFFF}\x{BFFFE}-\x{BFFFF}\x{CFFFE}-\x{CFFFF}\x{DFFFE}-\x{E0000}\x{E0001}\x{E0002}-\x{E001F}\x{E0020}-\x{E007F}\x{E0080}-\x{E00FF}\x{E0100}-\x{E01EF}\x{E01F0}-\x{E0FFF}\x{EFFFE}-\x{EFFFF}\x{FFFFE}-\x{FFFFF}\x{10FFFE}-\x{10FFFF}][\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1D167}-\x{1D169}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{E0100}-\x{E01EF}]*$/u'; + const BIDI_STEP_5 = '/[\x{0009}\x{000A}\x{000B}\x{000C}\x{000D}\x{001C}-\x{001E}\x{001F}\x{0020}\x{0085}\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06DD}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{0887}\x{0888}\x{0889}-\x{088E}\x{088F}\x{0890}-\x{0891}\x{0892}-\x{0897}\x{08A0}-\x{08C8}\x{08C9}\x{08E2}\x{1680}\x{2000}-\x{200A}\x{200F}\x{2028}\x{2029}\x{202A}\x{202B}\x{202C}\x{202D}\x{202E}\x{205F}\x{2066}\x{2067}\x{2068}\x{2069}\x{3000}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC2}\x{FBC3}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCE}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EBF}\x{10EC0}-\x{10EFC}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10F81}\x{10F86}-\x{10F89}\x{10F8A}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}]/u'; + const BIDI_STEP_6 = '/[^\x{0000}-\x{0008}\x{0009}\x{000A}\x{000B}\x{000C}\x{000D}\x{000E}-\x{001B}\x{001C}-\x{001E}\x{001F}\x{0020}\x{0021}-\x{0022}\x{0023}\x{0024}\x{0025}\x{0026}-\x{0027}\x{0028}\x{0029}\x{002A}\x{002B}\x{002C}\x{002D}\x{002E}-\x{002F}\x{003A}\x{003B}\x{003C}-\x{003E}\x{003F}-\x{0040}\x{005B}\x{005C}\x{005D}\x{005E}\x{005F}\x{0060}\x{007B}\x{007C}\x{007D}\x{007E}\x{007F}-\x{0084}\x{0085}\x{0086}-\x{009F}\x{00A0}\x{00A1}\x{00A2}-\x{00A5}\x{00A6}\x{00A7}\x{00A8}\x{00A9}\x{00AB}\x{00AC}\x{00AD}\x{00AE}\x{00AF}\x{00B0}\x{00B1}\x{00B4}\x{00B6}-\x{00B7}\x{00B8}\x{00BB}\x{00BC}-\x{00BE}\x{00BF}\x{00D7}\x{00F7}\x{02B9}-\x{02BA}\x{02C2}-\x{02C5}\x{02C6}-\x{02CF}\x{02D2}-\x{02DF}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037E}\x{0384}-\x{0385}\x{0387}\x{03F6}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{058A}\x{058D}-\x{058E}\x{058F}\x{0590}\x{0591}-\x{05BD}\x{05BE}\x{05BF}\x{05C0}\x{05C1}-\x{05C2}\x{05C3}\x{05C4}-\x{05C5}\x{05C6}\x{05C7}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0606}-\x{0607}\x{0608}\x{0609}-\x{060A}\x{060B}\x{060C}\x{060D}\x{060E}-\x{060F}\x{0610}-\x{061A}\x{061B}\x{061C}\x{061D}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{064B}-\x{065F}\x{0660}-\x{0669}\x{066A}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0670}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06D6}-\x{06DC}\x{06DD}\x{06DE}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06E9}\x{06EA}-\x{06ED}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0711}\x{0712}-\x{072F}\x{0730}-\x{074A}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07A6}-\x{07B0}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07F6}\x{07F7}-\x{07F9}\x{07FA}\x{07FB}-\x{07FC}\x{07FD}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{0859}-\x{085B}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{0887}\x{0888}\x{0889}-\x{088E}\x{088F}\x{0890}-\x{0891}\x{0892}-\x{0897}\x{0898}-\x{089F}\x{08A0}-\x{08C8}\x{08C9}\x{08CA}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09F2}-\x{09F3}\x{09FB}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AF1}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0BF3}-\x{0BF8}\x{0BF9}\x{0BFA}\x{0C00}\x{0C04}\x{0C3C}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C78}-\x{0C7E}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E3F}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECE}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3A}\x{0F3B}\x{0F3C}\x{0F3D}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1390}-\x{1399}\x{1400}\x{1680}\x{169B}\x{169C}\x{1712}-\x{1714}\x{1732}-\x{1733}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DB}\x{17DD}\x{17F0}-\x{17F9}\x{1800}-\x{1805}\x{1806}\x{1807}-\x{180A}\x{180B}-\x{180D}\x{180E}\x{180F}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1940}\x{1944}-\x{1945}\x{19DE}-\x{19FF}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1ACE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{2000}-\x{200A}\x{200B}-\x{200D}\x{200F}\x{2010}-\x{2015}\x{2016}-\x{2017}\x{2018}\x{2019}\x{201A}\x{201B}-\x{201C}\x{201D}\x{201E}\x{201F}\x{2020}-\x{2027}\x{2028}\x{2029}\x{202A}\x{202B}\x{202C}\x{202D}\x{202E}\x{202F}\x{2030}-\x{2034}\x{2035}-\x{2038}\x{2039}\x{203A}\x{203B}-\x{203E}\x{203F}-\x{2040}\x{2041}-\x{2043}\x{2044}\x{2045}\x{2046}\x{2047}-\x{2051}\x{2052}\x{2053}\x{2054}\x{2055}-\x{205E}\x{205F}\x{2060}-\x{2064}\x{2065}\x{2066}\x{2067}\x{2068}\x{2069}\x{206A}-\x{206F}\x{207A}-\x{207B}\x{207C}\x{207D}\x{207E}\x{208A}-\x{208B}\x{208C}\x{208D}\x{208E}\x{20A0}-\x{20C0}\x{20C1}-\x{20CF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2100}-\x{2101}\x{2103}-\x{2106}\x{2108}-\x{2109}\x{2114}\x{2116}-\x{2117}\x{2118}\x{211E}-\x{2123}\x{2125}\x{2127}\x{2129}\x{212E}\x{213A}-\x{213B}\x{2140}-\x{2144}\x{214A}\x{214B}\x{214C}-\x{214D}\x{2150}-\x{215F}\x{2189}\x{218A}-\x{218B}\x{2190}-\x{2194}\x{2195}-\x{2199}\x{219A}-\x{219B}\x{219C}-\x{219F}\x{21A0}\x{21A1}-\x{21A2}\x{21A3}\x{21A4}-\x{21A5}\x{21A6}\x{21A7}-\x{21AD}\x{21AE}\x{21AF}-\x{21CD}\x{21CE}-\x{21CF}\x{21D0}-\x{21D1}\x{21D2}\x{21D3}\x{21D4}\x{21D5}-\x{21F3}\x{21F4}-\x{2211}\x{2212}\x{2213}\x{2214}-\x{22FF}\x{2300}-\x{2307}\x{2308}\x{2309}\x{230A}\x{230B}\x{230C}-\x{231F}\x{2320}-\x{2321}\x{2322}-\x{2328}\x{2329}\x{232A}\x{232B}-\x{2335}\x{237B}\x{237C}\x{237D}-\x{2394}\x{2396}-\x{239A}\x{239B}-\x{23B3}\x{23B4}-\x{23DB}\x{23DC}-\x{23E1}\x{23E2}-\x{2426}\x{2440}-\x{244A}\x{2460}-\x{2487}\x{24EA}-\x{24FF}\x{2500}-\x{25B6}\x{25B7}\x{25B8}-\x{25C0}\x{25C1}\x{25C2}-\x{25F7}\x{25F8}-\x{25FF}\x{2600}-\x{266E}\x{266F}\x{2670}-\x{26AB}\x{26AD}-\x{2767}\x{2768}\x{2769}\x{276A}\x{276B}\x{276C}\x{276D}\x{276E}\x{276F}\x{2770}\x{2771}\x{2772}\x{2773}\x{2774}\x{2775}\x{2776}-\x{2793}\x{2794}-\x{27BF}\x{27C0}-\x{27C4}\x{27C5}\x{27C6}\x{27C7}-\x{27E5}\x{27E6}\x{27E7}\x{27E8}\x{27E9}\x{27EA}\x{27EB}\x{27EC}\x{27ED}\x{27EE}\x{27EF}\x{27F0}-\x{27FF}\x{2900}-\x{2982}\x{2983}\x{2984}\x{2985}\x{2986}\x{2987}\x{2988}\x{2989}\x{298A}\x{298B}\x{298C}\x{298D}\x{298E}\x{298F}\x{2990}\x{2991}\x{2992}\x{2993}\x{2994}\x{2995}\x{2996}\x{2997}\x{2998}\x{2999}-\x{29D7}\x{29D8}\x{29D9}\x{29DA}\x{29DB}\x{29DC}-\x{29FB}\x{29FC}\x{29FD}\x{29FE}-\x{2AFF}\x{2B00}-\x{2B2F}\x{2B30}-\x{2B44}\x{2B45}-\x{2B46}\x{2B47}-\x{2B4C}\x{2B4D}-\x{2B73}\x{2B76}-\x{2B95}\x{2B97}-\x{2BFF}\x{2CE5}-\x{2CEA}\x{2CEF}-\x{2CF1}\x{2CF9}-\x{2CFC}\x{2CFD}\x{2CFE}-\x{2CFF}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E00}-\x{2E01}\x{2E02}\x{2E03}\x{2E04}\x{2E05}\x{2E06}-\x{2E08}\x{2E09}\x{2E0A}\x{2E0B}\x{2E0C}\x{2E0D}\x{2E0E}-\x{2E16}\x{2E17}\x{2E18}-\x{2E19}\x{2E1A}\x{2E1B}\x{2E1C}\x{2E1D}\x{2E1E}-\x{2E1F}\x{2E20}\x{2E21}\x{2E22}\x{2E23}\x{2E24}\x{2E25}\x{2E26}\x{2E27}\x{2E28}\x{2E29}\x{2E2A}-\x{2E2E}\x{2E2F}\x{2E30}-\x{2E39}\x{2E3A}-\x{2E3B}\x{2E3C}-\x{2E3F}\x{2E40}\x{2E41}\x{2E42}\x{2E43}-\x{2E4F}\x{2E50}-\x{2E51}\x{2E52}-\x{2E54}\x{2E55}\x{2E56}\x{2E57}\x{2E58}\x{2E59}\x{2E5A}\x{2E5B}\x{2E5C}\x{2E5D}\x{2E80}-\x{2E99}\x{2E9B}-\x{2EF3}\x{2F00}-\x{2FD5}\x{2FF0}-\x{2FFF}\x{3000}\x{3001}-\x{3003}\x{3004}\x{3008}\x{3009}\x{300A}\x{300B}\x{300C}\x{300D}\x{300E}\x{300F}\x{3010}\x{3011}\x{3012}-\x{3013}\x{3014}\x{3015}\x{3016}\x{3017}\x{3018}\x{3019}\x{301A}\x{301B}\x{301C}\x{301D}\x{301E}-\x{301F}\x{3020}\x{302A}-\x{302D}\x{3030}\x{3036}-\x{3037}\x{303D}\x{303E}-\x{303F}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{30A0}\x{30FB}\x{31C0}-\x{31E3}\x{31EF}\x{321D}-\x{321E}\x{3250}\x{3251}-\x{325F}\x{327C}-\x{327E}\x{32B1}-\x{32BF}\x{32CC}-\x{32CF}\x{3377}-\x{337A}\x{33DE}-\x{33DF}\x{33FF}\x{4DC0}-\x{4DFF}\x{A490}-\x{A4C6}\x{A60D}-\x{A60F}\x{A66F}\x{A670}-\x{A672}\x{A673}\x{A674}-\x{A67D}\x{A67E}\x{A67F}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A788}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A828}-\x{A82B}\x{A82C}\x{A838}\x{A839}\x{A874}-\x{A877}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{AB6A}-\x{AB6B}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1D}\x{FB1E}\x{FB1F}-\x{FB28}\x{FB29}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC2}\x{FBC3}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD3E}\x{FD3F}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCE}\x{FDCF}\x{FDD0}-\x{FDEF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFD}-\x{FDFF}\x{FE00}-\x{FE0F}\x{FE10}-\x{FE16}\x{FE17}\x{FE18}\x{FE19}\x{FE20}-\x{FE2F}\x{FE30}\x{FE31}-\x{FE32}\x{FE33}-\x{FE34}\x{FE35}\x{FE36}\x{FE37}\x{FE38}\x{FE39}\x{FE3A}\x{FE3B}\x{FE3C}\x{FE3D}\x{FE3E}\x{FE3F}\x{FE40}\x{FE41}\x{FE42}\x{FE43}\x{FE44}\x{FE45}-\x{FE46}\x{FE47}\x{FE48}\x{FE49}-\x{FE4C}\x{FE4D}-\x{FE4F}\x{FE50}\x{FE51}\x{FE52}\x{FE54}\x{FE55}\x{FE56}-\x{FE57}\x{FE58}\x{FE59}\x{FE5A}\x{FE5B}\x{FE5C}\x{FE5D}\x{FE5E}\x{FE5F}\x{FE60}-\x{FE61}\x{FE62}\x{FE63}\x{FE64}-\x{FE66}\x{FE68}\x{FE69}\x{FE6A}\x{FE6B}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FEFF}\x{FF01}-\x{FF02}\x{FF03}\x{FF04}\x{FF05}\x{FF06}-\x{FF07}\x{FF08}\x{FF09}\x{FF0A}\x{FF0B}\x{FF0C}\x{FF0D}\x{FF0E}-\x{FF0F}\x{FF1A}\x{FF1B}\x{FF1C}-\x{FF1E}\x{FF1F}-\x{FF20}\x{FF3B}\x{FF3C}\x{FF3D}\x{FF3E}\x{FF3F}\x{FF40}\x{FF5B}\x{FF5C}\x{FF5D}\x{FF5E}\x{FF5F}\x{FF60}\x{FF61}\x{FF62}\x{FF63}\x{FF64}-\x{FF65}\x{FFE0}-\x{FFE1}\x{FFE2}\x{FFE3}\x{FFE4}\x{FFE5}-\x{FFE6}\x{FFE8}\x{FFE9}-\x{FFEC}\x{FFED}-\x{FFEE}\x{FFF0}-\x{FFF8}\x{FFF9}-\x{FFFB}\x{FFFC}-\x{FFFD}\x{FFFE}-\x{FFFF}\x{10101}\x{10140}-\x{10174}\x{10175}-\x{10178}\x{10179}-\x{10189}\x{1018A}-\x{1018B}\x{1018C}\x{10190}-\x{1019C}\x{101A0}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{1091F}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A01}-\x{10A03}\x{10A04}\x{10A05}-\x{10A06}\x{10A07}-\x{10A0B}\x{10A0C}-\x{10A0F}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A38}-\x{10A3A}\x{10A3B}-\x{10A3E}\x{10A3F}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE5}-\x{10AE6}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B39}-\x{10B3F}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D24}-\x{10D27}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAB}-\x{10EAC}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EBF}\x{10EC0}-\x{10EFC}\x{10EFD}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F46}-\x{10F50}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10F81}\x{10F82}-\x{10F85}\x{10F86}-\x{10F89}\x{10F8A}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{11001}\x{11038}-\x{11046}\x{11052}-\x{11065}\x{11070}\x{11073}-\x{11074}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110C2}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{11241}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{11660}-\x{1166C}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11F00}-\x{11F01}\x{11F36}-\x{11F3A}\x{11F40}\x{11F42}\x{11FD5}-\x{11FDC}\x{11FDD}-\x{11FE0}\x{11FE1}-\x{11FF1}\x{13440}\x{13447}-\x{13455}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE2}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1CF00}-\x{1CF2D}\x{1CF30}-\x{1CF46}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D1E9}-\x{1D1EA}\x{1D200}-\x{1D241}\x{1D242}-\x{1D244}\x{1D245}\x{1D300}-\x{1D356}\x{1D6DB}\x{1D715}\x{1D74F}\x{1D789}\x{1D7C3}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E08F}\x{1E130}-\x{1E136}\x{1E2AE}\x{1E2EC}-\x{1E2EF}\x{1E2FF}\x{1E4EC}-\x{1E4EF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D0}-\x{1E8D6}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E944}-\x{1E94A}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF0}-\x{1EEF1}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F000}-\x{1F02B}\x{1F030}-\x{1F093}\x{1F0A0}-\x{1F0AE}\x{1F0B1}-\x{1F0BF}\x{1F0C1}-\x{1F0CF}\x{1F0D1}-\x{1F0F5}\x{1F10B}-\x{1F10C}\x{1F10D}-\x{1F10F}\x{1F12F}\x{1F16A}-\x{1F16F}\x{1F1AD}\x{1F260}-\x{1F265}\x{1F300}-\x{1F3FA}\x{1F3FB}-\x{1F3FF}\x{1F400}-\x{1F6D7}\x{1F6DC}-\x{1F6EC}\x{1F6F0}-\x{1F6FC}\x{1F700}-\x{1F776}\x{1F77B}-\x{1F7D9}\x{1F7E0}-\x{1F7EB}\x{1F7F0}\x{1F800}-\x{1F80B}\x{1F810}-\x{1F847}\x{1F850}-\x{1F859}\x{1F860}-\x{1F887}\x{1F890}-\x{1F8AD}\x{1F8B0}-\x{1F8B1}\x{1F900}-\x{1FA53}\x{1FA60}-\x{1FA6D}\x{1FA70}-\x{1FA7C}\x{1FA80}-\x{1FA88}\x{1FA90}-\x{1FABD}\x{1FABF}-\x{1FAC5}\x{1FACE}-\x{1FADB}\x{1FAE0}-\x{1FAE8}\x{1FAF0}-\x{1FAF8}\x{1FB00}-\x{1FB92}\x{1FB94}-\x{1FBCA}\x{1FFFE}-\x{1FFFF}\x{2FFFE}-\x{2FFFF}\x{3FFFE}-\x{3FFFF}\x{4FFFE}-\x{4FFFF}\x{5FFFE}-\x{5FFFF}\x{6FFFE}-\x{6FFFF}\x{7FFFE}-\x{7FFFF}\x{8FFFE}-\x{8FFFF}\x{9FFFE}-\x{9FFFF}\x{AFFFE}-\x{AFFFF}\x{BFFFE}-\x{BFFFF}\x{CFFFE}-\x{CFFFF}\x{DFFFE}-\x{E0000}\x{E0001}\x{E0002}-\x{E001F}\x{E0020}-\x{E007F}\x{E0080}-\x{E00FF}\x{E0100}-\x{E01EF}\x{E01F0}-\x{E0FFF}\x{EFFFE}-\x{EFFFF}\x{FFFFE}-\x{FFFFF}\x{10FFFE}-\x{10FFFF}][\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{0898}-\x{089F}\x{08CA}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3C}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECE}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1733}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{180F}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1ACE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DFF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10EFD}-\x{10EFF}\x{10F46}-\x{10F50}\x{10F82}-\x{10F85}\x{11001}\x{11038}-\x{11046}\x{11070}\x{11073}-\x{11074}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110C2}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{11241}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11F00}-\x{11F01}\x{11F36}-\x{11F3A}\x{11F40}\x{11F42}\x{13440}\x{13447}-\x{13455}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1CF00}-\x{1CF2D}\x{1CF30}-\x{1CF46}\x{1D167}-\x{1D169}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E08F}\x{1E130}-\x{1E136}\x{1E2AE}\x{1E2EC}-\x{1E2EF}\x{1E4EC}-\x{1E4EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{E0100}-\x{E01EF}]*$/u'; - const ZWNJ = '/([\x{A872}\x{10ACD}\x{10AD7}\x{10D00}\x{10FCB}\x{0620}\x{0626}\x{0628}\x{062A}-\x{062E}\x{0633}-\x{063F}\x{0641}-\x{0647}\x{0649}-\x{064A}\x{066E}-\x{066F}\x{0678}-\x{0687}\x{069A}-\x{06BF}\x{06C1}-\x{06C2}\x{06CC}\x{06CE}\x{06D0}-\x{06D1}\x{06FA}-\x{06FC}\x{06FF}\x{0712}-\x{0714}\x{071A}-\x{071D}\x{071F}-\x{0727}\x{0729}\x{072B}\x{072D}-\x{072E}\x{074E}-\x{0758}\x{075C}-\x{076A}\x{076D}-\x{0770}\x{0772}\x{0775}-\x{0777}\x{077A}-\x{077F}\x{07CA}-\x{07EA}\x{0841}-\x{0845}\x{0848}\x{084A}-\x{0853}\x{0855}\x{0860}\x{0862}-\x{0865}\x{0868}\x{08A0}-\x{08A9}\x{08AF}-\x{08B0}\x{08B3}-\x{08B4}\x{08B6}-\x{08B8}\x{08BA}-\x{08C7}\x{1807}\x{1820}-\x{1842}\x{1843}\x{1844}-\x{1878}\x{1887}-\x{18A8}\x{18AA}\x{A840}-\x{A871}\x{10AC0}-\x{10AC4}\x{10AD3}-\x{10AD6}\x{10AD8}-\x{10ADC}\x{10ADE}-\x{10AE0}\x{10AEB}-\x{10AEE}\x{10B80}\x{10B82}\x{10B86}-\x{10B88}\x{10B8A}-\x{10B8B}\x{10B8D}\x{10B90}\x{10BAD}-\x{10BAE}\x{10D01}-\x{10D21}\x{10D23}\x{10F30}-\x{10F32}\x{10F34}-\x{10F44}\x{10F51}-\x{10F53}\x{10FB0}\x{10FB2}-\x{10FB3}\x{10FB8}\x{10FBB}-\x{10FBC}\x{10FBE}-\x{10FBF}\x{10FC1}\x{10FC4}\x{10FCA}\x{1E900}-\x{1E943}][\x{00AD}\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{061C}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{070F}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CBF}\x{0CC6}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{200B}\x{200E}-\x{200F}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{206A}-\x{206F}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{FEFF}\x{FFF9}-\x{FFFB}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{13430}-\x{13438}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{1E94B}\x{E0001}\x{E0020}-\x{E007F}\x{E0100}-\x{E01EF}]*\x{200C}[\x{00AD}\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{061C}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{070F}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CBF}\x{0CC6}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{200B}\x{200E}-\x{200F}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{206A}-\x{206F}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{FEFF}\x{FFF9}-\x{FFFB}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{13430}-\x{13438}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{1E94B}\x{E0001}\x{E0020}-\x{E007F}\x{E0100}-\x{E01EF}]*)[\x{0622}-\x{0625}\x{0627}\x{0629}\x{062F}-\x{0632}\x{0648}\x{0671}-\x{0673}\x{0675}-\x{0677}\x{0688}-\x{0699}\x{06C0}\x{06C3}-\x{06CB}\x{06CD}\x{06CF}\x{06D2}-\x{06D3}\x{06D5}\x{06EE}-\x{06EF}\x{0710}\x{0715}-\x{0719}\x{071E}\x{0728}\x{072A}\x{072C}\x{072F}\x{074D}\x{0759}-\x{075B}\x{076B}-\x{076C}\x{0771}\x{0773}-\x{0774}\x{0778}-\x{0779}\x{0840}\x{0846}-\x{0847}\x{0849}\x{0854}\x{0856}-\x{0858}\x{0867}\x{0869}-\x{086A}\x{08AA}-\x{08AC}\x{08AE}\x{08B1}-\x{08B2}\x{08B9}\x{10AC5}\x{10AC7}\x{10AC9}-\x{10ACA}\x{10ACE}-\x{10AD2}\x{10ADD}\x{10AE1}\x{10AE4}\x{10AEF}\x{10B81}\x{10B83}-\x{10B85}\x{10B89}\x{10B8C}\x{10B8E}-\x{10B8F}\x{10B91}\x{10BA9}-\x{10BAC}\x{10D22}\x{10F33}\x{10F54}\x{10FB4}-\x{10FB6}\x{10FB9}-\x{10FBA}\x{10FBD}\x{10FC2}-\x{10FC3}\x{10FC9}\x{0620}\x{0626}\x{0628}\x{062A}-\x{062E}\x{0633}-\x{063F}\x{0641}-\x{0647}\x{0649}-\x{064A}\x{066E}-\x{066F}\x{0678}-\x{0687}\x{069A}-\x{06BF}\x{06C1}-\x{06C2}\x{06CC}\x{06CE}\x{06D0}-\x{06D1}\x{06FA}-\x{06FC}\x{06FF}\x{0712}-\x{0714}\x{071A}-\x{071D}\x{071F}-\x{0727}\x{0729}\x{072B}\x{072D}-\x{072E}\x{074E}-\x{0758}\x{075C}-\x{076A}\x{076D}-\x{0770}\x{0772}\x{0775}-\x{0777}\x{077A}-\x{077F}\x{07CA}-\x{07EA}\x{0841}-\x{0845}\x{0848}\x{084A}-\x{0853}\x{0855}\x{0860}\x{0862}-\x{0865}\x{0868}\x{08A0}-\x{08A9}\x{08AF}-\x{08B0}\x{08B3}-\x{08B4}\x{08B6}-\x{08B8}\x{08BA}-\x{08C7}\x{1807}\x{1820}-\x{1842}\x{1843}\x{1844}-\x{1878}\x{1887}-\x{18A8}\x{18AA}\x{A840}-\x{A871}\x{10AC0}-\x{10AC4}\x{10AD3}-\x{10AD6}\x{10AD8}-\x{10ADC}\x{10ADE}-\x{10AE0}\x{10AEB}-\x{10AEE}\x{10B80}\x{10B82}\x{10B86}-\x{10B88}\x{10B8A}-\x{10B8B}\x{10B8D}\x{10B90}\x{10BAD}-\x{10BAE}\x{10D01}-\x{10D21}\x{10D23}\x{10F30}-\x{10F32}\x{10F34}-\x{10F44}\x{10F51}-\x{10F53}\x{10FB0}\x{10FB2}-\x{10FB3}\x{10FB8}\x{10FBB}-\x{10FBC}\x{10FBE}-\x{10FBF}\x{10FC1}\x{10FC4}\x{10FCA}\x{1E900}-\x{1E943}]/u'; + const ZWNJ = '/([\x{A872}\x{10ACD}\x{10AD7}\x{10D00}\x{10FCB}\x{0620}\x{0626}\x{0628}\x{062A}-\x{062E}\x{0633}-\x{063F}\x{0641}-\x{0647}\x{0649}-\x{064A}\x{066E}-\x{066F}\x{0678}-\x{0687}\x{069A}-\x{06BF}\x{06C1}-\x{06C2}\x{06CC}\x{06CE}\x{06D0}-\x{06D1}\x{06FA}-\x{06FC}\x{06FF}\x{0712}-\x{0714}\x{071A}-\x{071D}\x{071F}-\x{0727}\x{0729}\x{072B}\x{072D}-\x{072E}\x{074E}-\x{0758}\x{075C}-\x{076A}\x{076D}-\x{0770}\x{0772}\x{0775}-\x{0777}\x{077A}-\x{077F}\x{07CA}-\x{07EA}\x{0841}-\x{0845}\x{0848}\x{084A}-\x{0853}\x{0855}\x{0860}\x{0862}-\x{0865}\x{0868}\x{0886}\x{0889}-\x{088D}\x{08A0}-\x{08A9}\x{08AF}-\x{08B0}\x{08B3}-\x{08B8}\x{08BA}-\x{08C8}\x{1807}\x{1820}-\x{1842}\x{1843}\x{1844}-\x{1878}\x{1887}-\x{18A8}\x{18AA}\x{A840}-\x{A871}\x{10AC0}-\x{10AC4}\x{10AD3}-\x{10AD6}\x{10AD8}-\x{10ADC}\x{10ADE}-\x{10AE0}\x{10AEB}-\x{10AEE}\x{10B80}\x{10B82}\x{10B86}-\x{10B88}\x{10B8A}-\x{10B8B}\x{10B8D}\x{10B90}\x{10BAD}-\x{10BAE}\x{10D01}-\x{10D21}\x{10D23}\x{10F30}-\x{10F32}\x{10F34}-\x{10F44}\x{10F51}-\x{10F53}\x{10F70}-\x{10F73}\x{10F76}-\x{10F81}\x{10FB0}\x{10FB2}-\x{10FB3}\x{10FB8}\x{10FBB}-\x{10FBC}\x{10FBE}-\x{10FBF}\x{10FC1}\x{10FC4}\x{10FCA}\x{1E900}-\x{1E943}][\x{00AD}\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{061C}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{070F}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{0898}-\x{089F}\x{08CA}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3C}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CBF}\x{0CC6}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECE}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1733}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{180F}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1ACE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DFF}\x{200B}\x{200E}-\x{200F}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{206A}-\x{206F}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{FEFF}\x{FFF9}-\x{FFFB}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10EFD}-\x{10EFF}\x{10F46}-\x{10F50}\x{10F82}-\x{10F85}\x{11001}\x{11038}-\x{11046}\x{11070}\x{11073}-\x{11074}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110C2}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{11241}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11F00}-\x{11F01}\x{11F36}-\x{11F3A}\x{11F40}\x{11F42}\x{13430}-\x{1343F}\x{13440}\x{13447}-\x{13455}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1CF00}-\x{1CF2D}\x{1CF30}-\x{1CF46}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E08F}\x{1E130}-\x{1E136}\x{1E2AE}\x{1E2EC}-\x{1E2EF}\x{1E4EC}-\x{1E4EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{1E94B}\x{E0001}\x{E0020}-\x{E007F}\x{E0100}-\x{E01EF}]*\x{200C}[\x{00AD}\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{061C}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{070F}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{0898}-\x{089F}\x{08CA}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3C}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CBF}\x{0CC6}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECE}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1733}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{180F}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1ACE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DFF}\x{200B}\x{200E}-\x{200F}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{206A}-\x{206F}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{FEFF}\x{FFF9}-\x{FFFB}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10EFD}-\x{10EFF}\x{10F46}-\x{10F50}\x{10F82}-\x{10F85}\x{11001}\x{11038}-\x{11046}\x{11070}\x{11073}-\x{11074}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110C2}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{11241}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11F00}-\x{11F01}\x{11F36}-\x{11F3A}\x{11F40}\x{11F42}\x{13430}-\x{1343F}\x{13440}\x{13447}-\x{13455}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1CF00}-\x{1CF2D}\x{1CF30}-\x{1CF46}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E08F}\x{1E130}-\x{1E136}\x{1E2AE}\x{1E2EC}-\x{1E2EF}\x{1E4EC}-\x{1E4EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{1E94B}\x{E0001}\x{E0020}-\x{E007F}\x{E0100}-\x{E01EF}]*)[\x{0622}-\x{0625}\x{0627}\x{0629}\x{062F}-\x{0632}\x{0648}\x{0671}-\x{0673}\x{0675}-\x{0677}\x{0688}-\x{0699}\x{06C0}\x{06C3}-\x{06CB}\x{06CD}\x{06CF}\x{06D2}-\x{06D3}\x{06D5}\x{06EE}-\x{06EF}\x{0710}\x{0715}-\x{0719}\x{071E}\x{0728}\x{072A}\x{072C}\x{072F}\x{074D}\x{0759}-\x{075B}\x{076B}-\x{076C}\x{0771}\x{0773}-\x{0774}\x{0778}-\x{0779}\x{0840}\x{0846}-\x{0847}\x{0849}\x{0854}\x{0856}-\x{0858}\x{0867}\x{0869}-\x{086A}\x{0870}-\x{0882}\x{088E}\x{08AA}-\x{08AC}\x{08AE}\x{08B1}-\x{08B2}\x{08B9}\x{10AC5}\x{10AC7}\x{10AC9}-\x{10ACA}\x{10ACE}-\x{10AD2}\x{10ADD}\x{10AE1}\x{10AE4}\x{10AEF}\x{10B81}\x{10B83}-\x{10B85}\x{10B89}\x{10B8C}\x{10B8E}-\x{10B8F}\x{10B91}\x{10BA9}-\x{10BAC}\x{10D22}\x{10F33}\x{10F54}\x{10F74}-\x{10F75}\x{10FB4}-\x{10FB6}\x{10FB9}-\x{10FBA}\x{10FBD}\x{10FC2}-\x{10FC3}\x{10FC9}\x{0620}\x{0626}\x{0628}\x{062A}-\x{062E}\x{0633}-\x{063F}\x{0641}-\x{0647}\x{0649}-\x{064A}\x{066E}-\x{066F}\x{0678}-\x{0687}\x{069A}-\x{06BF}\x{06C1}-\x{06C2}\x{06CC}\x{06CE}\x{06D0}-\x{06D1}\x{06FA}-\x{06FC}\x{06FF}\x{0712}-\x{0714}\x{071A}-\x{071D}\x{071F}-\x{0727}\x{0729}\x{072B}\x{072D}-\x{072E}\x{074E}-\x{0758}\x{075C}-\x{076A}\x{076D}-\x{0770}\x{0772}\x{0775}-\x{0777}\x{077A}-\x{077F}\x{07CA}-\x{07EA}\x{0841}-\x{0845}\x{0848}\x{084A}-\x{0853}\x{0855}\x{0860}\x{0862}-\x{0865}\x{0868}\x{0886}\x{0889}-\x{088D}\x{08A0}-\x{08A9}\x{08AF}-\x{08B0}\x{08B3}-\x{08B8}\x{08BA}-\x{08C8}\x{1807}\x{1820}-\x{1842}\x{1843}\x{1844}-\x{1878}\x{1887}-\x{18A8}\x{18AA}\x{A840}-\x{A871}\x{10AC0}-\x{10AC4}\x{10AD3}-\x{10AD6}\x{10AD8}-\x{10ADC}\x{10ADE}-\x{10AE0}\x{10AEB}-\x{10AEE}\x{10B80}\x{10B82}\x{10B86}-\x{10B88}\x{10B8A}-\x{10B8B}\x{10B8D}\x{10B90}\x{10BAD}-\x{10BAE}\x{10D01}-\x{10D21}\x{10D23}\x{10F30}-\x{10F32}\x{10F34}-\x{10F44}\x{10F51}-\x{10F53}\x{10F70}-\x{10F73}\x{10F76}-\x{10F81}\x{10FB0}\x{10FB2}-\x{10FB3}\x{10FB8}\x{10FBB}-\x{10FBC}\x{10FBE}-\x{10FBF}\x{10FC1}\x{10FC4}\x{10FCA}\x{1E900}-\x{1E943}]/u'; } diff --git a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php index 25a5f564d5..b5b21886f7 100644 --- a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php +++ b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php @@ -47,7 +47,6 @@ 1540 => true, 1541 => true, 1564 => true, - 1565 => true, 1757 => true, 1806 => true, 1807 => true, @@ -75,18 +74,20 @@ 2140 => true, 2141 => true, 2143 => true, - 2229 => true, - 2248 => true, - 2249 => true, - 2250 => true, - 2251 => true, - 2252 => true, - 2253 => true, - 2254 => true, - 2255 => true, - 2256 => true, - 2257 => true, - 2258 => true, + 2155 => true, + 2156 => true, + 2157 => true, + 2158 => true, + 2159 => true, + 2191 => true, + 2192 => true, + 2193 => true, + 2194 => true, + 2195 => true, + 2196 => true, + 2197 => true, + 2198 => true, + 2199 => true, 2274 => true, 2436 => true, 2445 => true, @@ -303,7 +304,6 @@ 3113 => true, 3130 => true, 3131 => true, - 3132 => true, 3141 => true, 3145 => true, 3150 => true, @@ -316,7 +316,6 @@ 3159 => true, 3163 => true, 3164 => true, - 3165 => true, 3166 => true, 3167 => true, 3172 => true, @@ -349,12 +348,10 @@ 3290 => true, 3291 => true, 3292 => true, - 3293 => true, 3295 => true, 3300 => true, 3301 => true, 3312 => true, - 3315 => true, 3316 => true, 3317 => true, 3318 => true, @@ -428,7 +425,6 @@ 3775 => true, 3781 => true, 3783 => true, - 3790 => true, 3791 => true, 3802 => true, 3803 => true, @@ -497,8 +493,6 @@ 5885 => true, 5886 => true, 5887 => true, - 5901 => true, - 5909 => true, 5910 => true, 5911 => true, 5912 => true, @@ -508,7 +502,6 @@ 5916 => true, 5917 => true, 5918 => true, - 5919 => true, 5943 => true, 5944 => true, 5945 => true, @@ -562,7 +555,6 @@ 6143 => true, 6150 => true, 6158 => true, - 6159 => true, 6170 => true, 6171 => true, 6172 => true, @@ -648,12 +640,9 @@ 6815 => true, 6830 => true, 6831 => true, - 6988 => true, 6989 => true, 6990 => true, 6991 => true, - 7037 => true, - 7038 => true, 7039 => true, 7156 => true, 7157 => true, @@ -691,7 +680,6 @@ 7421 => true, 7422 => true, 7423 => true, - 7674 => true, 7958 => true, 7959 => true, 7966 => true, @@ -747,7 +735,6 @@ 8349 => true, 8350 => true, 8351 => true, - 8384 => true, 8385 => true, 8386 => true, 8387 => true, @@ -853,8 +840,6 @@ 11124 => true, 11125 => true, 11158 => true, - 11311 => true, - 11359 => true, 11508 => true, 11509 => true, 11510 => true, @@ -988,9 +973,6 @@ 13250 => true, 13255 => true, 13272 => true, - 40957 => true, - 40958 => true, - 40959 => true, 42125 => true, 42126 => true, 42127 => true, @@ -1031,8 +1013,37 @@ 42749 => true, 42750 => true, 42751 => true, - 42944 => true, - 42945 => true, + 42955 => true, + 42956 => true, + 42957 => true, + 42958 => true, + 42959 => true, + 42962 => true, + 42964 => true, + 42970 => true, + 42971 => true, + 42972 => true, + 42973 => true, + 42974 => true, + 42975 => true, + 42976 => true, + 42977 => true, + 42978 => true, + 42979 => true, + 42980 => true, + 42981 => true, + 42982 => true, + 42983 => true, + 42984 => true, + 42985 => true, + 42986 => true, + 42987 => true, + 42988 => true, + 42989 => true, + 42990 => true, + 42991 => true, + 42992 => true, + 42993 => true, 43053 => true, 43054 => true, 43055 => true, @@ -1202,7 +1213,6 @@ 64319 => true, 64322 => true, 64325 => true, - 64450 => true, 64451 => true, 64452 => true, 64453 => true, @@ -1219,22 +1229,6 @@ 64464 => true, 64465 => true, 64466 => true, - 64832 => true, - 64833 => true, - 64834 => true, - 64835 => true, - 64836 => true, - 64837 => true, - 64838 => true, - 64839 => true, - 64840 => true, - 64841 => true, - 64842 => true, - 64843 => true, - 64844 => true, - 64845 => true, - 64846 => true, - 64847 => true, 64912 => true, 64913 => true, 64968 => true, @@ -1244,9 +1238,6 @@ 64972 => true, 64973 => true, 64974 => true, - 64975 => true, - 65022 => true, - 65023 => true, 65042 => true, 65049 => true, 65050 => true, @@ -1401,6 +1392,13 @@ 66924 => true, 66925 => true, 66926 => true, + 66939 => true, + 66955 => true, + 66963 => true, + 66966 => true, + 66978 => true, + 66994 => true, + 67002 => true, 67383 => true, 67384 => true, 67385 => true, @@ -1420,6 +1418,32 @@ 67421 => true, 67422 => true, 67423 => true, + 67432 => true, + 67433 => true, + 67434 => true, + 67435 => true, + 67436 => true, + 67437 => true, + 67438 => true, + 67439 => true, + 67440 => true, + 67441 => true, + 67442 => true, + 67443 => true, + 67444 => true, + 67445 => true, + 67446 => true, + 67447 => true, + 67448 => true, + 67449 => true, + 67450 => true, + 67451 => true, + 67452 => true, + 67453 => true, + 67454 => true, + 67455 => true, + 67462 => true, + 67505 => true, 67590 => true, 67591 => true, 67593 => true, @@ -1568,6 +1592,28 @@ 69421 => true, 69422 => true, 69423 => true, + 69466 => true, + 69467 => true, + 69468 => true, + 69469 => true, + 69470 => true, + 69471 => true, + 69472 => true, + 69473 => true, + 69474 => true, + 69475 => true, + 69476 => true, + 69477 => true, + 69478 => true, + 69479 => true, + 69480 => true, + 69481 => true, + 69482 => true, + 69483 => true, + 69484 => true, + 69485 => true, + 69486 => true, + 69487 => true, 69580 => true, 69581 => true, 69582 => true, @@ -1601,12 +1647,6 @@ 69711 => true, 69712 => true, 69713 => true, - 69744 => true, - 69745 => true, - 69746 => true, - 69747 => true, - 69748 => true, - 69749 => true, 69750 => true, 69751 => true, 69752 => true, @@ -1617,7 +1657,6 @@ 69757 => true, 69758 => true, 69821 => true, - 69826 => true, 69827 => true, 69828 => true, 69829 => true, @@ -1804,7 +1843,6 @@ 71293 => true, 71294 => true, 71295 => true, - 71353 => true, 71354 => true, 71355 => true, 71356 => true, @@ -1899,22 +1937,13 @@ 72365 => true, 72366 => true, 72367 => true, - 72368 => true, - 72369 => true, - 72370 => true, - 72371 => true, - 72372 => true, - 72373 => true, - 72374 => true, - 72375 => true, - 72376 => true, - 72377 => true, - 72378 => true, - 72379 => true, - 72380 => true, - 72381 => true, - 72382 => true, - 72383 => true, + 72441 => true, + 72442 => true, + 72443 => true, + 72444 => true, + 72445 => true, + 72446 => true, + 72447 => true, 72713 => true, 72759 => true, 72774 => true, @@ -1965,6 +1994,17 @@ 73117 => true, 73118 => true, 73119 => true, + 73465 => true, + 73466 => true, + 73467 => true, + 73468 => true, + 73469 => true, + 73470 => true, + 73471 => true, + 73489 => true, + 73531 => true, + 73532 => true, + 73533 => true, 73649 => true, 73650 => true, 73651 => true, @@ -2005,7 +2045,19 @@ 74877 => true, 74878 => true, 74879 => true, - 78895 => true, + 77811 => true, + 77812 => true, + 77813 => true, + 77814 => true, + 77815 => true, + 77816 => true, + 77817 => true, + 77818 => true, + 77819 => true, + 77820 => true, + 77821 => true, + 77822 => true, + 77823 => true, 78896 => true, 78897 => true, 78898 => true, @@ -2015,6 +2067,13 @@ 78902 => true, 78903 => true, 78904 => true, + 78905 => true, + 78906 => true, + 78907 => true, + 78908 => true, + 78909 => true, + 78910 => true, + 78911 => true, 92729 => true, 92730 => true, 92731 => true, @@ -2027,6 +2086,13 @@ 92779 => true, 92780 => true, 92781 => true, + 92863 => true, + 92874 => true, + 92875 => true, + 92876 => true, + 92877 => true, + 92878 => true, + 92879 => true, 92910 => true, 92911 => true, 92918 => true, @@ -2100,9 +2166,55 @@ 100349 => true, 100350 => true, 100351 => true, + 110580 => true, + 110588 => true, + 110591 => true, + 110883 => true, + 110884 => true, + 110885 => true, + 110886 => true, + 110887 => true, + 110888 => true, + 110889 => true, + 110890 => true, + 110891 => true, + 110892 => true, + 110893 => true, + 110894 => true, + 110895 => true, + 110896 => true, + 110897 => true, + 110899 => true, + 110900 => true, + 110901 => true, + 110902 => true, + 110903 => true, + 110904 => true, + 110905 => true, + 110906 => true, + 110907 => true, + 110908 => true, + 110909 => true, + 110910 => true, + 110911 => true, + 110912 => true, + 110913 => true, + 110914 => true, + 110915 => true, + 110916 => true, + 110917 => true, + 110918 => true, + 110919 => true, + 110920 => true, + 110921 => true, + 110922 => true, + 110923 => true, + 110924 => true, + 110925 => true, + 110926 => true, + 110927 => true, 110931 => true, 110932 => true, - 110933 => true, 110934 => true, 110935 => true, 110936 => true, @@ -2142,6 +2254,17 @@ 113807 => true, 113818 => true, 113819 => true, + 118574 => true, + 118575 => true, + 118599 => true, + 118600 => true, + 118601 => true, + 118602 => true, + 118603 => true, + 118604 => true, + 118605 => true, + 118606 => true, + 118607 => true, 119030 => true, 119031 => true, 119032 => true, @@ -2162,8 +2285,6 @@ 119160 => true, 119161 => true, 119162 => true, - 119273 => true, - 119274 => true, 119275 => true, 119276 => true, 119277 => true, @@ -2185,6 +2306,18 @@ 119293 => true, 119294 => true, 119295 => true, + 119508 => true, + 119509 => true, + 119510 => true, + 119511 => true, + 119512 => true, + 119513 => true, + 119514 => true, + 119515 => true, + 119516 => true, + 119517 => true, + 119518 => true, + 119519 => true, 119540 => true, 119541 => true, 119542 => true, @@ -2250,11 +2383,22 @@ 121497 => true, 121498 => true, 121504 => true, + 122655 => true, + 122656 => true, + 122657 => true, + 122658 => true, + 122659 => true, + 122660 => true, 122887 => true, 122905 => true, 122906 => true, 122914 => true, 122917 => true, + 122923 => true, + 122924 => true, + 122925 => true, + 122926 => true, + 122927 => true, 123181 => true, 123182 => true, 123183 => true, @@ -2264,11 +2408,32 @@ 123211 => true, 123212 => true, 123213 => true, + 123567 => true, + 123568 => true, + 123569 => true, + 123570 => true, + 123571 => true, + 123572 => true, + 123573 => true, + 123574 => true, + 123575 => true, + 123576 => true, + 123577 => true, + 123578 => true, + 123579 => true, + 123580 => true, + 123581 => true, + 123582 => true, + 123583 => true, 123642 => true, 123643 => true, 123644 => true, 123645 => true, 123646 => true, + 124903 => true, + 124908 => true, + 124911 => true, + 124927 => true, 125125 => true, 125126 => true, 125260 => true, @@ -2399,29 +2564,16 @@ 128729 => true, 128730 => true, 128731 => true, - 128732 => true, - 128733 => true, - 128734 => true, - 128735 => true, 128749 => true, 128750 => true, 128751 => true, 128765 => true, 128766 => true, 128767 => true, - 128884 => true, - 128885 => true, - 128886 => true, 128887 => true, 128888 => true, 128889 => true, 128890 => true, - 128891 => true, - 128892 => true, - 128893 => true, - 128894 => true, - 128895 => true, - 128985 => true, 128986 => true, 128987 => true, 128988 => true, @@ -2432,7 +2584,6 @@ 129005 => true, 129006 => true, 129007 => true, - 129008 => true, 129009 => true, 129010 => true, 129011 => true, @@ -2476,8 +2627,6 @@ 129167 => true, 129198 => true, 129199 => true, - 129401 => true, - 129484 => true, 129620 => true, 129621 => true, 129622 => true, @@ -2492,16 +2641,9 @@ 129631 => true, 129646 => true, 129647 => true, - 129653 => true, - 129654 => true, - 129655 => true, - 129659 => true, - 129660 => true, 129661 => true, 129662 => true, 129663 => true, - 129671 => true, - 129672 => true, 129673 => true, 129674 => true, 129675 => true, @@ -2509,25 +2651,7 @@ 129677 => true, 129678 => true, 129679 => true, - 129705 => true, - 129706 => true, - 129707 => true, - 129708 => true, - 129709 => true, - 129710 => true, - 129711 => true, - 129719 => true, - 129720 => true, - 129721 => true, - 129722 => true, - 129723 => true, - 129724 => true, - 129725 => true, 129726 => true, - 129727 => true, - 129731 => true, - 129732 => true, - 129733 => true, 129734 => true, 129735 => true, 129736 => true, @@ -2536,16 +2660,27 @@ 129739 => true, 129740 => true, 129741 => true, - 129742 => true, - 129743 => true, + 129756 => true, + 129757 => true, + 129758 => true, + 129759 => true, + 129769 => true, + 129770 => true, + 129771 => true, + 129772 => true, + 129773 => true, + 129774 => true, + 129775 => true, + 129785 => true, + 129786 => true, + 129787 => true, + 129788 => true, + 129789 => true, + 129790 => true, + 129791 => true, 129939 => true, 131070 => true, 131071 => true, - 177973 => true, - 177974 => true, - 177975 => true, - 177976 => true, - 177977 => true, 177978 => true, 177979 => true, 177980 => true, @@ -2568,6 +2703,21 @@ 183981 => true, 183982 => true, 183983 => true, + 191457 => true, + 191458 => true, + 191459 => true, + 191460 => true, + 191461 => true, + 191462 => true, + 191463 => true, + 191464 => true, + 191465 => true, + 191466 => true, + 191467 => true, + 191468 => true, + 191469 => true, + 191470 => true, + 191471 => true, 194664 => true, 194676 => true, 194847 => true, @@ -2575,6 +2725,11 @@ 195007 => true, 196606 => true, 196607 => true, + 201547 => true, + 201548 => true, + 201549 => true, + 201550 => true, + 201551 => true, 262142 => true, 262143 => true, 327678 => true, diff --git a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php index 223396ec4c..8bc0954b3d 100644 --- a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php +++ b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php @@ -65,7 +65,4 @@ 125 => true, 126 => true, 127 => true, - 8800 => true, - 8814 => true, - 8815 => true, ); diff --git a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php index b377844130..c421fe3261 100644 --- a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php +++ b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php @@ -6,6 +6,7 @@ 6155 => true, 6156 => true, 6157 => true, + 6159 => true, 8203 => true, 8288 => true, 8292 => true, diff --git a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php index 9b85fe9d3f..2adf034e7d 100644 --- a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php +++ b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php @@ -805,7 +805,7 @@ 7828 => 'ẕ', 7834 => 'aʾ', 7835 => 'ṡ', - 7838 => 'ss', + 7838 => 'ß', 7840 => 'ạ', 7842 => 'ả', 7844 => 'ấ', @@ -1266,6 +1266,7 @@ 11308 => 'ⱜ', 11309 => 'ⱝ', 11310 => 'ⱞ', + 11311 => 'ⱟ', 11360 => 'ⱡ', 11362 => 'ɫ', 11363 => 'ᵽ', @@ -2214,12 +2215,19 @@ 42938 => 'ꞻ', 42940 => 'ꞽ', 42942 => 'ꞿ', + 42944 => 'ꟁ', 42946 => 'ꟃ', 42948 => 'ꞔ', 42949 => 'ʂ', 42950 => 'ᶎ', 42951 => 'ꟈ', 42953 => 'ꟊ', + 42960 => 'ꟑ', + 42966 => 'ꟗ', + 42968 => 'ꟙ', + 42994 => 'c', + 42995 => 'f', + 42996 => 'q', 42997 => 'ꟶ', 43000 => 'ħ', 43001 => 'œ', @@ -3830,6 +3838,97 @@ 66769 => '𐓹', 66770 => '𐓺', 66771 => '𐓻', + 66928 => '𐖗', + 66929 => '𐖘', + 66930 => '𐖙', + 66931 => '𐖚', + 66932 => '𐖛', + 66933 => '𐖜', + 66934 => '𐖝', + 66935 => '𐖞', + 66936 => '𐖟', + 66937 => '𐖠', + 66938 => '𐖡', + 66940 => '𐖣', + 66941 => '𐖤', + 66942 => '𐖥', + 66943 => '𐖦', + 66944 => '𐖧', + 66945 => '𐖨', + 66946 => '𐖩', + 66947 => '𐖪', + 66948 => '𐖫', + 66949 => '𐖬', + 66950 => '𐖭', + 66951 => '𐖮', + 66952 => '𐖯', + 66953 => '𐖰', + 66954 => '𐖱', + 66956 => '𐖳', + 66957 => '𐖴', + 66958 => '𐖵', + 66959 => '𐖶', + 66960 => '𐖷', + 66961 => '𐖸', + 66962 => '𐖹', + 66964 => '𐖻', + 66965 => '𐖼', + 67457 => 'ː', + 67458 => 'ˑ', + 67459 => 'æ', + 67460 => 'ʙ', + 67461 => 'ɓ', + 67463 => 'ʣ', + 67464 => 'ꭦ', + 67465 => 'ʥ', + 67466 => 'ʤ', + 67467 => 'ɖ', + 67468 => 'ɗ', + 67469 => 'ᶑ', + 67470 => 'ɘ', + 67471 => 'ɞ', + 67472 => 'ʩ', + 67473 => 'ɤ', + 67474 => 'ɢ', + 67475 => 'ɠ', + 67476 => 'ʛ', + 67477 => 'ħ', + 67478 => 'ʜ', + 67479 => 'ɧ', + 67480 => 'ʄ', + 67481 => 'ʪ', + 67482 => 'ʫ', + 67483 => 'ɬ', + 67484 => '𝼄', + 67485 => 'ꞎ', + 67486 => 'ɮ', + 67487 => '𝼅', + 67488 => 'ʎ', + 67489 => '𝼆', + 67490 => 'ø', + 67491 => 'ɶ', + 67492 => 'ɷ', + 67493 => 'q', + 67494 => 'ɺ', + 67495 => '𝼈', + 67496 => 'ɽ', + 67497 => 'ɾ', + 67498 => 'ʀ', + 67499 => 'ʨ', + 67500 => 'ʦ', + 67501 => 'ꭧ', + 67502 => 'ʧ', + 67503 => 'ʈ', + 67504 => 'ⱱ', + 67506 => 'ʏ', + 67507 => 'ʡ', + 67508 => 'ʢ', + 67509 => 'ʘ', + 67510 => 'ǀ', + 67511 => 'ǁ', + 67512 => 'ǂ', + 67513 => '𝼊', + 67514 => '𝼞', 68736 => '𐳀', 68737 => '𐳁', 68738 => '𐳂', @@ -4954,6 +5053,68 @@ 120829 => '7', 120830 => '8', 120831 => '9', + 122928 => 'а', + 122929 => 'б', + 122930 => 'в', + 122931 => 'г', + 122932 => 'д', + 122933 => 'е', + 122934 => 'ж', + 122935 => 'з', + 122936 => 'и', + 122937 => 'к', + 122938 => 'л', + 122939 => 'м', + 122940 => 'о', + 122941 => 'п', + 122942 => 'р', + 122943 => 'с', + 122944 => 'т', + 122945 => 'у', + 122946 => 'ф', + 122947 => 'х', + 122948 => 'ц', + 122949 => 'ч', + 122950 => 'ш', + 122951 => 'ы', + 122952 => 'э', + 122953 => 'ю', + 122954 => 'ꚉ', + 122955 => 'ә', + 122956 => 'і', + 122957 => 'ј', + 122958 => 'ө', + 122959 => 'ү', + 122960 => 'ӏ', + 122961 => 'а', + 122962 => 'б', + 122963 => 'в', + 122964 => 'г', + 122965 => 'д', + 122966 => 'е', + 122967 => 'ж', + 122968 => 'з', + 122969 => 'и', + 122970 => 'к', + 122971 => 'л', + 122972 => 'о', + 122973 => 'п', + 122974 => 'с', + 122975 => 'у', + 122976 => 'ф', + 122977 => 'х', + 122978 => 'ц', + 122979 => 'ч', + 122980 => 'ш', + 122981 => 'ъ', + 122982 => 'ы', + 122983 => 'ґ', + 122984 => 'і', + 122985 => 'ѕ', + 122986 => 'џ', + 122987 => 'ҫ', + 122988 => 'ꙑ', + 122989 => 'ұ', 125184 => '𞤢', 125185 => '𞤣', 125186 => '𞤤', diff --git a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php index 1958e37ed2..440faceada 100644 --- a/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php +++ b/core/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php @@ -19,6 +19,7 @@ 4153 => 9, 4154 => 9, 5908 => 9, + 5909 => 9, 5940 => 9, 6098 => 9, 6752 => 9, @@ -37,6 +38,7 @@ 44013 => 9, 68159 => 9, 69702 => 9, + 69744 => 9, 69759 => 9, 69817 => 9, 69939 => 9, @@ -62,4 +64,6 @@ 73028 => 9, 73029 => 9, 73111 => 9, + 73537 => 9, + 73538 => 9, ); diff --git a/core/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/core/vendor/symfony/polyfill-intl-normalizer/Normalizer.php index d8c71b8770..3a3312d8a9 100644 --- a/core/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ b/core/vendor/symfony/polyfill-intl-normalizer/Normalizer.php @@ -41,29 +41,33 @@ class Normalizer private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; - public static function isNormalized(string $s, int $form = self::FORM_C) + public static function isNormalized(string $string, int $form = self::FORM_C) { if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { - return false; + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError('normalizer_is_normalized(): Argument #2 ($form) must be a '.(80600 > \PHP_VERSION_ID ? 'a ' : '').'valid normalization form'); } - if (!isset($s[strspn($s, self::$ASCII)])) { + if (!isset($string[strspn($string, self::$ASCII)])) { return true; } - if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { + if (self::NFC == $form && preg_match('//u', $string) && !preg_match('/[^\x00-\x{2FF}]/u', $string)) { return true; } - return self::normalize($s, $form) === $s; + return self::normalize($string, $form) === $string; } - public static function getRawDecomposition(string $s, int $form = self::FORM_C) + public static function getRawDecomposition(string $string, int $form = self::FORM_C) { - if ('' === $s || !preg_match('//u', $s)) { + if ('' === $string || !preg_match('//u', $string)) { return null; } - $ulen = $s[0] < "\x80" ? 1 : (self::$ulenMask[$s[0] & "\xF0"] ?? 0); - if (!$ulen || \strlen($s) !== $ulen) { + $ulen = $string[0] < "\x80" ? 1 : (self::$ulenMask[$string[0] & "\xF0"] ?? 0); + if (!$ulen || \strlen($string) !== $ulen) { return null; } @@ -71,8 +75,8 @@ public static function getRawDecomposition(string $s, int $form = self::FORM_C) return ''; } - if ($s >= "\xEA\xB0\x80" && $s <= "\xED\x9E\xA3") { - $u = unpack('C*', $s); + if ($string >= "\xEA\xB0\x80" && $string <= "\xED\x9E\xA3") { + $u = unpack('C*', $string); $j = (($u[1] - 224) << 12) + (($u[2] - 128) << 6) + $u[3] - 0xAC80; if ($t = $j % 28) { @@ -94,8 +98,8 @@ public static function getRawDecomposition(string $s, int $form = self::FORM_C) self::$rawD = self::getData('rawCanonicalDecomposition'); } - if (isset(self::$rawD[$s])) { - return self::$rawD[$s]; + if (isset(self::$rawD[$string])) { + return self::$rawD[$string]; } if (self::NFKC === $form || self::NFKD === $form) { @@ -103,18 +107,14 @@ public static function getRawDecomposition(string $s, int $form = self::FORM_C) self::$rawKD = self::getData('rawCompatibilityDecomposition'); } - return self::$rawKD[$s] ?? null; + return self::$rawKD[$string] ?? null; } return null; } - public static function normalize(string $s, int $form = self::FORM_C) + public static function normalize(string $string, int $form = self::FORM_C) { - if (!preg_match('//u', $s)) { - return false; - } - switch ($form) { case self::NFC: $C = true; $K = false; break; case self::NFD: $C = false; $K = false; break; @@ -122,7 +122,7 @@ public static function normalize(string $s, int $form = self::FORM_C) case self::NFKD: $C = false; $K = true; break; default: if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { - return $s; + return preg_match('//u', $string) ? $string : false; } if (80000 > \PHP_VERSION_ID) { @@ -133,7 +133,11 @@ public static function normalize(string $s, int $form = self::FORM_C) throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a '.(80600 > \PHP_VERSION_ID ? 'a ' : '').'valid normalization form'); } - if ('' === $s) { + if (!preg_match('//u', $string)) { + return false; + } + + if ('' === $string) { return ''; } @@ -150,7 +154,7 @@ public static function normalize(string $s, int $form = self::FORM_C) mb_internal_encoding('8bit'); } - $r = self::decompose($s, $K); + $r = self::decompose($string, $K); if ($C) { if (null === self::$C) { diff --git a/core/vendor/symfony/polyfill-mbstring/Mbstring.php b/core/vendor/symfony/polyfill-mbstring/Mbstring.php index e3d1f965fe..bc9e6acfa4 100644 --- a/core/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/core/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -79,20 +79,58 @@ final class Mbstring ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], ]; + // Encodings rejected by mb_ord() and mb_chr(), with their aliases + private const UNSUPPORTED_CODEPOINT_ENCODINGS = [ + 'BASE64' => 'BASE64', + 'UUENCODE' => 'UUENCODE', + 'X-UUENCODE' => 'UUENCODE', + 'HTML-ENTITIES' => 'HTML-ENTITIES', + 'HTML' => 'HTML-ENTITIES', + 'QUOTED-PRINTABLE' => 'Quoted-Printable', + 'QPRINT' => 'Quoted-Printable', + 'UTF-7' => 'UTF-7', + 'UTF7' => 'UTF-7', + 'UTF7-IMAP' => 'UTF7-IMAP', + 'MUTF-7' => 'UTF7-IMAP', + 'JIS' => 'JIS', + 'ISO-2022-JP' => 'ISO-2022-JP', + 'ISO-2022-JP-2004' => 'ISO-2022-JP-2004', + 'ISO-2022-JP-MOBILE#KDDI' => 'ISO-2022-JP-MOBILE#KDDI', + 'ISO-2022-JP-KDDI' => 'ISO-2022-JP-MOBILE#KDDI', + 'ISO-2022-JP-MS' => 'ISO-2022-JP-MS', + 'ISO2022JPMS' => 'ISO-2022-JP-MS', + 'CP50220' => 'CP50220', + 'CP50220RAW' => 'CP50220', + 'CP50220-RAW' => 'CP50220', + 'JIS-MS' => 'CP50220', + 'CP50221' => 'CP50221', + 'CP50222' => 'CP50222', + ]; + + // Well-formed characters in group 1, then the maximal subparts of ill-formed sequences + private const UTF8_CHAR_REGEX = '/([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})|\xE0[\xA0-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]|\xED[\x80-\x9F]|\xF0[\x90-\xBF][\x80-\xBF]?|[\xF1-\xF3][\x80-\xBF]{1,2}|\xF4[\x80-\x8F][\x80-\xBF]?|[\x80-\xFF]/'; + private static $encodingList = ['ASCII', 'UTF-8']; private static $language = 'neutral'; private static $internalEncoding = 'UTF-8'; private static $iconvSupportsIgnore; + private static $convertibleEncodings = ['UTF-8' => true]; public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($s)) { - $r = []; - foreach ($s as $str) { - $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); - } + if (\is_string($fromEncoding) && 2 < \strlen($fromEncoding) && '"' === $fromEncoding[0] && '"' === $fromEncoding[-1]) { + $fromEncoding = substr($fromEncoding, 1, -1); + } - return $r; + if (80000 <= \PHP_VERSION_ID + && (!isset(self::$convertibleEncodings[$toEncoding]) || (null !== $fromEncoding && !(\is_string($fromEncoding) && isset(self::$convertibleEncodings[$fromEncoding])))) + && null !== $error = self::getConversionError('mb_convert_encoding', 2, $toEncoding, $fromEncoding) + ) { + throw new \ValueError($error); + } + + if (\is_array($s)) { + return self::convertArray($s, $toEncoding, $fromEncoding); } if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { @@ -118,6 +156,8 @@ public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null } if ('UTF-8' !== $fromEncoding) { $s = self::iconv($fromEncoding, 'UTF-8', $s); + } elseif (!preg_match('//u', $s)) { + $s = self::scrubUtf8($s); } return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); @@ -157,17 +197,42 @@ public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null $fromEncoding = 'UTF-8'; } + if ('UTF-8' === $fromEncoding && !preg_match('//u', $s)) { + $s = self::scrubUtf8($s); + } + return self::iconv($fromEncoding, $toEncoding, $s); } public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) { + if (\is_string($fromEncoding) && 2 < \strlen($fromEncoding) && '"' === $fromEncoding[0] && '"' === $fromEncoding[-1]) { + $fromEncoding = substr($fromEncoding, 1, -1); + } + + if (80000 <= \PHP_VERSION_ID && null !== $error = self::getConversionError('mb_convert_variables', 1, $toEncoding, $fromEncoding)) { + throw new \ValueError($error); + } + $ok = true; - array_walk_recursive($vars, static function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; + foreach ($vars as $i => &$var) { + $convert = static function (&$v) use (&$ok, $toEncoding, $fromEncoding, $i) { + if (\is_string($v)) { + if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + $ok = false; + } + } elseif (80600 <= \PHP_VERSION_ID && !\is_object($v)) { + trigger_error(\sprintf('mb_convert_variables(): Argument #%d must be of type string|array|object or only contain entries of type string|array|object, %s given', 3 + $i, strtok(get_debug_type($v), ' ')), \E_USER_WARNING); + } + }; + + if (\is_array($var)) { + array_walk_recursive($var, $convert); + } else { + $convert($var); } - }); + } + unset($var); return $ok ? $fromEncoding : false; } @@ -210,7 +275,7 @@ public static function mb_decode_numericentity($s, $convmap, $encoding = null) if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @self::iconv('UTF-8', 'UTF-8', $s); + $s = self::scrubUtf8($s); } } else { $s = self::iconv($encoding, 'UTF-8', $s); @@ -276,7 +341,7 @@ public static function mb_encode_numericentity($s, $convmap, $encoding = null, $ if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @self::iconv('UTF-8', 'UTF-8', $s); + $s = self::scrubUtf8($s); } } else { $s = self::iconv($encoding, 'UTF-8', $s); @@ -290,10 +355,15 @@ public static function mb_encode_numericentity($s, $convmap, $encoding = null, $ $result = ''; while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"] ?? 1; $uchr = substr($s, $i, $ulen); $i += $ulen; - $c = self::mb_ord($uchr); + + // code points above U+10FFFF are outside any convmap, but mb_ord() rejects them + if (false === $c = self::mb_ord($uchr)) { + $result .= $uchr; + continue; + } for ($j = 0; $j < $cnt; $j += 4) { if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { @@ -324,7 +394,7 @@ public static function mb_convert_case($s, $mode, $encoding = null) if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @self::iconv('UTF-8', 'UTF-8', $s); + $s = self::scrubUtf8($s); } } else { $s = self::iconv($encoding, 'UTF-8', $s); @@ -365,7 +435,7 @@ public static function mb_convert_case($s, $mode, $encoding = null) $len = \strlen($s); while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"] ?? 1; $uchr = substr($s, $i, $ulen); $i += $ulen; @@ -462,6 +532,10 @@ public static function mb_check_encoding($var = null, $encoding = null) } if (!\is_array($var)) { + if ('UTF-8' === self::getEncoding($encoding)) { + return (bool) preg_match('//u', $var); + } + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); } @@ -562,50 +636,16 @@ public static function mb_strlen($s, $encoding = null) public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strpos($haystack, $needle, $offset); - } - - $needle = (string) $needle; - if ('' === $needle) { - if (80000 > \PHP_VERSION_ID) { - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - - return false; - } - - return 0; - } - - return iconv_strpos($haystack, $needle, $offset, $encoding); + return self::find(__FUNCTION__, $haystack, $needle, $offset, $encoding, false, false); } public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrpos($haystack, $needle, $offset); - } - if ($offset != (int) $offset) { $offset = 0; - } elseif ($offset = (int) $offset) { - if ($offset < 0) { - if (0 > $offset += self::mb_strlen($needle)) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); - } - $offset = 0; - } else { - $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); - } } - $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? iconv_strrpos($haystack, $needle, $encoding) - : self::mb_strlen($haystack, $encoding); - - return false !== $pos ? $offset + $pos : false; + return self::find(__FUNCTION__, $haystack, $needle, $offset, $encoding, true, false); } public static function mb_str_split($string, $split_length = 1, $encoding = null) @@ -626,17 +666,27 @@ public static function mb_str_split($string, $split_length = 1, $encoding = null throw new \ValueError('Argument #2 ($length) must be greater than 0'); } + if (80300 <= \PHP_VERSION_ID && 0x3FFFFFFF < $split_length) { + throw new \ValueError('Argument #2 ($length) is too large'); + } + if (null === $encoding) { $encoding = mb_internal_encoding(); } if ('UTF-8' === $encoding = self::getEncoding($encoding)) { + $string = (string) $string; + + if (\strlen($string) <= $split_length) { + return '' === $string ? [] : [$string]; + } + $rx = '/('; while (65535 < $split_length) { $rx .= '.{65535}'; $split_length -= 65535; } - $rx .= '.{'.$split_length.'})/us'; + $rx .= '.{'.$split_length.'})/Aus'; return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); } @@ -707,64 +757,32 @@ public static function mb_substr($s, $start, $length = null, $encoding = null) public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { - [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ - self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), - self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), - ]); - - return self::mb_strpos($haystack, $needle, $offset, $encoding); + return self::find(__FUNCTION__, $haystack, $needle, $offset, $encoding, false, true); } public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) { - $pos = self::mb_stripos($haystack, $needle, 0, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); + return self::findPart(__FUNCTION__, $haystack, $needle, $part, $encoding, false, true); } public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - $pos = strrpos($haystack, $needle); - } else { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); - } - - return self::getSubpart($pos, $part, $haystack, $encoding); + return self::findPart(__FUNCTION__, $haystack, $needle, $part, $encoding, true, false); } public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = self::mb_strripos($haystack, $needle, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); + return self::findPart(__FUNCTION__, $haystack, $needle, $part, $encoding, true, true); } public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); - $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); - - $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); - $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); - - return self::mb_strrpos($haystack, $needle, $offset, $encoding); + return self::find(__FUNCTION__, $haystack, $needle, $offset, $encoding, true, true); } public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) { - $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; - } - if ($part) { - return substr($haystack, 0, $pos); - } - - return substr($haystack, $pos); + return self::findPart(__FUNCTION__, $haystack, $needle, $part, $encoding, false, false); } public static function mb_get_info($type = 'all') @@ -809,19 +827,37 @@ public static function mb_http_output($encoding = null) public static function mb_strwidth($s, $encoding = null) { $encoding = self::getEncoding($encoding); + $wideChars = '/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u'; if ('UTF-8' !== $encoding) { $s = self::iconv($encoding, 'UTF-8', $s); + } elseif (!preg_match('//u', $s)) { + // Each maximal subpart of an ill-formed sequence is one column wide + return preg_match_all(self::UTF8_CHAR_REGEX, $s) + preg_match_all($wideChars, self::scrubUtf8($s)); } - $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); + $s = preg_replace($wideChars, '', $s, -1, $wide); return ($wide << 1) + iconv_strlen($s, 'UTF-8'); } public static function mb_substr_count($haystack, $needle, $encoding = null) { - return substr_count($haystack, $needle); + if ('' === $needle = (string) $needle) { + if (80000 > \PHP_VERSION_ID) { + trigger_error('mb_substr_count(): Empty substring', \E_USER_WARNING); + + return false; + } + + throw new \ValueError('mb_substr_count(): Argument #2 ($needle) must not be empty'); + } + + if (!$search = self::prepareSearch((string) $haystack, $needle, self::getEncoding($encoding), false, true)) { + return 0; + } + + return substr_count($search[0], $search[1]); } public static function mb_output_handler($contents, $status) @@ -831,6 +867,10 @@ public static function mb_output_handler($contents, $status) public static function mb_chr($code, $encoding = null) { + if (null !== $encoding && !self::assertCodepointEncoding($encoding, 'mb_chr')) { + return false; + } + if (0x80 > $code %= 0x200000) { $s = \chr($code); } elseif (0x800 > $code) { @@ -850,26 +890,64 @@ public static function mb_chr($code, $encoding = null) public static function mb_ord($s, $encoding = null) { + if ('' === (string) $s) { + if (80000 > \PHP_VERSION_ID) { + trigger_error('mb_ord(): Empty string', \E_USER_WARNING); + + return false; + } + + throw new \ValueError('mb_ord(): Argument #1 ($string) must not be empty'); + } + + if (null !== $encoding && !self::assertCodepointEncoding($encoding, 'mb_ord')) { + return false; + } + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { $s = mb_convert_encoding($s, 'UTF-8', $encoding); } - if (1 === \strlen($s)) { - return \ord($s); + $s = unpack('C*', substr($s, 0, 4)); + $code = $s[1] ?? 0; + if (0x80 > $code) { + return $code; } - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; + if (0xC2 > $code || 0xF4 < $code) { + return false; } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; + + $c2 = $s[2] ?? 0; + if (0x80 !== ($c2 & 0xC0)) { + return false; } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; + + if (0xE0 > $code) { + return (($code & 0x1F) << 6) | ($c2 & 0x3F); } - return $code; + $c3 = $s[3] ?? 0; + if (0x80 !== ($c3 & 0xC0) + || 0xE0 === $code && 0xA0 > $c2 + || 0xED === $code && 0xA0 <= $c2 + ) { + return false; + } + + if (0xF0 > $code) { + return (($code & 0x0F) << 12) | (($c2 & 0x3F) << 6) | ($c3 & 0x3F); + } + + $c4 = $s[4] ?? 0; + if (0x80 !== ($c4 & 0xC0) + || 0xF0 === $code && 0x90 > $c2 + || 0xF4 === $code && 0x90 <= $c2 + ) { + return false; + } + + return (($code & 0x07) << 18) | (($c2 & 0x3F) << 12) | (($c3 & 0x3F) << 6) | ($c4 & 0x3F); } /** @return string|false */ @@ -893,7 +971,7 @@ public static function mb_str_pad(string $string, int $length, string $pad_strin return false; } - if (self::mb_strlen($pad_string, $encoding) <= 0) { + if (0 >= $padStringLength = self::mb_strlen($pad_string, $encoding)) { if (\PHP_VERSION_ID < 80000) { trigger_error('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string', \E_USER_WARNING); @@ -921,15 +999,20 @@ public static function mb_str_pad(string $string, int $length, string $pad_strin switch ($pad_type) { case \STR_PAD_LEFT: - return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + $leftPaddingLength = $paddingRequired; + break; case \STR_PAD_RIGHT: - return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + $leftPaddingLength = 0; + break; default: - $leftPaddingLength = floor($paddingRequired / 2); - $rightPaddingLength = $paddingRequired - $leftPaddingLength; - - return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + $leftPaddingLength = intdiv($paddingRequired, 2); } + + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return str_repeat($pad_string, intdiv($leftPaddingLength, $padStringLength)).self::mb_substr($pad_string, 0, $leftPaddingLength % $padStringLength, $encoding) + .$string + .str_repeat($pad_string, intdiv($rightPaddingLength, $padStringLength)).self::mb_substr($pad_string, 0, $rightPaddingLength % $padStringLength, $encoding); } /** @return string|false */ @@ -980,16 +1063,288 @@ public static function mb_rtrim(string $string, ?string $characters = null, ?str return self::mb_internal_trim('{[%s]+$}Du', $string, $characters, $encoding, __FUNCTION__); } - private static function getSubpart($pos, $part, $haystack, $encoding) + /** + * Finds the position of $needle in $haystack like native mbstring. + * + * @return int|false + */ + private static function find(string $function, $haystack, $needle, $offset, $encoding, bool $reverse, bool $fold) + { + $needle = (string) $needle; + + if (80000 > \PHP_VERSION_ID && '' === $needle && 'mb_stripos' === $function) { + trigger_error($function.'(): Empty delimiter', \E_USER_WARNING); + + return false; + } + + if (!$search = self::prepareSearch((string) $haystack, $needle, self::searchEncoding($encoding, $fold), $fold, $fold)) { + return false; + } + + [$haystack, $needle, $bytes, $dropped] = $search; + + if (80000 > \PHP_VERSION_ID && $fold && ('' === $haystack || '' === $needle)) { + return false; + } + + if (false === $start = self::utf8Offset($haystack, $offset = (int) $offset, $bytes)) { + // Native mbstring counts the ill-formed sequences that iconv() dropped: the offset could be in range + if ($dropped && abs($offset) <= self::utf8Length($haystack) + $dropped) { + return false; + } + + if (80000 > \PHP_VERSION_ID) { + trigger_error($function.'(): '.($reverse ? 'Offset is greater than the length of haystack string' : 'Offset not contained in string'), \E_USER_WARNING); + + return false; + } + + throw new \ValueError($function.'(): Argument #3 ($offset) must be contained in argument #1 ($haystack)'); + } + + if (80000 > \PHP_VERSION_ID && '' === $needle) { + if ('mb_strpos' === $function) { + trigger_error($function.'(): Empty delimiter', \E_USER_WARNING); + } + + return false; + } + + if (!$reverse) { + $pos = strpos($haystack, $needle, $start); + } else { + $pos = strrpos($haystack, $needle, 0 > $offset ? $start - \strlen($haystack) : $start); + } + + return false === $pos || $bytes ? $pos : self::utf8Length(substr($haystack, 0, $pos)); + } + + /** + * Returns the part of $haystack before or from $needle like native mbstring. + * + * @return string|false + */ + private static function findPart(string $function, $haystack, $needle, $part, $encoding, bool $reverse, bool $fold) + { + $needle = (string) $needle; + + if (80000 > \PHP_VERSION_ID && '' === $needle) { + if (!$reverse) { + trigger_error($function.'(): Empty delimiter', \E_USER_WARNING); + } + + return false; + } + + $haystack = (string) $haystack; + + if (!$search = self::prepareSearch($haystack, $needle, $encoding = self::searchEncoding($encoding, $fold), $fold, $fold)) { + return false; + } + + [$h, $n, $bytes] = $search; + + if (false === $pos = $reverse ? strrpos($h, $n) : strpos($h, $n)) { + return false; + } + + if ($bytes) { + return (string) ($part ? substr($haystack, 0, $pos) : substr($haystack, $pos)); + } + + if ($fold || ('UTF-8' === $encoding && (!preg_match('//u', $haystack) || !preg_match('//u', $needle)))) { + // Cut after as many characters as native mbstring counts before the match + $pos = self::utf8Length(substr($h, 0, $pos)); + $h = 'UTF-8' === $encoding ? self::markIllFormedUtf8($haystack) : self::utf8($haystack, $encoding); + $pos = self::utf8Offset($h, $pos, false); + } + + $h = (string) ($part ? substr($h, 0, $pos) : substr($h, $pos)); + + if (false !== strpos($h, "\xFF")) { + $h = str_replace("\xFF", 'none' === mb_substitute_character() ? '' : '?', $h); + } + + return 'UTF-8' === $encoding ? $h : (string) @self::iconv('UTF-8', $encoding, $h); + } + + /** + * @return array{string, string, bool, int}|null The haystack and the needle to search, whether offsets in them count bytes rather than UTF-8 characters, and how many bytes of ill-formed sequences iconv() dropped from the haystack + */ + private static function prepareSearch(string $haystack, string $needle, string $encoding, bool $fold, bool $markIllFormed) + { + if ('ASCII' === $encoding || ('CP850' === $encoding && !$fold)) { + if ('ASCII' === $encoding) { + // Native mbstring turns every byte above 0x7F into the same error marker + $haystack = preg_replace('/[\x80-\xFF]/', "\xFF", $haystack); + $needle = preg_replace('/[\x80-\xFF]/', "\xFF", $needle); + } + + if ($fold) { + $haystack = strtr($haystack, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + $needle = strtr($needle, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + return [$haystack, $needle, true, 0]; + } + + $dropped = 0; + + if ('UTF-8' !== $encoding) { + if (false === ($haystack = self::utf8($haystack, $encoding, $dropped)) || false === $needle = self::utf8($needle, $encoding)) { + return null; + } + } elseif ($markIllFormed) { + $haystack = self::markIllFormedUtf8($haystack); + $needle = self::markIllFormedUtf8($needle); + } + + return $fold ? [self::foldCase($haystack), self::foldCase($needle), false, $dropped] : [$haystack, $needle, false, $dropped]; + } + + private static function searchEncoding($encoding, bool $fold): string + { + $normalizedEncoding = self::getEncoding($encoding); + + // Native mbstring folds the case of 8bit strings as Latin-1 + return $fold && 'CP850' === $normalizedEncoding && null !== $encoding && 'CP850' !== strtoupper($encoding) ? 'ISO-8859-1' : $normalizedEncoding; + } + + /** + * Converts $s to UTF-8 to search it, ending with "\xFF", a byte that is invalid in UTF-8, when its last sequence is truncated, like native mbstring. + * + * @param int $dropped Set to the number of bytes of the ill-formed sequences that iconv() dropped elsewhere + * + * @return string|false False when the encoding is unknown + */ + private static function utf8(string $s, string $encoding, &$dropped = 0) { - if (false === $pos) { + if ('UTF-8' === $encoding || '' === $s) { + return $s; + } + + if (false !== $u = @iconv($encoding, 'UTF-8', $s)) { + return $u; + } + + // Let iconv() warn about an unknown encoding + if (false === iconv($encoding, 'UTF-8', '')) { return false; } - if ($part) { - return self::mb_substr($haystack, 0, $pos, $encoding); + + // iconv() drops the ill-formed sequences, but fails on a truncated one at the end + for ($i = 0; $i < 4; ++$i) { + if (false !== $u = @self::iconv($encoding, 'UTF-8', $i ? substr($s, 0, -$i) : $s)) { + $dropped = \strlen($s) - $i - \strlen((string) @iconv('UTF-8', $encoding, $u)); + + return $i || '' === $u ? $u."\xFF" : $u; + } + } + + $dropped = \strlen($s); + + return "\xFF"; + } + + /** + * Replaces each maximal subpart of ill-formed UTF-8 sequences with "\xFF", like native mbstring before searching case-insensitively. + */ + private static function markIllFormedUtf8(string $s): string + { + if (preg_match('//u', $s)) { + return $s; + } + + return preg_replace('/\G(?:[\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*+\K(?:\xE0[\xA0-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]|\xED[\x80-\x9F]|\xF0[\x90-\xBF][\x80-\xBF]?|[\xF1-\xF3][\x80-\xBF]{1,2}|\xF4[\x80-\x8F][\x80-\xBF]?|[\x80-\xFF])/', "\xFF", $s); + } + + /** + * Folds the case of UTF-8 $s like the simple case folding of native mbstring. + */ + private static function foldCase(string $s): string + { + static $map = null; + + if (null === $map) { + $map = array_combine(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1]) + self::getData('lowerCase'); + unset($map["\xC4\xB0"]); // U+0130 has no simple case folding + } + + return strtr($s, $map); + } + + /** + * Counts the characters of UTF-8 $s like native mbstring, even when ill-formed: one per byte that is not a continuation byte. + */ + private static function utf8Length(string $s): int + { + return \strlen($s) - array_sum(\array_slice(count_chars($s), 0x80, 0x40)); + } + + /** + * @return int|false The offset in bytes of the character at $offset, false when it is out of range, like native mbstring + */ + private static function utf8Offset(string $s, int $offset, bool $bytes) + { + if (0 === $offset) { + return 0; + } + + if ($bytes || preg_match('//u', $u = str_replace("\xFF", '?', $s))) { + $length = $bytes ? \strlen($s) : self::utf8Length($s); + + if (0 > $offset) { + $offset += $length; + } + + if (0 > $offset || $offset > $length) { + return false; + } + + if ($bytes) { + return $offset; + } + + for ($rx = ''; 65535 < $offset; $offset -= 65535) { + $rx .= '.{65535}'; + } + preg_match('/^'.$rx.'.{'.$offset.'}\K/su', $u, $m, \PREG_OFFSET_CAPTURE); + + return $m[0][1]; } - return self::mb_substr($haystack, $pos, null, $encoding); + // Walk ill-formed UTF-8 like native mbstring: backward over the bytes that are not continuation bytes, forward by the lengths that lead bytes announce + $length = \strlen($s); + + if (0 > $offset) { + $i = $length; + + while (0 > $offset) { + if (0 === $i) { + return false; + } + + if (0x80 !== (\ord($s[--$i]) & 0xC0)) { + ++$offset; + } + } + + return $i; + } + + $i = 0; + + while (0 < $offset--) { + if ($i >= $length) { + return false; + } + + $c = \ord($s[$i]); + $i += $c < 0xC2 ? 1 : ($c < 0xE0 ? 2 : ($c < 0xF0 ? 3 : ($c < 0xF5 ? 4 : 1))); + } + + return min($i, $length); } private static function html_encoding_callback(array $m) @@ -1083,16 +1438,13 @@ private static function mb_internal_trim(string $regex, string $string, ?string } if ('' === $characters) { - return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding); + return $string; } - if ('UTF-8' === $encoding) { + if ('UTF-8' === self::getEncoding($encoding)) { $encoding = null; - if (!preg_match('//u', $string)) { - $string = @self::iconv('UTF-8', 'UTF-8', $string); - } - if (null !== $characters && !preg_match('//u', $characters)) { - $characters = @self::iconv('UTF-8', 'UTF-8', $characters); + if (!preg_match('//u', $string) || (null !== $characters && !preg_match('//u', $characters))) { + return self::mb_trim_invalid_utf8($string, $characters, $function); } } else { $string = self::iconv($encoding, 'UTF-8', $string); @@ -1117,6 +1469,139 @@ private static function mb_internal_trim(string $regex, string $string, ?string return self::iconv('UTF-8', $encoding, $string); } + /** + * Trims ill-formed UTF-8 like mbstring: each maximal subpart of an ill-formed + * sequence counts as one character, and the string is returned as is when + * nothing is trimmed, else re-encoded with the substitute character. + */ + private static function mb_trim_invalid_utf8(string $string, ?string $characters, string $function): string + { + $regex = self::UTF8_CHAR_REGEX; + + // Ill-formed sequences leave group 1 empty: they are trimmed when $characters has one too + preg_match_all($regex, $characters ?? "\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}", $m); + $trimmed = array_flip($m[1]); + + $start = 0; + $end = \strlen($string); + + while ('mb_rtrim' !== $function && $start < $end && preg_match($regex, $string, $m, 0, $start) && isset($trimmed[$m[1] ?? ''])) { + $start += \strlen($m[0]); + } + + while ('mb_ltrim' !== $function && $start < $end) { + // Characters are at most 4 bytes long, and only continuation bytes don't start one + for ($i = $end - 1; $i > $start && $i > $end - 4 && 0x80 === (\ord($string[$i]) & 0xC0); --$i) { + } + + preg_match_all($regex, substr($string, $i, $end - $i), $m); + + if (!isset($trimmed[end($m[1])])) { + break; + } + + $end -= \strlen(end($m[0])); + } + + if (0 === $start && \strlen($string) === $end) { + return $string; + } + + $string = substr($string, $start, $end - $start); + + return 'none' === mb_substitute_character() ? self::scrubUtf8($string) : mb_convert_encoding($string, 'UTF-8', 'UTF-8'); + } + + private static function scrubUtf8(string $s): string + { + return preg_replace(self::UTF8_CHAR_REGEX, '$1', $s); + } + + /** + * @param true[] $referenceIds The ids of the references followed to reach $array + */ + private static function convertArray(array $array, $toEncoding, $fromEncoding, array $referenceIds = []): array + { + $r = []; + + foreach ($array as $key => $v) { + if (null !== $v && !\is_scalar($v) && !\is_array($v)) { + trigger_error('mb_convert_encoding(): Object is not supported', \E_USER_WARNING); + continue; + } + + $k = \is_string($key) ? self::mb_convert_encoding($key, $toEncoding, $fromEncoding) : $key; + + if (\is_string($v)) { + $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding); + } elseif (\is_array($v)) { + // Only a reference can close a cycle: following the same one twice means one was found + $id = 70400 <= \PHP_VERSION_ID && ($reference = \ReflectionReference::fromArrayElement($array, $key)) ? $reference->getId() : null; + + if (null !== $id && isset($referenceIds[$id])) { + trigger_error('mb_convert_encoding(): Cannot convert recursively referenced values', \E_USER_WARNING); + $v = []; + } else { + $v = self::convertArray($v, $toEncoding, $fromEncoding, null === $id ? $referenceIds : $referenceIds + [$id => true]); + } + } + + // Keys that collide once converted keep their first value + $r += [$k => $v]; + } + + return $r; + } + + /** + * Returns the error native mbstring throws for these encoding arguments, if any. + */ + private static function getConversionError(string $function, int $argument, $toEncoding, $fromEncoding): ?string + { + if (!self::isConvertibleEncoding((string) $toEncoding)) { + return \sprintf('%s(): Argument #%d ($to_encoding) must be a valid encoding, "%s" given', $function, $argument, $toEncoding); + } + + if (null === $fromEncoding) { + return null; + } + + if (!$list = \is_array($fromEncoding) ? $fromEncoding : ('' === $fromEncoding ? [] : explode(',', $fromEncoding))) { + return \sprintf('%s(): Argument #%d ($from_encoding) must specify at least one encoding', $function, 1 + $argument); + } + + foreach ($list as $encoding) { + $encoding = \is_array($fromEncoding) ? (string) $encoding : trim($encoding, " \t"); + + // PHP 8.4 takes an empty entry of a comma-separated list for "auto" + if ('' === $encoding && !\is_array($fromEncoding) && 80400 <= \PHP_VERSION_ID) { + continue; + } + + if (0 !== strcasecmp($encoding, 'auto') && !self::isConvertibleEncoding($encoding)) { + return \sprintf('%s(): Argument #%d ($from_encoding) contains invalid encoding "%s"', $function, 1 + $argument, $encoding); + } + } + + return null; + } + + private static function isConvertibleEncoding(string $encoding): bool + { + if (isset(self::$convertibleEncodings[$encoding])) { + return true; + } + + $normalizedEncoding = self::getEncoding($encoding); + + // Native encoding names use no other characters, while iconv() also accepts suffixes like //TRANSLIT + if ('' === $normalizedEncoding || preg_match('/[^\w#\-.:]/', $encoding) || (null === (self::UNSUPPORTED_CODEPOINT_ENCODINGS[$normalizedEncoding] ?? null) && false === @iconv($normalizedEncoding, $normalizedEncoding, ''))) { + return false; + } + + return self::$convertibleEncodings[$encoding] = true; + } + private static function assertEncoding(string $encoding, string $errorFormat): bool { try { @@ -1135,4 +1620,31 @@ private static function assertEncoding(string $encoding, string $errorFormat): b return $validEncoding; } + + private static function assertCodepointEncoding(string $encoding, string $function): bool + { + if (null !== $name = self::UNSUPPORTED_CODEPOINT_ENCODINGS[strtoupper($encoding)] ?? null) { + if (80000 > \PHP_VERSION_ID) { + trigger_error(\sprintf('%s(): Unsupported encoding "%s"', $function, $name), \E_USER_WARNING); + + return false; + } + + throw new \ValueError(\sprintf('%s() does not support the "%s" encoding', $function, $name)); + } + + $normalizedEncoding = self::getEncoding($encoding); + + if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, '')) { + return true; + } + + if (80000 > \PHP_VERSION_ID) { + trigger_error(\sprintf('%s(): Unknown encoding "%s"', $function, $encoding), \E_USER_WARNING); + + return false; + } + + throw new \ValueError(\sprintf('%s(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $function, $encoding)); + } } diff --git a/core/vendor/symfony/polyfill-php84/Php84.php b/core/vendor/symfony/polyfill-php84/Php84.php index 5f11771449..818c3d8b89 100644 --- a/core/vendor/symfony/polyfill-php84/Php84.php +++ b/core/vendor/symfony/polyfill-php84/Php84.php @@ -19,6 +19,8 @@ */ final class Php84 { + private const BCMATH_WELL_FORMED = '/^[+-]?[0-9]*+(?:\.[0-9]*+)?$/D'; + /** @return string|false */ public static function mb_ucfirst(string $string, ?string $encoding = null) { @@ -123,6 +125,11 @@ public static function array_all(array $array, callable $callback): bool public static function fpow(float $num, float $exponent): float { + if (0.0 === $num && $exponent < 0.0) { + // IEEE 754 pow(±0, y < 0), which the ** operator deprecates since PHP 8.4 + return -1.0 === fmod($exponent, 2.0) && '-' === ((string) $num)[0] ? -\INF : \INF; + } + return $num ** $exponent; } @@ -168,13 +175,17 @@ private static function mb_internal_trim(string $regex, string $string, ?string } if ('' === $characters) { - return null === $encoding ? $string : mb_convert_encoding($string, $encoding); + return $string; } if ('UTF-8' === $encoding || \in_array(strtolower($encoding), ['utf-8', 'utf8'], true)) { $encoding = 'UTF-8'; } + if ('UTF-8' === $encoding && (!preg_match('//u', $string) || (null !== $characters && !preg_match('//u', $characters)))) { + return self::mb_trim_invalid_utf8($string, $characters, $function); + } + $string = mb_convert_encoding($string, 'UTF-8', $encoding); if (null !== $characters) { @@ -196,10 +207,54 @@ private static function mb_internal_trim(string $regex, string $string, ?string return mb_convert_encoding($string, $encoding, 'UTF-8'); } + /** + * Trims ill-formed UTF-8 like mbstring: each maximal subpart of an ill-formed + * sequence counts as one character, and the string is returned as is when + * nothing is trimmed, else re-encoded with the substitute character. + */ + private static function mb_trim_invalid_utf8(string $string, ?string $characters, string $function): string + { + // Well-formed characters in group 1, then the maximal subparts of ill-formed sequences + $regex = '/([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})|\xE0[\xA0-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]|\xED[\x80-\x9F]|\xF0[\x90-\xBF][\x80-\xBF]?|[\xF1-\xF3][\x80-\xBF]{1,2}|\xF4[\x80-\x8F][\x80-\xBF]?|[\x80-\xFF]/'; + + // Ill-formed sequences leave group 1 empty: they are trimmed when $characters has one too + preg_match_all($regex, $characters ?? "\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}", $m); + $trimmed = array_flip($m[1]); + + $start = 0; + $end = \strlen($string); + + while ('mb_rtrim' !== $function && $start < $end && preg_match($regex, $string, $m, 0, $start) && isset($trimmed[$m[1] ?? ''])) { + $start += \strlen($m[0]); + } + + while ('mb_ltrim' !== $function && $start < $end) { + // Characters are at most 4 bytes long, and only continuation bytes don't start one + for ($i = $end - 1; $i > $start && $i > $end - 4 && 0x80 === (\ord($string[$i]) & 0xC0); --$i) { + } + + preg_match_all($regex, substr($string, $i, $end - $i), $m); + + if (!isset($trimmed[end($m[1])])) { + break; + } + + $end -= \strlen(end($m[0])); + } + + if (0 === $start && \strlen($string) === $end) { + return $string; + } + + $string = substr($string, $start, $end - $start); + + return 'none' === mb_substitute_character() ? preg_replace($regex, '$1', $string) : mb_convert_encoding($string, 'UTF-8', 'UTF-8'); + } + public static function grapheme_str_split(string $string, int $length) { - if (0 > $length || 1073741823 < $length) { - throw new \ValueError('grapheme_str_split(): Argument #2 ($length) must be greater than 0 and less than or equal to 1073741823.'); + if (0 >= $length || 1073741823 < $length) { + throw new \ValueError('grapheme_str_split(): Argument #2 ($length) must be greater than 0 and less than or equal to 1073741823'); } if ('' === $string) { @@ -210,15 +265,21 @@ public static function grapheme_str_split(string $string, int $length) ? '\X' : '(?:\r\n|[\x{1F1E6}-\x{1F1FF}][\x{1F1E6}-\x{1F1FF}]?|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Mc}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{1D165}\x{1D16E}-\x{1D172}\x{1F3FB}-\x{1F3FF}\x{FE0E}-\x{FE0F}\x{E0020}-\x{E007F}]*(?:\x{200D}(?:[\x{1F1E6}-\x{1F1FF}]|[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가-힣]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Mc}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{1D165}\x{1D16E}-\x{1D172}\x{1F3FB}-\x{1F3FF}\x{FE0E}-\x{FE0F}\x{E0020}-\x{E007F}]*)*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; - if (!preg_match_all('/'.$regex.'/u', $string, $matches)) { + if (preg_match_all('/'.$regex.'/u', $string, $matches)) { + $graphemes = $matches[0]; + } else { + $graphemes = self::splitIllFormed($string, $regex); + } + + if (!$graphemes) { return false; } if (1 === $length) { - return $matches[0]; + return $graphemes; } - $chunks = array_chunk($matches[0], $length); + $chunks = array_chunk($graphemes, $length); foreach ($chunks as &$chunk) { $chunk = implode('', $chunk); } @@ -228,7 +289,7 @@ public static function grapheme_str_split(string $string, int $length) public static function bcceil(string $num): string { - if (!is_numeric($num)) { + if (!preg_match(self::BCMATH_WELL_FORMED, $num)) { throw new \ValueError('bcceil(): Argument #1 ($num) is not well-formed'); } @@ -247,7 +308,7 @@ public static function bcdivmod(string $num1, string $num2, ?int $scale = null): public static function bcfloor(string $num): string { - if (!is_numeric($num)) { + if (!preg_match(self::BCMATH_WELL_FORMED, $num)) { throw new \ValueError('bcfloor(): Argument #1 ($num) is not well-formed'); } @@ -259,7 +320,7 @@ public static function bcfloor(string $num): string */ public static function bcround(string $num, int $precision = 0, $mode = \RoundingMode::HalfAwayFromZero): string { - if (!is_numeric($num)) { + if (!preg_match(self::BCMATH_WELL_FORMED, $num)) { throw new \ValueError('bcround(): Argument #1 ($num) is not well-formed'); } @@ -441,4 +502,48 @@ private static function lastDigit(string $digits): int return $length ? \ord($digits[$length - 1]) - 48 : 0; } + + /** + * Splits a string that is not valid UTF-8 into grapheme clusters. + * + * The intl extension keeps the ill-formed bytes and breaks around them the + * way it would around the U+FFFD each maximal subpart stands for. Standing + * one in for real makes the cluster regexp applicable, then each cluster is + * mapped back to the bytes it was made of. + */ + private static function splitIllFormed(string $string, string $regex): array + { + // Table 3-7 of the Unicode standard for the well-formed byte sequences (group 1), + // then the maximal subparts an ill-formed sequence is made of (group 2). + preg_match_all('/([\x00-\x7F]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|[\xEE-\xEF][\x80-\xBF]{2}|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})|(\xF0[\x90-\xBF][\x80-\xBF]?|[\xF1-\xF3][\x80-\xBF]{1,2}|\xF4[\x80-\x8F][\x80-\xBF]?|\xE0[\xA0-\xBF]|[\xE1-\xEC][\x80-\xBF]|\xED[\x80-\x9F]|[\xEE-\xEF][\x80-\xBF]|[\x80-\xFF])/s', $string, $matches, \PREG_SET_ORDER); + + $segments = []; + $segmentAt = []; + $sanitized = ''; + + foreach ($matches as $m) { + $segmentAt[\strlen($sanitized)] = \count($segments); + + if (isset($m[2]) && '' !== $m[2]) { + $segments[] = $m[2]; + $sanitized .= "\xEF\xBF\xBD"; + } else { + $segments[] = $m[1]; + $sanitized .= $m[1]; + } + } + + $segmentAt[\strlen($sanitized)] = \count($segments); + + preg_match_all('/'.$regex.'/u', $sanitized, $clusters, \PREG_OFFSET_CAPTURE); + + $graphemes = []; + + foreach ($clusters[0] as $cluster) { + $start = $segmentAt[$cluster[1]]; + $graphemes[] = implode('', \array_slice($segments, $start, $segmentAt[$cluster[1] + \strlen($cluster[0])] - $start)); + } + + return $graphemes; + } } diff --git a/core/vendor/symfony/polyfill-php84/bootstrap.php b/core/vendor/symfony/polyfill-php84/bootstrap.php index ecdc025173..1854b8f824 100644 --- a/core/vendor/symfony/polyfill-php84/bootstrap.php +++ b/core/vendor/symfony/polyfill-php84/bootstrap.php @@ -86,7 +86,7 @@ function bcdivmod(string $num1, string $num2, ?int $scale = null): ?array { retu function bcfloor(string $num): string { return p\Php84::bcfloor($num); } } if (!function_exists('bcround')) { - function bcround(string $num, int $precision = 0, $mode = RoundingMode::HalfAwayFromZero): string { return p\Php84::bcround($num, $precision, $mode); } + function bcround(string $num, int $precision = 0, $mode = \RoundingMode::HalfAwayFromZero): string { return p\Php84::bcround($num, $precision, $mode); } } } diff --git a/core/vendor/symfony/polyfill-php85/Php85.php b/core/vendor/symfony/polyfill-php85/Php85.php index 21c0f6f347..d1f038a10d 100644 --- a/core/vendor/symfony/polyfill-php85/Php85.php +++ b/core/vendor/symfony/polyfill-php85/Php85.php @@ -49,23 +49,48 @@ public static function array_last(array $array) return $array ? current(\array_slice($array, -1)) : null; } + // Taken from CLDR 44 (ICU 74); the exact set is ICU-version dependent and won't match every version of the native locale_is_right_to_left(). private const RTL_SCRIPTS = [ - 'Adlm' => true, 'Arab' => true, 'Armi' => true, 'Hebr' => true, - 'Mand' => true, 'Mani' => true, 'Mend' => true, 'Nkoo' => true, - 'Orkh' => true, 'Phnx' => true, 'Rohg' => true, 'Samr' => true, + 'Adlm' => true, 'Arab' => true, 'Armi' => true, 'Avst' => true, + 'Chrs' => true, 'Cprt' => true, 'Elym' => true, 'Hatr' => true, + 'Hebr' => true, 'Hung' => true, 'Khar' => true, 'Lydi' => true, + 'Mand' => true, 'Mani' => true, 'Mend' => true, 'Merc' => true, + 'Mero' => true, 'Narb' => true, 'Nbat' => true, 'Nkoo' => true, + 'Orkh' => true, 'Ougr' => true, 'Palm' => true, 'Phli' => true, + 'Phlp' => true, 'Phnx' => true, 'Prti' => true, 'Rohg' => true, + 'Samr' => true, 'Sarb' => true, 'Sogd' => true, 'Sogo' => true, 'Syrc' => true, 'Thaa' => true, 'Yezi' => true, ]; private const LANG_TO_SCRIPT = [ + 'aeb' => 'Arab', 'ar' => 'Arab', + 'arc' => 'Armi', + 'arq' => 'Arab', + 'ary' => 'Arab', + 'arz' => 'Arab', + 'bal' => 'Arab', + 'bgn' => 'Arab', 'ckb' => 'Arab', 'dv' => 'Thaa', 'fa' => 'Arab', + 'glk' => 'Arab', + 'haz' => 'Arab', 'he' => 'Hebr', - 'ku' => 'Arab', + 'iw' => 'Hebr', + 'kas' => 'Arab', + 'ks' => 'Arab', + 'lrc' => 'Arab', + 'mzn' => 'Arab', 'nqo' => 'Nkoo', + 'pnb' => 'Arab', 'ps' => 'Arab', + 'rhg' => 'Rohg', + 'sam' => 'Samr', 'sd' => 'Arab', + 'sdh' => 'Arab', + 'skr' => 'Arab', + 'syr' => 'Syrc', 'ug' => 'Arab', 'ur' => 'Arab', 'yi' => 'Hebr', @@ -74,29 +99,33 @@ public static function array_last(array $array) public static function locale_is_right_to_left(string $locale): bool { if ('' === $locale) { - return false; + $locale = \Locale::getDefault(); } - $parts = preg_split('/[_-]/', $locale); + $parts = preg_split('/[_-]/', substr($locale, 0, strcspn($locale, '@.'))); $language = strtolower($parts[0]); - foreach ($parts as $part) { - if (4 === \strlen($part) && ctype_alpha($part)) { - return isset(self::RTL_SCRIPTS[ucfirst(strtolower($part))]); - } + if (isset($parts[1]) && 4 === \strlen($parts[1]) && ctype_alpha($parts[1])) { + return isset(self::RTL_SCRIPTS[ucfirst(strtolower($parts[1]))]); } return isset(self::LANG_TO_SCRIPT[$language]) && isset(self::RTL_SCRIPTS[self::LANG_TO_SCRIPT[$language]]); } - public static function grapheme_levenshtein(string $s1, string $s2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1) + public static function grapheme_levenshtein(string $s1, string $s2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = '') { - if (!preg_match('//u', $s1) || !preg_match('//u', $s2)) { - return false; + if ($insertion_cost <= 0 || $insertion_cost > 1073741823) { + throw new \ValueError('grapheme_levenshtein(): Argument #3 ($insertion_cost) must be greater than 0 and less than or equal to 1073741823'); + } + if ($replacement_cost <= 0 || $replacement_cost > 1073741823) { + throw new \ValueError('grapheme_levenshtein(): Argument #4 ($replacement_cost) must be greater than 0 and less than or equal to 1073741823'); + } + if ($deletion_cost <= 0 || $deletion_cost > 1073741823) { + throw new \ValueError('grapheme_levenshtein(): Argument #5 ($deletion_cost) must be greater than 0 and less than or equal to 1073741823'); } - if (0 > $insertion_cost || 0 > $replacement_cost || 0 > $deletion_cost) { - throw new \ValueError('grapheme_levenshtein(): Argument #3 ($insertion_cost), #4 ($replacement_cost), and #5 ($deletion_cost) must be greater than or equal to 0'); + if (!preg_match('//u', $s1) || !preg_match('//u', $s2)) { + return false; } $regex = ((float) \PCRE_VERSION >= 10.44) @@ -111,29 +140,43 @@ public static function grapheme_levenshtein(string $s1, string $s2, int $inserti $l1 = \count($s1); $l2 = \count($s2); - if (0 === $l1) { - return $l2 * $insertion_cost; + // Keep the rows as short as possible. Reversing the transformation + // swaps the meaning of insertion and deletion. + if ($l1 < $l2) { + [$s1, $s2] = [$s2, $s1]; + [$l1, $l2] = [$l2, $l1]; + [$insertion_cost, $deletion_cost] = [$deletion_cost, $insertion_cost]; } + if (0 === $l2) { return $l1 * $deletion_cost; } - $dp = array_fill(0, $l1 + 1, array_fill(0, $l2 + 1, 0)); - - for ($i = 1; $i <= $l1; ++$i) { - $dp[$i][0] = $dp[$i - 1][0] + $deletion_cost; + // Graphemes are equal when the collator says so, as with ucol_strcoll() in intl + try { + $collator = new \Collator('' === $locale ? 'root' : $locale); + } catch (\IntlException $e) { + return false; } + $s1 = array_map([$collator, 'getSortKey'], $s1); + $s2 = array_map([$collator, 'getSortKey'], $s2); + + $previousRow = $currentRow = array_fill(0, $l2 + 1, 0); for ($j = 1; $j <= $l2; ++$j) { - $dp[0][$j] = $dp[0][$j - 1] + $insertion_cost; + $previousRow[$j] = $previousRow[$j - 1] + $insertion_cost; } for ($i = 1; $i <= $l1; ++$i) { + $currentRow[0] = $previousRow[0] + $deletion_cost; + for ($j = 1; $j <= $l2; ++$j) { $cost = ($s1[$i - 1] === $s2[$j - 1]) ? 0 : $replacement_cost; - $dp[$i][$j] = min($dp[$i - 1][$j] + $deletion_cost, $dp[$i][$j - 1] + $insertion_cost, $dp[$i - 1][$j - 1] + $cost); + $currentRow[$j] = min($previousRow[$j] + $deletion_cost, $currentRow[$j - 1] + $insertion_cost, $previousRow[$j - 1] + $cost); } + + [$previousRow, $currentRow] = [$currentRow, $previousRow]; } - return $dp[$l1][$l2]; + return $previousRow[$l2]; } } diff --git a/core/vendor/symfony/polyfill-php85/bootstrap.php b/core/vendor/symfony/polyfill-php85/bootstrap.php index c68b01b30b..0aab93b809 100644 --- a/core/vendor/symfony/polyfill-php85/bootstrap.php +++ b/core/vendor/symfony/polyfill-php85/bootstrap.php @@ -48,5 +48,5 @@ class ValueError extends Error } if (extension_loaded('intl') && !function_exists('grapheme_levenshtein')) { - function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = '') { return p\Php85::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); } + function grapheme_levenshtein(string $string1, string $string2, ?int $insertion_cost = 1, ?int $replacement_cost = 1, ?int $deletion_cost = 1, string $locale = '') { return p\Php85::grapheme_levenshtein($string1, $string2, (int) $insertion_cost, (int) $replacement_cost, (int) $deletion_cost, $locale); } } diff --git a/core/vendor/symfony/polyfill-php85/bootstrap80.php b/core/vendor/symfony/polyfill-php85/bootstrap80.php index b07c0ec5f0..8a0e054e16 100644 --- a/core/vendor/symfony/polyfill-php85/bootstrap80.php +++ b/core/vendor/symfony/polyfill-php85/bootstrap80.php @@ -16,5 +16,5 @@ } if (extension_loaded('intl') && !function_exists('grapheme_levenshtein')) { - function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = ''): int|false { return p\Php85::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); } + function grapheme_levenshtein(string $string1, string $string2, ?int $insertion_cost = 1, ?int $replacement_cost = 1, ?int $deletion_cost = 1, string $locale = ''): int|false { return p\Php85::grapheme_levenshtein($string1, $string2, (int) $insertion_cost, (int) $replacement_cost, (int) $deletion_cost, $locale); } } diff --git a/core/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php b/core/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php index 153c875c47..47859f3a0b 100644 --- a/core/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php +++ b/core/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php @@ -114,11 +114,11 @@ private function generateDeclaredRoutes(): string { $routes = ''; foreach ($this->getCompiledRoutes() as $name => $properties) { - $routes .= \sprintf("\n '%s' => %s,", $name, CompiledUrlMatcherDumper::export($properties)); + $routes .= \sprintf("\n %s => %s,", CompiledUrlMatcherDumper::export($name), CompiledUrlMatcherDumper::export($properties)); } foreach ($this->getCompiledAliases() as $alias => $properties) { - $routes .= \sprintf("\n '%s' => %s,", $alias, CompiledUrlMatcherDumper::export($properties)); + $routes .= \sprintf("\n %s => %s,", CompiledUrlMatcherDumper::export($alias), CompiledUrlMatcherDumper::export($properties)); } return $routes;