CSSMin: Rewrite encodeImageAsDataURI()
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 7 Nov 2014 19:21:58 +0000 (20:21 +0100)
committerOri.livneh <ori@wikimedia.org>
Sun, 16 Nov 2014 18:06:35 +0000 (18:06 +0000)
commit6e82fe64176a0c93ce816477fe73dad6a10b4a01
tree8a45f3ef021fa7cf86381a28ca0eae72ea9218ea
parent399ba2fecfe098b45b2064380eadcac0b24b9a4a
CSSMin: Rewrite encodeImageAsDataURI()

* Make it actually check against the URI length, not file size.
  Previous code could produce URIs that edged just over the limit.
* Replace $sizeLimit parameter with $ie8Compat, because that's the
  only use case and the file size limit approach was flawed per above,
  anyway.
* Remove CSSMin::EMBED_SIZE_LIMIT constant, which is not used anymore.
  CSSMin::DATA_URI_SIZE_LIMIT still exists.
* Change code flow to avoid repetition.
* Split off new method, encodeStringAsDataURI(), that does actual
  encoding rather than file handling.

Change-Id: I3704404ce831d7e0f6e3a65f23c76f313ad13238
includes/libs/CSSMin.php