aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-12-21 13:36:58 -0800
committerzotlabs <mike@macgirvin.com>2017-12-21 13:36:58 -0800
commitf825e27f1af71ba873f5698cad433bc017760556 (patch)
tree6c0c55b71f1cdb6abdbe4157a43d3af3281b9560 /include
parentc087d1e18b32f62d126cb01accbdeff21f5c1107 (diff)
parent9c72963d7ce3c60709755edb5d40cb0b06b29cda (diff)
downloadvolse-hubzilla-f825e27f1af71ba873f5698cad433bc017760556.tar.gz
volse-hubzilla-f825e27f1af71ba873f5698cad433bc017760556.tar.bz2
volse-hubzilla-f825e27f1af71ba873f5698cad433bc017760556.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php7
-rw-r--r--include/feedutils.php2
-rw-r--r--include/html2bbcode.php12
-rw-r--r--include/message.php2
4 files changed, 15 insertions, 8 deletions
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",'<h1>$1</h1>',$Text);
+ $Text = str_replace('</h1><br />', '</h1>', $Text);
}
// Check for h2
if (strpos($Text,'[h2]') !== false) {
$Text = preg_replace("(\[h2\](.*?)\[\/h2\])ism",'<h2>$1</h2>',$Text);
+ $Text = str_replace('</h2><br />', '</h2>', $Text);
}
// Check for h3
if (strpos($Text,'[h3]') !== false) {
$Text = preg_replace("(\[h3\](.*?)\[\/h3\])ism",'<h3>$1</h3>',$Text);
+ $Text = str_replace('</h3><br />', '</h3>', $Text);
}
// Check for h4
if (strpos($Text,'[h4]') !== false) {
$Text = preg_replace("(\[h4\](.*?)\[\/h4\])ism",'<h4>$1</h4>',$Text);
+ $Text = str_replace('</h4><br />', '</h4>', $Text);
}
// Check for h5
if (strpos($Text,'[h5]') !== false) {
$Text = preg_replace("(\[h5\](.*?)\[\/h5\])ism",'<h5>$1</h5>',$Text);
+ $Text = str_replace('</h5><br />', '</h5>', $Text);
}
// Check for h6
if (strpos($Text,'[h6]') !== false) {
$Text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'<h6>$1</h6>',$Text);
+ $Text = str_replace('</h6><br />', '</h6>', $Text);
}
+
// Check for table of content without params
while(strpos($Text,'[toc]') !== false) {
$toc_id = 'toc-' . random_string(10);
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'];
}
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]');
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;