{"id":16676523,"url":"https://github.com/luketowers/php-svg-cleaner","last_synced_at":"2025-08-17T08:04:01.603Z","repository":{"id":79817363,"uuid":"194807799","full_name":"LukeTowers/php-svg-cleaner","owner":"LukeTowers","description":"SVG Sanitization / cleanup in PHP","archived":false,"fork":false,"pushed_at":"2019-07-02T20:00:52.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-22T05:38:18.169Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LukeTowers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-02T07:05:15.000Z","updated_at":"2021-10-11T08:49:22.000Z","dependencies_parsed_at":"2023-09-13T21:42:45.850Z","dependency_job_id":null,"html_url":"https://github.com/LukeTowers/php-svg-cleaner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LukeTowers/php-svg-cleaner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeTowers%2Fphp-svg-cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeTowers%2Fphp-svg-cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeTowers%2Fphp-svg-cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeTowers%2Fphp-svg-cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukeTowers","download_url":"https://codeload.github.com/LukeTowers/php-svg-cleaner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeTowers%2Fphp-svg-cleaner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270820793,"owners_count":24651534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T13:10:46.799Z","updated_at":"2025-08-17T08:04:01.553Z","avatar_url":"https://github.com/LukeTowers.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-svg-cleaner\nSVG Sanitization / cleanup in PHP; WIP rebuild of https://github.com/Blobfolio/blob-common focusing on just SVG sanitization.\n\n# NOT CURRENTLY IN A USABLE STATE\n\n## Defaults:\n\n### `$attrCorrections` | array\n```php\n[\n    'id=\"Layer_1\"'             =\u003e '',\n    'xmlns=\"\u0026ns_svg;\"'         =\u003e 'xmlns=\"http://www.w3.org/2000/svg\"',\n    'xmlns:xlink=\"\u0026ns_xlink;\"' =\u003e 'xmlns:xlink=\"http://www.w3.org/1999/xlink\"',\n]\n```\n\n### `$svgHeader` | string\n`'\u003c?xml version=\"1.0\" encoding=\"utf-8\" ?\u003e' . \"\\n\" . '\u003c!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"\u003e'`\n\n### `$svgNamespace` | string\n`'http://www.w3.org/2000/svg'`\n\n### `$allowedTags` | array | see [https://developer.mozilla.org/en-US/docs/Web/SVG/Element](https://developer.mozilla.org/en-US/docs/Web/SVG/Element)\n```php\n['a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animate', 'animatecolor', 'animatemotion', 'animatetransform', 'audio', 'canvas', 'circle', 'clippath', 'color-profile', 'cursor', 'defs', 'desc', 'discard', 'ellipse', 'feblend', 'fecolormatrix', 'fecomponenttransfer', 'fecomposite', 'feconvolvematrix', 'fediffuselighting', 'fedisplacementmap', 'fedistantlight', 'fedropshadow', 'feflood', 'fefunca', 'fefuncb', 'fefuncg', 'fefuncr', 'fegaussianblur', 'feimage', 'femerge', 'femergenode', 'femorphology', 'feoffset', 'fepointlight', 'fespecularlighting', 'fespotlight', 'fetile', 'feturbulence', 'filter', 'font', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'g', 'glyph', 'glyphref', 'hatch', 'hatchpath', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'metadata', 'missing-glyph', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'set', 'solidcolor', 'stop', 'style', 'svg', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'unknown', 'use', 'video', 'view', 'vkern']\n```\n\n### `$allowedAttrs` | array | see [https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute)\n```php\n['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'allowreorder', 'alphabetic', 'amplitude', 'arabic-form', 'ascent', 'attributename', 'attributetype', 'autoreverse', 'azimuth', 'basefrequency', 'baseline-shift', 'baseprofile', 'bbox', 'begin', 'bias', 'by', 'calcmode', 'cap-height', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'contentstyletype', 'cursor', 'cx', 'cy', 'd', 'decelerate', 'descent', 'diffuseconstant', 'direction', 'display', 'divisor', 'dominant-baseline', 'dur', 'dx', 'dy', 'edgemode', 'elevation', 'enable-background', 'end', 'exponent', 'externalresourcesrequired', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterres', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'format', 'from', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'glyphref', 'gradienttransform', 'gradientunits', 'hanging', 'height', 'href', 'horiz-adv-x', 'horiz-origin-x', 'id', 'ideographic', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kernelmatrix', 'kernelunitlength', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'lighting-color', 'limitingconeangle', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'mask', 'maskcontentunits', 'maskunits', 'mathematical', 'max', 'media', 'method', 'min', 'mode', 'name', 'numoctaves', 'offset', 'opacity', 'operator', 'order', 'orient', 'orientation', 'origin', 'overflow', 'overline-position', 'overline-thickness', 'panose-1', 'paint-order', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'pointer-events', 'points', 'pointsatx', 'pointsaty', 'pointsatz', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'radius', 'refx', 'refy', 'rendering-intent', 'repeatcount', 'repeatdur', 'requiredextensions', 'requiredfeatures', 'restart', 'result', 'rotate', 'rx', 'ry', 'scale', 'seed', 'shape-rendering', 'slope', 'spacing', 'specularconstant', 'specularexponent', 'speed', 'spreadmethod', 'startoffset', 'stddeviation', 'stemh', 'stemv', 'stitchtiles', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'string', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'target', 'targetx', 'targety', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'to', 'transform', 'type', 'u1', 'u2', 'underline-position', 'underline-thickness', 'unicode', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'values', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'viewbox', 'viewtarget', 'visibility', 'width', 'widths', 'word-spacing', 'writing-mode', 'x', 'x-height', 'x1', 'x2', 'xchannelselector', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'xmlns', 'xmlns:xlink', 'xmlns:xml', 'y', 'y1', 'y2', 'ychannelselector', 'z', 'zoomandpan']\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluketowers%2Fphp-svg-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluketowers%2Fphp-svg-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluketowers%2Fphp-svg-cleaner/lists"}