Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function _findWebmentionEndpointInHTML($body) {
- if(preg_match('/<link[ ]+href="([^"]+)"[ ]+rel="(?:webmention ?|http:\/\/webmention\.org\/? ?)+"[ ]*\/?>/i', $body, $match)
- || preg_match('/<link[ ]+rel="(?:webmention ?|http:\/\/webmention\.org\/? ?)+"[ ]+href="([^"]+)"[ ]*\/?>/i', $body, $match)) {
- return $match[1];
- } else {
- return false;
- }
- }
- OR
- public function _findWebmentionEndpointInHTML($body) {
- if(preg_match('/<link[ ]+href="([^"]+)"[ ]+rel=".*?webmention.*?"[ ]*\/?>/i', $body, $match)
- || preg_match('/<link[ ]+rel=".*?webmention.*?"[ ]+href="([^"]+)"[ ]*\/?>/i', $body, $match)) {
- return $match[1];
- } else {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement