From d30482197781eb8e68443e78b9f8d8727815a39a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 16 Dec 2017 20:30:42 +0100 Subject: fix undefined constant warning --- include/feedutils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/feedutils.php b/include/feedutils.php index 8f2c5d988..4638ef66a 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -1305,7 +1305,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { // allow likes of comments - if($item_parent_mid && activity_match($datarray['verb'],ACTVITY_LIKE)) { + if($item_parent_mid && activity_match($datarray['verb'],ACTIVITY_LIKE)) { $datarray['thr_parent'] = $item_parent_mid[0]['parent_mid']; } -- cgit v1.2.3 From 7181cf901242c75fed84920817466aff650b6848 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 16 Dec 2017 20:33:07 +0100 Subject: silence PHP7.2 warning --- include/message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/message.php b/include/message.php index b57d2e068..4a673b961 100644 --- a/include/message.php +++ b/include/message.php @@ -215,7 +215,7 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep return $ret; } - if(count($images)) { + if($images) { foreach($images as $image) { if(! stristr($image,z_root() . '/photo/')) continue; -- cgit v1.2.3 From 73766caa81b2cf2604f5343c41df0a33da8795f8 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 20 Dec 2017 11:11:18 +0100 Subject: html2bbcode: use headings bbcode for headings --- include/html2bbcode.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/html2bbcode.php b/include/html2bbcode.php index d7fbd8660..f67231847 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -196,12 +196,12 @@ function html2bbcode($message) //node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]"); //node2bbcode($doc, 'td', array(), "[td]", "[/td]"); - node2bbcode($doc, 'h1', array(), "\n\n[size=xx-large][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h2', array(), "\n\n[size=x-large][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h3', array(), "\n\n[size=large][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h4', array(), "\n\n[size=medium][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h5', array(), "\n\n[size=small][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h6', array(), "\n\n[size=x-small][b]", "[/b][/size]\n"); + node2bbcode($doc, 'h1', array(), "\n\n[h1]", "[/h1]\n"); + node2bbcode($doc, 'h2', array(), "\n\n[h2]", "[/h2]\n"); + node2bbcode($doc, 'h3', array(), "\n\n[h3]", "[/h3]\n"); + node2bbcode($doc, 'h4', array(), "\n\n[h4]", "[/h4]\n"); + node2bbcode($doc, 'h5', array(), "\n\n[h5]", "[/h5]\n"); + node2bbcode($doc, 'h6', array(), "\n\n[h6]", "[/h6]\n"); node2bbcode($doc, 'a', array('href'=>'/(.+)/'), '[url=$1]', '[/url]'); -- cgit v1.2.3 From 64fe15b6f5813ba860034f583f8014f63951931d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 21 Dec 2017 09:07:37 +0100 Subject: remove additional linebreaks after headings --- include/bbcode.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/bbcode.php b/include/bbcode.php index ed34bc5d6..775a91f9a 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -941,27 +941,34 @@ function bbcode($Text, $options = []) { // Check for h1 if (strpos($Text,'[h1]') !== false) { $Text = preg_replace("(\[h1\](.*?)\[\/h1\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h2 if (strpos($Text,'[h2]') !== false) { $Text = preg_replace("(\[h2\](.*?)\[\/h2\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h3 if (strpos($Text,'[h3]') !== false) { $Text = preg_replace("(\[h3\](.*?)\[\/h3\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h4 if (strpos($Text,'[h4]') !== false) { $Text = preg_replace("(\[h4\](.*?)\[\/h4\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h5 if (strpos($Text,'[h5]') !== false) { $Text = preg_replace("(\[h5\](.*?)\[\/h5\])ism",'
$1
',$Text); + $Text = str_replace('
', '', $Text); } // Check for h6 if (strpos($Text,'[h6]') !== false) { $Text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'
$1
',$Text); + $Text = str_replace('
', '', $Text); } + // Check for table of content without params while(strpos($Text,'[toc]') !== false) { $toc_id = 'toc-' . random_string(10); -- cgit v1.2.3