X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fparse_url.php;h=a238ecb2f915cabb071787f3e0156867611c7a27;hb=906addf865ccab2c98d5035fc6c1b10d43004dfe;hp=b10d11c4bdc44ca686229f64a59bc6a20ad19940;hpb=1d01b3a088aaaaf47844544b76b55f76f7f31182;p=friendica.git
diff --git a/mod/parse_url.php b/mod/parse_url.php
index b10d11c4bd..a238ecb2f9 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -3,17 +3,38 @@
require_once('library/HTML5/Parser.php');
require_once('library/HTMLPurifier.auto.php');
+function arr_add_hashes(&$item,$k) {
+ $item = '#' . $item;
+}
+
function parse_url_content(&$a) {
- logger('parse_url: ' . $_GET['url']);
+ $text = null;
+ $str_tags = '';
+
+ if(x($_GET,'binurl'))
+ $url = trim(hex2bin($_GET['binurl']));
+ else
+ $url = trim($_GET['url']);
- $url = trim(hex2bin($_GET['url']));
+ if($_GET['title'])
+ $title = strip_tags(trim($_GET['title']));
+
+ if($_GET['description'])
+ $text = strip_tags(trim($_GET['description']));
+
+ if($_GET['tags']) {
+ $arr_tags = str_getcsv($_GET['tags']);
+ if(count($arr_tags)) {
+ array_walk($arr_tags,'arr_add_hashes');
+ $str_tags = '
' . implode(' ',$arr_tags) . '
';
+ }
+ }
logger('parse_url: ' . $url);
- $text = null;
- $template = "
%s%s
";
+ $template = "
%s%s
";
$arr = array('url' => $url, 'text' => '');
@@ -25,6 +46,20 @@ function parse_url_content(&$a) {
killme();
}
+ if($url && $title && $text) {
+
+ $text = '
' . $text . '