Skip to content

Commit

Permalink
Remove superfluous character in class
Browse files Browse the repository at this point in the history
The solidusbackslash character ("\")  was put more than once in the same
regex character class across some XSD files. Per each character class
there is no need to specify it twice.

I ran over this while looking into an issue with class-name validation
which do not allow digits within class names.

Refs:

- https://www.w3.org/TR/xmlschema11-2/#cces

- magento#4470

- magento#5420

- magento#8307
  • Loading branch information
tkn98 committed Mar 29, 2017
1 parent a4a9c2f commit 6ce8242
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'</option></config>',
[
"Element 'option', attribute 'renderer': [facet 'pattern'] The value 'true12' is not accepted by the " .
"pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n",
"pattern '[a-zA-Z_\\\\]+'.\nLine: 1\n",
"Element 'option', attribute 'renderer': 'true12' is not a valid value of the atomic" .
" type 'modelName'.\nLine: 1\n"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'<?xml version="1.0"?><config><type name="some_name" modelInstance="123" /></config>',
[
"Element 'type', attribute 'modelInstance': [facet 'pattern'] The value '123' is not accepted by the" .
" pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n",
" pattern '[a-zA-Z_\\\\]+'.\nLine: 1\n",
"Element 'type', attribute 'modelInstance': '123' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
Expand Down Expand Up @@ -57,7 +57,7 @@
'<?xml version="1.0"?><config><type name="some_name"><priceModel instance="123123" /></type></config>',
[
"Element 'priceModel', attribute 'instance': [facet 'pattern'] The value '123123' is not accepted " .
"by the pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n",
"by the pattern '[a-zA-Z_\\\\]+'.\nLine: 1\n",
"Element 'priceModel', attribute 'instance': '123123' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
Expand All @@ -66,7 +66,7 @@
'<?xml version="1.0"?><config><type name="some_name"><indexerModel instance="123" /></type></config>',
[
"Element 'indexerModel', attribute 'instance': [facet 'pattern'] The value '123' is not accepted by " .
"the pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n",
"the pattern '[a-zA-Z_\\\\]+'.\nLine: 1\n",
"Element 'indexerModel', attribute 'instance': '123' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
Expand All @@ -83,7 +83,7 @@
'<?xml version="1.0"?><config><type name="some_name"><stockIndexerModel instance="1234"/></type></config>',
[
"Element 'stockIndexerModel', attribute 'instance': [facet 'pattern'] The value '1234' is not " .
"accepted by the pattern '[a-zA-Z_\\\\\\\\]+'.\nLine: 1\n",
"accepted by the pattern '[a-zA-Z_\\\\]+'.\nLine: 1\n",
"Element 'stockIndexerModel', attribute 'instance': '1234' is not a valid value of the atomic " .
"type 'modelName'.\nLine: 1\n"
],
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/etc/product_options.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
<xs:simpleType name="modelName">
<xs:annotation>
<xs:documentation>
Model name can contain only [a-zA-Z_\\\\].
Model name can contain only [a-zA-Z_\\].
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z_\\\\]+" />
<xs:pattern value="[a-zA-Z_\\]+" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/etc/product_types_base.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@
<xs:simpleType name="modelName">
<xs:annotation>
<xs:documentation>
Model name can contain only [a-zA-Z_\\\\].
Model name can contain only [a-zA-Z_\\].
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z_\\\\]+" />
<xs:pattern value="[a-zA-Z_\\]+" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"Element 'config_path': [facet 'minLength'] The value has a length of '2'; this underruns " .
"the allowed minimum length of '5'.\nLine: 1\n",
"Element 'config_path': [facet 'pattern'] The value 'co' is not " .
"accepted by the pattern '[a-zA-Z0-9_\\\\\\\\]+/[a-zA-Z0-9_\\\\\\\\]+/[a-zA-Z0-9_\\\\\\\\]+'.\nLine: 1\n",
"accepted by the pattern '[a-zA-Z0-9_\\\\]+/[a-zA-Z0-9_\\\\]+/[a-zA-Z0-9_\\\\]+'.\nLine: 1\n",
"Element 'config_path': 'co' is " . "not a valid value of the atomic type 'typeConfigPath'.\nLine: 1\n"
],
],
Expand All @@ -76,7 +76,7 @@
"Element 'if_module_enabled': [facet 'minLength'] The value has a length of '3'; this underruns the " .
"allowed minimum length of '5'.\nLine: 1\n",
"Element 'if_module_enabled': [facet 'pattern'] The value 'Som' is not " .
"accepted by the pattern '[A-Z]+[a-zA-Z0-9]{1,}[_\\\\\\\\][A-Z]+[A-Z0-9a-z]{1,}'.\nLine: 1\n",
"accepted by the pattern '[A-Z]+[a-zA-Z0-9]{1,}[_\\\\][A-Z]+[A-Z0-9a-z]{1,}'.\nLine: 1\n",
"Element 'if_module_enabled': 'Som' " . "is not a valid value of the atomic type 'typeModule'.\nLine: 1\n"
],
],
Expand Down
14 changes: 7 additions & 7 deletions app/code/Magento/Config/etc/system.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
</xs:annotation>

<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9_///\\\\*]{3,}" />
<xs:pattern value="[a-zA-Z0-9_///\\*]{3,}" />
<xs:minLength value="3" />
</xs:restriction>
</xs:simpleType>
Expand Down Expand Up @@ -395,7 +395,7 @@
</xs:annotation>

<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9_\\\\]{1,}" />
<xs:pattern value="[a-zA-Z0-9_\\]{1,}" />
<xs:minLength value="3" />
</xs:restriction>
</xs:simpleType>
Expand All @@ -408,7 +408,7 @@
</xs:annotation>

<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9_\\\\]{1,}" />
<xs:pattern value="[a-zA-Z0-9_\\]{1,}" />
<xs:minLength value="2" />
</xs:restriction>
</xs:simpleType>
Expand All @@ -433,7 +433,7 @@
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]+[a-zA-Z0-9]{1,}[_\\\\][A-Z]+[A-Z0-9a-z]{1,}" />
<xs:pattern value="[A-Z]+[a-zA-Z0-9]{1,}[_\\][A-Z]+[A-Z0-9a-z]{1,}" />
<xs:minLength value="5" />
</xs:restriction>
</xs:simpleType>
Expand All @@ -445,7 +445,7 @@
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z0-9_\\\\:]+" />
<xs:pattern value="[A-Za-z0-9_\\:]+" />
<xs:minLength value="5" />
</xs:restriction>
</xs:simpleType>
Expand Down Expand Up @@ -473,14 +473,14 @@
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9_\\\\]+/[a-zA-Z0-9_\\\\]+/[a-zA-Z0-9_\\\\]+" />
<xs:pattern value="[a-zA-Z0-9_\\]+/[a-zA-Z0-9_\\]+/[a-zA-Z0-9_\\]+" />
<xs:minLength value="5" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="typeUploadDirRestriction">
<xs:restriction base="xs:string">
<xs:pattern value="([a-zA-Z0-9_\\\\]+/{0,1}){1,}" />
<xs:pattern value="([a-zA-Z0-9_\\]+/{0,1}){1,}" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="typeUploadDir">
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Config/etc/system_file.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z0-9\\\\:]+" />
<xs:pattern value="[A-Za-z0-9\\:]+" />
<xs:minLength value="5" />
</xs:restriction>
</xs:simpleType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
. ' <fileFormat name="name_one" model="model1"/></config>',
[
"Element 'entityType', attribute 'model': [facet 'pattern'] The value '1' is not accepted by the " .
"pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
"Element 'entityType', attribute 'model': '1' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n",
"Element 'fileFormat', attribute 'model': [facet 'pattern'] The value 'model1' is not " .
"accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"accepted by the pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
"Element 'fileFormat', attribute 'model': 'model1' is not a valid " .
"value of the atomic type 'modelName'.\nLine: 1\n"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'behaviorModel="test" /></config>',
[
"Element 'entity', attribute 'model': [facet 'pattern'] The value 'afwer34' is not " .
"accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"accepted by the pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'model': 'afwer34' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
Expand All @@ -40,7 +40,7 @@
'</config>',
[
"Element 'entity', attribute 'behaviorModel': [facet 'pattern'] The value '666' is not accepted by " .
"the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"the pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'behaviorModel': '666' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'<?xml version="1.0"?><config><entity name="some_name" model="12345"/></config>',
[
"Element 'entity', attribute 'model': [facet 'pattern'] The value '12345' is not accepted by " .
"the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"the pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'model': '12345' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
Expand All @@ -28,7 +28,7 @@
'<?xml version="1.0"?><config><entity name="some_name" behaviorModel="=--09"/></config>',
[
"Element 'entity', attribute 'behaviorModel': [facet 'pattern'] The value '=--09' is not " .
"accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"accepted by the pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'behaviorModel': '=--09' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
Expand All @@ -49,7 +49,7 @@
'<?xml version="1.0"?><config><entityType entity="entity_name" name="some_name" model="test1"/></config>',
[
"Element 'entityType', attribute 'model': [facet 'pattern'] The value 'test1' is not " .
"accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"accepted by the pattern '[A-Za-z_\\\\]+'.\nLine: 1\n",
"Element 'entityType', attribute 'model': 'test1' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/ImportExport/etc/export.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@
<xs:simpleType name="modelName">
<xs:annotation>
<xs:documentation>
Model name can contain only [A-Za-z_\\\\].
Model name can contain only [A-Za-z_\\].
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z_\\\\]+" />
<xs:pattern value="[A-Za-z_\\]+" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
4 changes: 2 additions & 2 deletions app/code/Magento/ImportExport/etc/import.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
<xs:simpleType name="modelName">
<xs:annotation>
<xs:documentation>
Model name can contain only [A-Za-z_\\\\].
Model name can contain only [A-Za-z_\\].
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z_\\\\]+" />
<xs:pattern value="[A-Za-z_\\]+" />
</xs:restriction>
</xs:simpleType>
</xs:schema>

0 comments on commit 6ce8242

Please sign in to comment.