aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Channel.php8
-rw-r--r--include/bbcode.php2
-rw-r--r--include/markdown.php2
-rw-r--r--include/network.php93
-rw-r--r--include/text.php2
-rwxr-xr-xutil/addons15
-rw-r--r--view/theme/redbasic/css/style.css6
-rw-r--r--view/theme/redbasic/schema/dark.css41
8 files changed, 51 insertions, 118 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 12d87885f..5fdefd805 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -124,6 +124,11 @@ class Channel extends Controller {
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
+ if(strpos($mid,'b64.') === 0)
+ $decoded = @base64url_decode(substr($mid,4));
+ if($decoded)
+ $mid = $decoded;
+
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
@@ -375,6 +380,9 @@ class Channel extends Controller {
if((! $update) && (! $load)) {
+ if($decoded)
+ $mid = 'b64.' . base64url_encode($mid);
+
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
// because browser prefetching might change it on us. We have to deliver it with the page.
diff --git a/include/bbcode.php b/include/bbcode.php
index c5d6ef998..817986da0 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1021,7 +1021,7 @@ function bbcode($Text, $options = []) {
}
// Check for colored text
if (strpos($Text,'[/hl]') !== false) {
- $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "<span style=\"background-color: yellow;\">$1</span>", $Text);
+ $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "<span class=\"default-highlight\">$1</span>", $Text);
$Text = preg_replace("(\[hl=(.*?)\](.*?)\[\/hl\])ism", "<span style=\"background-color: $1;\">$2</span>", $Text);
}
diff --git a/include/markdown.php b/include/markdown.php
index 64f0a0854..2513a7d77 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -91,8 +91,6 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) {
// remove duplicate adjacent code tags
$s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);
- // Don't show link to full picture (until it is fixed)
- $s = scale_external_images($s, false);
/**
* @hooks markdown_to_bb
diff --git a/include/network.php b/include/network.php
index df59a30e6..65770221f 100644
--- a/include/network.php
+++ b/include/network.php
@@ -710,99 +710,6 @@ function sxml2array ( $xmlObject, $out = array () )
/**
- * @brief Scales an external image.
- *
- * @param string $s
- * @param string $include_link default true
- * @param string $scale_replace default false
- * @return string
- */
-function scale_external_images($s, $include_link = true, $scale_replace = false) {
-
- // Picture addresses can contain special characters
- $s = htmlspecialchars_decode($s, ENT_COMPAT);
-
- $matches = null;
- $c = preg_match_all('/\[([zi])mg(.*?)\](.*?)\[\/[zi]mg\]/ism', $s, $matches, PREG_SET_ORDER);
- if($c) {
- require_once('include/photo/photo_driver.php');
-
- foreach($matches as $mtch) {
- logger('data: ' . $mtch[2] . ' ' . $mtch[3]);
-
- if(substr($mtch[2],0,1) == '=') {
- $owidth = intval(substr($mtch[2],1));
- if($owidth > 0 && $owidth < 1024)
- continue;
- }
-
- $hostname = str_replace('www.','',substr(z_root(),strpos(z_root(),'://')+3));
- if(stristr($mtch[3],$hostname))
- continue;
-
- // $scale_replace, if passed, is an array of two elements. The
- // first is the name of the full-size image. The second is the
- // name of a remote, scaled-down version of the full size image.
- // This allows Friendica to display the smaller remote image if
- // one exists, while still linking to the full-size image
- if($scale_replace)
- $scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[3]);
- else
- $scaled = $mtch[3];
-
- if(! strpbrk(substr($scaled, 0, 1), 'zhfmt'))
- continue;
-
- $i = z_fetch_url($scaled, true);
-
- $cache = get_config('system', 'itemcache');
- if (($cache != '') and is_dir($cache)) {
- $cachefile = $cache . '/' . hash('md5', $scaled);
- file_put_contents($cachefile, $i['body']);
- }
-
- // guess mimetype from headers or filename
-
- $type = guess_image_type($mtch[3], $i['header']);
- if(strpos($type, 'image') === false)
- continue;
-
- if($i['success']) {
- $ph = photo_factory($i['body'], $type);
-
- if(! is_object($ph))
- continue;
-
- if($ph->is_valid()) {
- $orig_width = $ph->getWidth();
- $orig_height = $ph->getHeight();
-
- if($orig_width > 1024 || $orig_height > 1024) {
- $tag = (($match[1] == 'z') ? 'zmg' : 'img');
- $linktag = (($match[1] == 'z') ? 'zrl' : 'url');
- $ph->scaleImage(1024);
- $new_width = $ph->getWidth();
- $new_height = $ph->getHeight();
- logger('data: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG);
- $s = str_replace($mtch[0],'[' . $tag . '=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/' . $tag . ']'
- . "\n" . (($include_link)
- ? '[' . $linktag . '=' . $mtch[3] . ']' . t('view full size') . '[/' . $linktag . ']' . "\n"
- : ''),$s);
- logger('new string: ' . $s, LOGGER_DEBUG);
- }
- }
- }
- }
- }
-
- // replace the special char encoding
-
- $s = htmlspecialchars($s, ENT_COMPAT, 'UTF-8');
-
- return $s;
-}
-
-/**
* @brief xml2array() will convert the given XML text to an array in the XML structure.
*
* Link: http://www.bin-co.com/php/scripts/xml2array/
diff --git a/include/text.php b/include/text.php
index bd0d8048d..3cc21e4ce 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3305,8 +3305,6 @@ function cleanup_bbcode($body) {
$body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body);
- $body = scale_external_images($body, false);
-
return $body;
}
diff --git a/util/addons b/util/addons
index 3d772bf73..7bd70984e 100755
--- a/util/addons
+++ b/util/addons
@@ -10,6 +10,7 @@ echo <<< EOT
util/addons list all # list all addons (*)= installed, (!)= disabled due to version compatibility
util/addons install foo # install addon named 'foo'
util/addons uninstall foo # uninstall addon named 'foo'
+ util/addons reinstall # reinstall all plugins
EOT;
}
@@ -68,6 +69,20 @@ if($argc == 2 && $argv[1] === 'list') {
killme();
}
+if($argc == 2 && $argv[1] === 'reinstall') {
+ require_once("include/plugin.php");
+ if($plugins) {
+ foreach($plugins as $p) {
+ if($p[1]) {
+ echo "Reinstall: ". $p[0] . "\n";
+ uninstall_plugin($p[0]);
+ install_plugin($p[0]);
+ }
+ }
+ }
+ killme();
+}
+
if($argc == 3 && $argv[1] === 'list' && $argv[2] === 'all') {
if($plugins) {
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index f2c1b7a48..b406e710c 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -1803,3 +1803,9 @@ dl.bb-dl > dd > li {
.hover-fx-show:hover .hover-fx-hide {
opacity: 1;
}
+
+/* default highlighted text if not specified by schema: */
+span.default-highlight {
+ background-color: yellow;
+ padding: 2px 4px;
+}
diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css
index e958d9ee7..bf55fec72 100644
--- a/view/theme/redbasic/schema/dark.css
+++ b/view/theme/redbasic/schema/dark.css
@@ -322,20 +322,6 @@ a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link {
.text-dark {
color: #aaa !important;
}
-a.text-dark:focus, a.text-dark:hover {
- color: #ddd !important;
-}
-
-.badge-warning {
- background-color: #ffc927;
-}
-.badge-warning a.text-dark {
- color: #333 !important;
-}
-.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover {
- color: red !important;
- text-decoration: none;
-}
.group-selected, .fileas-selected, .categories-selected, .search-selected, a.active {
color: #fff !important;
@@ -492,10 +478,25 @@ pre {
background-color: #222;
}
-/* change color of [hl] tag: */
-div.wall-item-body span /*strong:only-of-type */{
- color: #1212b6;
- padding: 2px 3px;
-/* font-weight: 500; */
- white-space: nowrap;
+
+/* category badge fix: */
+a.text-dark:focus, a.text-dark:hover {
+ color: #ddd !important;
+}
+
+.badge-warning {
+/* background-color: #ffc927; */
+}
+.badge-warning a.text-dark {
+ color: #333 !important;
+}
+.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover {
+ color: red !important;
+ text-decoration: none;
+}
+
+/* fix color for highlithed text */
+span.default-highlight {
+ color: #333;
+ border-radius: 4px;
}