Disallow 'text'-tags in SVG-images

This commit is contained in:
pietervdvn 2022-05-07 21:41:58 +02:00
parent a091f3b7b4
commit e08a7ca2cf
10 changed files with 19918 additions and 21112 deletions

File diff suppressed because it is too large Load diff

Before

Width:  |  Height:  |  Size: 635 KiB

After

Width:  |  Height:  |  Size: 374 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 155 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 152 KiB

View file

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg4339"
version="1.1"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
inkscape:version="1.1.2 (1:1.1+202202050950+0a00cf5339)"
width="500"
height="587.92395"
sodipodi:docname="vet.svg">
sodipodi:docname="vet.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata4345">
<rdf:RDF>
@ -21,7 +21,6 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@ -54,13 +53,14 @@
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="1.1352191"
inkscape:cx="279.26018"
inkscape:cy="260.31831"
inkscape:cx="279.24125"
inkscape:cy="281.88391"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4339"
inkscape:document-rotation="0">
inkscape:document-rotation="0"
inkscape:pagecheckerboard="0">
<sodipodi:guide
orientation="0,1"
position="289.01695,294"
@ -87,12 +87,14 @@
style="fill:#714cff;fill-opacity:1;stroke:none"
id="path2858-6-2-0-2-6-4-6" />
</g>
<text
xml:space="preserve"
<g
aria-label="V"
transform="matrix(16.414685,0,0,12.686072,-2604.0754,-2505.816)"
id="text869"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:25px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect871);fill:#f10000;fill-opacity:0.79850543;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
transform="matrix(16.414685,0,0,12.686072,-2617.2879,-2514.4493)"><tspan
x="160.57617"
y="239.99023"><tspan
style="fill:#f10000;fill-opacity:0.798505">V</tspan></tspan></text>
style="font-size:40px;line-height:25px;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect871);fill:#f10000;fill-opacity:0.798505;stroke-width:1px">
<path
d="m 186.57617,212.43462 -9.72,28.56 h -6.6 l -9.68,-28.56 h 6.12 l 5.36,17 q 0.16,0.44 0.44,1.64 0.32,1.16 0.64,2.48 0.32,1.28 0.44,2.16 0.12,-0.88 0.4,-2.16 0.32,-1.32 0.64,-2.48 0.32,-1.2 0.44,-1.64 l 5.4,-17 z"
style="font-weight:bold"
id="path3724" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

@ -1841,58 +1841,7 @@
d="M 131.1683,37.049946 C 171.82694,4.876587 209.3036,24.322024 208.95005,42.353247 208.5965,60.38447 152.38151,112.71037 132.58252,108.46773 112.78353,104.22509 107.12667,55.081169 131.1683,37.049946 Z"
id="path6587"
inkscape:connector-curvature="0"/>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;opacity:0.46086958;fill:url(#radialGradient6482);fill-opacity:1;stroke:none"
x="99.83886"
y="69.184349"
id="text6302-7"
transform="rotate(-8.8996237)"><tspan
id="tspan6304-0"
x="99.83886"
y="69.184349"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1">01011001</tspan>
<tspan
x="99.83886"
y="93.934013"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
id="tspan6415-7">00110101</tspan>
<tspan
x="99.83886"
y="118.68368"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
id="tspan6417-1">10010011</tspan>
<tspan
x="99.83886"
y="143.43335"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
id="tspan6419-9"> </tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;fill:url(#radialGradient6427);fill-opacity:1;stroke:none"
x="99.410172"
y="67.898323"
id="text6302"
transform="rotate(-8.8996237)"><tspan
id="tspan6304"
x="99.410172"
y="67.898323"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1">01011001</tspan>
<tspan
x="99.410172"
y="92.647987"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
id="tspan6415">00110101</tspan>
<tspan
x="99.410172"
y="117.39765"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
id="tspan6417">10010011</tspan>
<tspan
x="99.410172"
y="142.14732"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
id="tspan6419"> </tspan></text>
<path
style="opacity:0.76521738;fill:url(#linearGradient6614);fill-opacity:1;stroke:none"
d="m 219.46318,129.09019 c -26.79401,21.9828 -41.80834,21.0073 -38.07474,13.13797 3.73361,-7.86929 42.32585,-41.65518 51.44717,-43.7482 9.1213,-2.09301 2.27518,18.04121 -13.37243,30.61023 z"

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 157 KiB

View file

@ -3522,66 +3522,7 @@
style="opacity:0.6043478;fill:url(#linearGradient6595);fill-opacity:1;stroke:none"
d="M 131.1683,37.049946 C 171.82694,4.876587 209.3036,24.322024 208.95005,42.353247 C 208.5965,60.38447 152.38151,112.71037 132.58252,108.46773 C 112.78353,104.22509 107.12667,55.081169 131.1683,37.049946 z"
id="path6587"/>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;opacity:0.46086958;fill:url(#radialGradient6482);fill-opacity:1;stroke:none"
x="99.83886"
y="69.184349"
id="text6302-7"
transform="rotate(-8.8996237)"><tspan
sodipodi:role="line"
id="tspan6304-0"
x="99.83886"
y="69.184349"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1">01011001</tspan>
<tspan
sodipodi:role="line"
x="99.83886"
y="93.934013"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
id="tspan6415-7">00110101</tspan>
<tspan
sodipodi:role="line"
x="99.83886"
y="118.68368"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
id="tspan6417-1">10010011</tspan>
<tspan
sodipodi:role="line"
x="99.83886"
y="143.43335"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
id="tspan6419-9"> </tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;fill:url(#radialGradient6427);fill-opacity:1;stroke:none"
x="99.410172"
y="67.898323"
id="text6302"
transform="rotate(-8.8996237)"><tspan
sodipodi:role="line"
id="tspan6304"
x="99.410172"
y="67.898323"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1">01011001</tspan>
<tspan
sodipodi:role="line"
x="99.410172"
y="92.647987"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
id="tspan6415">00110101</tspan>
<tspan
sodipodi:role="line"
x="99.410172"
y="117.39765"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
id="tspan6417">10010011</tspan>
<tspan
sodipodi:role="line"
x="99.410172"
y="142.14732"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
id="tspan6419"> </tspan></text>
<path
style="opacity:0.76521738;fill:url(#linearGradient6614);fill-opacity:1;stroke:none"
d="M 219.46318,129.09019 C 192.66917,151.07299 177.65484,150.09749 181.38844,142.22816 C 185.12205,134.35887 223.71429,100.57298 232.83561,98.47996 C 241.95691,96.38695 235.11079,116.52117 219.46318,129.09019 z"

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 204 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 164 KiB

View file

@ -1,19 +1,13 @@
{
"id": "mapcomplete-changes",
"title": {
"en": "Changes made with MapComplete",
"de": "Änderungen mit MapComplete",
"es": "Cambios hechos con MapComplete"
"en": "Changes made with MapComplete"
},
"shortDescription": {
"en": "Shows changes made by MapComplete",
"de": "Zeigt Änderungen von MapComplete",
"es": "Muestra los cambios hechos por MapComplete"
"en": "Shows changes made by MapComplete"
},
"description": {
"en": "This maps shows all the changes made with MapComplete",
"de": "Diese Karte zeigt alle Änderungen die mit MapComplete gemacht wurden",
"es": "Este mapa muestra todos los cambios hechos con MapComplete"
"en": "This maps shows all the changes made with MapComplete"
},
"maintainer": "",
"icon": "./assets/svg/logo.svg",
@ -28,9 +22,7 @@
{
"id": "mapcomplete-changes",
"name": {
"en": "Changeset centers",
"de": "Schwerpunkte von Änderungssätzen",
"es": "Centros de conjuntos de cambios"
"en": "Changeset centers"
},
"minzoom": 0,
"source": {
@ -44,45 +36,35 @@
],
"title": {
"render": {
"en": "Changeset for {theme}",
"de": "Änderungen für {theme}",
"es": "Conjunto de cambios para {theme}"
"en": "Changeset for {theme}"
}
},
"description": {
"en": "Shows all MapComplete changes",
"de": "Zeigt alle MapComplete Änderungen",
"es": "Muestra todos los cambios de MapComplete"
"en": "Shows all MapComplete changes"
},
"tagRenderings": [
{
"id": "render_id",
"render": {
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"de": "Änderung <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>",
"es": "Conjunto de cambios <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
"en": "Changeset <a href='https://openstreetmap.org/changeset/{id}' target='_blank'>{id}</a>"
}
},
{
"id": "contributor",
"render": {
"en": "Change made by <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>",
"de": "Änderung wurde von <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a> gemacht",
"es": "Cambio hecho por <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>"
"en": "Change made by <a href='https://openstreetmap.org/user/{_last_edit:contributor}' target='_blank'>{_last_edit:contributor}</a>"
}
},
{
"id": "theme",
"render": {
"en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>",
"de": "Änderung mit Thema <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
"en": "Change with theme <a href='https://mapcomplete.osm.be/{theme}'>{theme}</a>"
},
"mappings": [
{
"if": "theme~http.*",
"then": {
"en": "Change with <b>unofficial</b> theme <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>",
"de": "Änderung mit <b>inoffiziellem</b> Thema <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>"
"en": "Change with <b>unofficial</b> theme <a href='https://mapcomplete.osm.be/theme.html?userlayout={theme}'>{theme}</a>"
}
}
]
@ -350,8 +332,7 @@
}
],
"question": {
"en": "Themename contains {search}",
"de": "Themenname enthält {search}"
"en": "Themename contains {search}"
}
}
]
@ -367,9 +348,7 @@
}
],
"question": {
"en": "Made by contributor {search}",
"de": "Erstellt von {search}",
"es": "Hecho por contributor/a {search}"
"en": "Made by contributor {search}"
}
}
]
@ -385,9 +364,7 @@
}
],
"question": {
"en": "<b>Not</b> made by contributor {search}",
"de": "<b>Nicht</b> erstellt von {search}",
"es": "<b>No</b> hecho por contributor/a {search}"
"en": "<b>Not</b> made by contributor {search}"
}
}
]
@ -402,9 +379,7 @@
{
"id": "link_to_more",
"render": {
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>",
"de": "Weitere Statistiken finden Sie <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>hier</a>",
"es": "Se pueden encontrar más estadísticas <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>aquí</a>"
"en": "More statistics can be found <a href='https://github.com/pietervdvn/MapComplete/tree/develop/Docs/Tools/graphs' target='_blank'>here</a>"
}
},
{

View file

@ -2555,58 +2555,6 @@
id="path6587"
d="M 131.1683,37.049946 C 171.82694,4.876587 209.3036,24.322024 208.95005,42.353247 208.5965,60.38447 152.38151,112.71037 132.58252,108.46773 112.78353,104.22509 107.12667,55.081169 131.1683,37.049946 Z"
style="opacity:0.6043478;fill:url(#linearGradient6595);fill-opacity:1;stroke:none"/>
<text
transform="rotate(-8.8996237)"
id="text6302-7"
y="69.184349"
x="99.83886"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;opacity:0.46086958;fill:url(#radialGradient6482);fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
y="69.184349"
x="99.83886"
id="tspan6304-0">01011001</tspan>
<tspan
id="tspan6415-7"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
y="93.934013"
x="99.83886">00110101</tspan>
<tspan
id="tspan6417-1"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
y="118.68368"
x="99.83886">10010011</tspan>
<tspan
id="tspan6419-9"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6482);fill-opacity:1"
y="143.43335"
x="99.83886"> </tspan></text>
<text
transform="rotate(-8.8996237)"
id="text6302"
y="67.898323"
x="99.410172"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;fill:url(#radialGradient6427);fill-opacity:1;stroke:none"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
y="67.898323"
x="99.410172"
id="tspan6304">01011001</tspan>
<tspan
id="tspan6415"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
y="92.647987"
x="99.410172">00110101</tspan>
<tspan
id="tspan6417"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
y="117.39765"
x="99.410172">10010011</tspan>
<tspan
id="tspan6419"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:19.79973221px;line-height:1.25;font-family:monospace;-inkscape-font-specification:'Monospace Bold';fill:url(#radialGradient6427);fill-opacity:1"
y="142.14732"
x="99.410172"> </tspan></text>
<path
id="path6587-7"
d="m 219.46318,129.09019 c -26.79401,21.9828 -41.80834,21.0073 -38.07474,13.13797 3.73361,-7.86929 42.32585,-41.65518 51.44717,-43.7482 9.1213,-2.09301 2.27518,18.04121 -13.37243,30.61023 z"

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View file

@ -121,17 +121,21 @@ class LayerOverviewUtils {
continue
}
const contents = readFileSync(path, "UTF8")
if (contents.indexOf("data:image/png;") < 0) {
continue;
if (contents.indexOf("data:image/png;") >= 0) {
console.warn("The SVG at " + path + " is a fake SVG: it contains PNG data!")
errCount++;
if (path.startsWith("./assets/svg")) {
throw "A core SVG is actually a PNG. Don't do this!"
}
}
console.warn("The SVG at " + path + " is a fake SVG: it contains PNG data!")
errCount++;
if (path.startsWith("./assets/svg")) {
throw "A core SVG is actually a PNG. Don't do this!"
if(contents.indexOf("<text")>0){
console.warn("The SVG at " + path + " contains a `text`-tag. This is highly discouraged. Every machine viewing your theme has their own font libary, and the font you choose might not be present, resulting in a different font being rendered. Solution: open your .svg in inkscape (or another program), select the text and convert it to a path")
errCount++;
}
}
if (errCount > 0) {
throw `There are ${errCount} fake svgs`
throw `There are ${errCount} invalid svgs`
}
}