Permalink
Browse files

Fix 323 (#332)

* Update conv.php

* psr2
  • Loading branch information...
remrem committed Oct 15, 2017
1 parent 3eaec86 commit 0e7bf847b5b745c5555f7107a3d7f4a946e1619d
Showing with 5 additions and 2 deletions.
  1. +5 −2 inc/conv.php
View
@@ -128,8 +128,11 @@ function markup_clean_href($matches)
// var_dump($matches);
$allowed = array('http://', 'https://', 'ftp://');
// if not a valid url, return the string
if (!filter_var($matches['2'], FILTER_VALIDATE_URL)
|| !preg_match('#^('.join('|', $allowed).')#i', $matches['2'])
if ((
!filter_var($matches['2'], FILTER_VALIDATE_URL)
|| !preg_match('#^('.join('|', $allowed).')#i', $matches['2'])
)
&& !preg_match('/^#[\w-_]+$/i', $matches['2']) // allowing [text|#look-at_this]
) {
return $matches['0'];
}

0 comments on commit 0e7bf84

Please sign in to comment.