]> git.mxchange.org Git - friendica.git/blobdiff - mod/parse_url.php
don't allow blocked/unverified users to reset their password.
[friendica.git] / mod / parse_url.php
index 1561eb8a3ba143d1cf992845b092d7e14d20ea88..15a6aced0e0fda8fcff6d765c17aea3cf94baa00 100644 (file)
@@ -2,22 +2,36 @@
 
 require_once('library/HTML5/Parser.php');
 
-
 function parse_url_content(&$a) {
 
-       $url = trim($_GET['url']);
+       logger('parse_url: ' . $_GET['url']);
+
+       $url = trim(hex2bin($_GET['url']));
+
+       logger('parse_url: ' . $url);
 
        $text = null;
 
-       $template = "<a href=\"%s\" >%s</a>%s";
+       $template = "<a href=\"%s\" >%s</a>\n%s";
+
+
+       $arr = array('url' => $url, 'text' => '');
+
+       call_hooks('parse_link', $arr);
 
-       if($url) 
+       if(strlen($arr['text'])) {
+               echo $arr['text'];
+               killme();
+       }
+
+       if($url) {
                $s = fetch_url($url);
-       else {
+       else {
                echo '';
                killme();
        }
 
+
        if(! $s) {
                echo sprintf($template,$url,$url,'');
                killme();
@@ -46,6 +60,8 @@ function parse_url_content(&$a) {
                                $items = $div->getElementsByTagName('p');
                                if($items) {
                                        foreach($items as $item) {
+                                               if($item->getElementsByTagName('script'))
+                                                       continue;
                                                $text = $item->textContent;
                                                $text = strip_tags($text);
                                                if(strlen($text) < 100)
@@ -62,6 +78,8 @@ function parse_url_content(&$a) {
                $items = $dom->getElementsByTagName('p');
                if($items) {
                        foreach($items as $item) {
+                               if($item->getElementsByTagName('script'))
+                                       continue;
                                $text = $item->textContent;
                                $text = strip_tags($text);
                                if(strlen($text) < 100)
@@ -78,4 +96,4 @@ function parse_url_content(&$a) {
 
        echo sprintf($template,$url,$title,$text);
        killme();
-}
\ No newline at end of file
+}