diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index b0d3bb97..db03e3f1 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -455,36 +455,6 @@ parameters: count: 1 path: src/lib/FieldType/RichText/RichTextStorage.php - - - message: "#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: ''\\|'ezremote\\://', 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/FieldType/RichText/RichTextStorage.php - - - - message: "#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: string, 2\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/FieldType/RichText/RichTextStorage.php - - - - message: "#^Offset 2 does not exist on array\\{0\\?\\: string, 1\\: 'ezremote\\://', 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/FieldType/RichText/RichTextStorage.php - - - - message: "#^Offset 2 does not exist on array\\{0\\?\\: string, 1\\?\\: ''\\|'ezremote\\://', 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 2 - path: src/lib/FieldType/RichText/RichTextStorage.php - - - - message: "#^Offset 2 does not exist on array\\{0\\?\\: string, 1\\?\\: string, 2\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/FieldType/RichText/RichTextStorage.php - - - - message: "#^Offset 3 does not exist on array\\{0\\?\\: string, 1\\?\\: ''\\|'ezremote\\://', 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/FieldType/RichText/RichTextStorage.php - - message: "#^Parameter \\#1 \\$source of method DOMDocument\\:\\:loadXML\\(\\) expects string, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" count: 2 @@ -655,21 +625,6 @@ parameters: count: 4 path: src/lib/RichText/Converter/Link.php - - - message: "#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: string, 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/RichText/Converter/Link.php - - - - message: "#^Offset 2 does not exist on array\\{0\\?\\: string, 1\\?\\: string, 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/RichText/Converter/Link.php - - - - message: "#^Offset 3 does not exist on array\\{0\\?\\: string, 1\\?\\: string, 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/RichText/Converter/Link.php - - message: "#^Parameter \\#1 \\$locationId of method Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\LocationService\\:\\:loadLocation\\(\\) expects int, int\\|null given\\.$#" count: 1 @@ -815,21 +770,6 @@ parameters: count: 1 path: src/lib/RichText/Converter/Render/Embed.php - - - message: "#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: 'ezcontent'\\|'ezlocation', 2\\?\\: numeric\\-string\\}\\.$#" - count: 1 - path: src/lib/RichText/Converter/Render/Embed.php - - - - message: "#^Offset 2 does not exist on array\\{0\\?\\: string, 1\\: 'ezcontent', 2\\?\\: numeric\\-string\\}\\.$#" - count: 1 - path: src/lib/RichText/Converter/Render/Embed.php - - - - message: "#^Offset 2 does not exist on array\\{0\\?\\: string, 1\\: 'ezlocation', 2\\?\\: numeric\\-string\\}\\.$#" - count: 1 - path: src/lib/RichText/Converter/Render/Embed.php - - message: "#^PHPDoc tag @var has invalid value \\(\\$embed \\\\DOMElement\\)\\: Unexpected token \"\\$embed\", expected type at offset 9$#" count: 1 @@ -1010,16 +950,6 @@ parameters: count: 1 path: src/lib/RichText/RelationProcessor.php - - - message: "#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-empty\\-string, 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/RichText/RelationProcessor.php - - - - message: "#^Offset 2 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-empty\\-string, 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/RichText/RelationProcessor.php - - message: "#^Cannot call method error\\(\\) on Psr\\\\Log\\\\LoggerInterface\\|null\\.$#" count: 13 @@ -1150,16 +1080,6 @@ parameters: count: 1 path: src/lib/RichText/Validator/InternalLinkValidator.php - - - message: "#^Offset 1 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-empty\\-string, 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/RichText/Validator/InternalLinkValidator.php - - - - message: "#^Offset 2 does not exist on array\\{0\\?\\: string, 1\\?\\: non\\-empty\\-string, 2\\?\\: string, 3\\?\\: string\\}\\.$#" - count: 1 - path: src/lib/RichText/Validator/InternalLinkValidator.php - - message: "#^Parameter \\#1 \\$locationId of method Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\Location\\\\Handler\\:\\:load\\(\\) expects int, string given\\.$#" count: 1 diff --git a/src/bundle/Resources/richtext/schemas/docbook/docbook.iso.sch b/src/bundle/Resources/richtext/schemas/docbook/docbook.iso.sch index c206b52c..a5ee69dd 100644 --- a/src/bundle/Resources/richtext/schemas/docbook/docbook.iso.sch +++ b/src/bundle/Resources/richtext/schemas/docbook/docbook.iso.sch @@ -253,20 +253,13 @@ - links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, # - using characters [< > "] in links is not allowed + mode="schematron-get-full-path-2">links must start with one of: http://, https://, mailto:, tel:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, # diff --git a/src/bundle/Resources/richtext/schemas/docbook/docbook.iso.sch.xsl b/src/bundle/Resources/richtext/schemas/docbook/docbook.iso.sch.xsl index 6e4551bc..494d3a2b 100644 --- a/src/bundle/Resources/richtext/schemas/docbook/docbook.iso.sch.xsl +++ b/src/bundle/Resources/richtext/schemas/docbook/docbook.iso.sch.xsl @@ -79,7 +79,4 @@ -links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, # - - -using characters [< > "] in links is not allowed +links must start with one of: http://, https://, mailto:, tel:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, # diff --git a/tests/lib/FieldType/RichTextTest.php b/tests/lib/FieldType/RichTextTest.php index b027d356..1fb2cd27 100644 --- a/tests/lib/FieldType/RichTextTest.php +++ b/tests/lib/FieldType/RichTextTest.php @@ -229,7 +229,7 @@ public function providerForTestValidate() [ new ValidationError( "Validation of XML content failed:\n" . - '/section/para/link: links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, #', + '/section/para/link: links must start with one of: http://, https://, mailto:, tel:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, #', null, [], 'xml' @@ -244,7 +244,7 @@ public function providerForTestValidate() [ new ValidationError( "Validation of XML content failed:\n" . - '/section/para/link: links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, #', + '/section/para/link: links must start with one of: http://, https://, mailto:, tel:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, #', null, [], 'xml' @@ -257,13 +257,6 @@ public function providerForTestValidate() link ', [ - new ValidationError( - "Validation of XML content failed:\n" . - '/section/para/link: using characters [< > "] in links is not allowed', - null, - [], - 'xml' - ), ], ], [ @@ -274,7 +267,7 @@ public function providerForTestValidate() [ new ValidationError( "Validation of XML content failed:\n" . - '/section/para/link: links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, #', + '/section/para/link: links must start with one of: http://, https://, mailto:, tel:, ezcontent://, ezlocation://, ezremote://, ezurl://, /, #', null, [], 'xml'