Rct567/DomQuery

getAttribute on src of img returns base64 (not your fault at all!)

Closed this issue · 1 comments

love this library!

46 stars? what a joke. This is the best shit i've come across in a while

following question:

if I do

/** @var \DOMElement $el */
echo $el->getAttribute('src');

I get:

data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
The HTML is though:

<img src="./mysystem/pictures for the system/AMV/image3.jpg">
what I want?

I want to get

./mysystem/pictures for the system/AMV/image3.jpg returned

The following code already returns the correct value:

DomQuery::create('<img src="./mysystem/pictures for the system/AMV/image3.jpg"></a>')->attr('src')

If you encounter any issues with this please open a new issue with an example :)