Skip to content

Commit 8b75c60

Browse files
committed
Fixed failing test for ezurl protocol
1 parent 6131975 commit 8b75c60

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/lib/eZ/RichText/Resources/schemas/docbook/docbook.iso.sch

+2-1
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,9 @@
258258
starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'mailto:') or
259259
starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezcontent://') or
260260
starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezlocation://') or
261+
starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezurl://') or
261262
starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), '#')"
262-
mode="schematron-get-full-path-2">links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, #</s:assert>
263+
mode="schematron-get-full-path-2">links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezurl://, #</s:assert>
263264
<s:assert test="not(contains(@*[name()='xlink:href'], '&lt;') or
264265
contains(@*[name()='xlink:href'], '&gt;') or
265266
contains(@*[name()='xlink:href'], '&quot;'))"

src/lib/eZ/RichText/Resources/schemas/docbook/docbook.iso.sch.xsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<axsl:template match="db:link" priority="1000" mode="M3"><svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="db:link"/>
8080

8181
<!--ASSERT -->
82-
<axsl:choose><axsl:when test="starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'http://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'https://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'mailto:') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezcontent://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezlocation://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), '#')"/><axsl:otherwise><svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:schold="http://www.ascc.net/xml/schematron" test="starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'http://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'https://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'mailto:') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezcontent://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezlocation://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), '#')"><axsl:attribute name="location"><axsl:apply-templates select="." mode="schematron-get-full-path-2"/></axsl:attribute><svrl:text>links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, #</svrl:text></svrl:failed-assert></axsl:otherwise></axsl:choose>
82+
<axsl:choose><axsl:when test="starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'http://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'https://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'mailto:') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezcontent://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezlocation://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezurl://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), '#')"/><axsl:otherwise><svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:schold="http://www.ascc.net/xml/schematron" test="starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'http://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'https://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'mailto:') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezcontent://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezlocation://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), 'ezurl://') or starts-with(translate(@*[name()='xlink:href'], $upperCase, $lowerCase), '#')"><axsl:attribute name="location"><axsl:apply-templates select="." mode="schematron-get-full-path-2"/></axsl:attribute><svrl:text>links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezurl://, #</svrl:text></svrl:failed-assert></axsl:otherwise></axsl:choose>
8383

8484
<!--ASSERT -->
8585
<axsl:choose><axsl:when test="not(contains(@*[name()='xlink:href'], '&lt;') or contains(@*[name()='xlink:href'], '&gt;') or contains(@*[name()='xlink:href'], '&quot;'))"/><axsl:otherwise><svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:schold="http://www.ascc.net/xml/schematron" test="not(contains(@*[name()='xlink:href'], '&lt;') or contains(@*[name()='xlink:href'], '&gt;') or contains(@*[name()='xlink:href'], '&quot;'))"><axsl:attribute name="location"><axsl:apply-templates select="." mode="schematron-get-full-path-2"/></axsl:attribute><svrl:text>using characters [&lt; &gt; "] in links is not allowed</svrl:text></svrl:failed-assert></axsl:otherwise></axsl:choose><axsl:apply-templates select="*|comment()|processing-instruction()" mode="M3"/></axsl:template><axsl:template match="text()" priority="-1" mode="M3"/><axsl:template match="@*|node()" priority="-2" mode="M3"><axsl:apply-templates select="*|comment()|processing-instruction()" mode="M3"/></axsl:template></axsl:stylesheet>

tests/lib/eZ/FieldType/RichTextTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public function providerForTestValidate()
224224
[
225225
new ValidationError(
226226
"Validation of XML content failed:\n" .
227-
'/section/para/link: links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, #',
227+
'/section/para/link: links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezurl://,#',
228228
null,
229229
[],
230230
'xml'
@@ -239,7 +239,7 @@ public function providerForTestValidate()
239239
[
240240
new ValidationError(
241241
"Validation of XML content failed:\n" .
242-
'/section/para/link: links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, #',
242+
'/section/para/link: links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezurl://,#',
243243
null,
244244
[],
245245
'xml'
@@ -269,7 +269,7 @@ public function providerForTestValidate()
269269
[
270270
new ValidationError(
271271
"Validation of XML content failed:\n" .
272-
'/section/para/link: links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, #',
272+
'/section/para/link: links must start with one of: http://, https://, mailto:, ezcontent://, ezlocation://, ezurl://,#',
273273
null,
274274
[],
275275
'xml'

0 commit comments

Comments
 (0)