Created
September 21, 2016 02:50
-
-
Save anonymous/1ac153e1fcf780e00a99d83a1da9bd0b to your computer and use it in GitHub Desktop.
demo for bountify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$content = preg_replace_callback("/\<img.+src=[\"|\'](?!https?:\/\/)([^\/].+?)[\"|\']/", | |
function($matches) { | |
$match = $matches[0]; | |
$capturedImgPath = $matches[1]; | |
$fixedImgPath = '/content/'.$this->path.'/images/'.$capturedImgPath; | |
return str_replace($capturedImgPath, $fixedImgPath, $match); | |
}, $content); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment