Skip to content

Commit

Permalink
Add check for entity IDs that don't start with an appropriate scheme.…
Browse files Browse the repository at this point in the history
… Catches things like 'http://xxx' (missing colon).
  • Loading branch information
iay committed Jul 22, 2009
1 parent e90a119 commit a5846fb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
16 changes: 14 additions & 2 deletions build/check.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,20 @@
<xsl:with-param name="m">entity ID contains space character</xsl:with-param>
</xsl:call-template>
</xsl:template>




<!--
Entity IDs should start with one of "http://", "https://" or "urn:mace:".
-->
<xsl:template match="md:EntityDescriptor[not(starts-with(@entityID, 'urn:mace:'))]
[not(starts-with(@entityID, 'http://'))]
[not(starts-with(@entityID, 'https://'))]">
<xsl:call-template name="fatal">
<xsl:with-param name="m">entity ID <xsl:value-of select="@entityID"/> does not start with acceptable prefix</xsl:with-param>
</xsl:call-template>
</xsl:template>


<!--
@Location attributes should not contain space characters.
Expand Down
12 changes: 12 additions & 0 deletions build/check_imported.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@
</xsl:template>


<!--
Entity IDs should start with one of "http://", "https://" or "urn:mace:".
-->
<xsl:template match="md:EntityDescriptor[not(starts-with(@entityID, 'urn:mace:'))]
[not(starts-with(@entityID, 'http://'))]
[not(starts-with(@entityID, 'https://'))]">
<xsl:call-template name="fatal">
<xsl:with-param name="m">entity ID <xsl:value-of select="@entityID"/> does not start with acceptable prefix</xsl:with-param>
</xsl:call-template>
</xsl:template>


<!--
@Location attributes should not contain space characters.
Expand Down

0 comments on commit a5846fb

Please sign in to comment.