Skip to content

Commit

Permalink
Merge remote-tracking branch 'dqneo/fix-parser-for-svg'
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibaud Fabre committed Nov 30, 2016
2 parents 0539400 + 6d1fb77 commit 13f48c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DataURI/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Parser
* offset #2 Parameters
* offset #3 Datas
*/
const DATA_URI_REGEXP = '/data:([a-zA-Z-\/]+)([a-zA-Z0-9-_;=.+]+)?,(.*)/';
const DATA_URI_REGEXP = '/data:([a-zA-Z-\/+]+)([a-zA-Z0-9-_;=.+]+)?,(.*)/';

/**
* Parse a data URI and return a DataUri\Data
Expand Down
5 changes: 4 additions & 1 deletion tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ public function testParse()
$this->assertFalse($dataURI->isBinaryData());
$this->assertEquals('#$%', $dataURI->getData());
$this->assertEquals(1, count($dataURI->getParameters()));
}

$dataURI = DataURI\Parser::parse($tests[4]);
$this->assertEquals('image/svg+xml', $dataURI->getMimeType());
}

/**
* @expectedException \DataURI\Exception\InvalidDataException
Expand Down

0 comments on commit 13f48c3

Please sign in to comment.