Created
September 25, 2015 11:32
-
-
Save shmaltorhbooks/0ba552c2e4909950339d to your computer and use it in GitHub Desktop.
Convert relative links to absolute path in href/src attributes
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
preg_replace('/((?:href|src) *= *[\'"](?!(\/\/|#|http|ftp)))/i', '$1' . $this->url, $value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment