Commit c73af96d authored by Max Kostikov's avatar Max Kostikov

Merge branch 'dev' into 'dev'

Minor addons fixes

See merge request hubzilla/addons!279
parents 3d2c7199 20aa814f
......@@ -138,7 +138,7 @@ function photocache_hash($str, $alg = 'sha256') {
return logger('invalid channel ID received ' . $s['uid'], LOGGER_DEBUG);
$matches = null;
$cnt = preg_match_all("/\<img(.+?)src=([\"|'])(https?\:.*?)\\2(.*?)\>/", $s['body'], $matches, PREG_SET_ORDER);
$cnt = preg_match_all("/\<img(.+?)src=([\"'])(https?\:.*?)\\2(.*?)\>/", $s['body'], $matches, PREG_SET_ORDER);
if($cnt) {
$ph = photo_factory('');
foreach ($matches as $match) {
......
......@@ -179,7 +179,7 @@ function twitter_short_message(&$msg, $link, $limit, $shortlink = true) {
if (strlen($msg . " " . $link) > $limit) {
$msg = substr($msg, 0, ($limit - strlen($link)));
if (substr($msg, -1) != "\n")
$msg = rtrim(substr($msg, 0, strrpos($msg, " ")), "?.,:;!-)") . "...";
$msg = rtrim(substr($msg, 0, strrpos($msg, " ")), "?.,:;!-") . "...";
}
$msg .= " " . $link;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment