CRM-20821 - Use smarter logic to adjust img URL
authorSean Madsen <sean@seanmadsen.com>
Fri, 21 Jul 2017 16:53:16 +0000 (10:53 -0600)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Mon, 24 Jul 2017 12:04:00 +0000 (17:34 +0530)
commit6c094ca6503eaf7f88650101f850a36bb1749cb2
tree93da71abd6217106c771d812778fb9ca76cbd5f3
parentaa4ad33a7ab27bfa3ab8c88b824ed0d4cff4375f
CRM-20821 - Use smarter logic to adjust img URL

This change is the crux of CRM-20821.

Before this change, editing a premium product would automatically
break the image URL. After this change, premium products can be edited
while retaining the image URL. Functionality is preserved which changes
the URL to a local URL when possible.

This commit adds two new Utils functions (along with tests) to handle
the logic of changing a supplied URL to a local URL.
CRM/Contribute/BAO/ManagePremiums.php
CRM/Utils/String.php
tests/phpunit/CRM/Utils/StringTest.php