From e411a4bdc27cd443abf613a0044effb4604223f0 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 14 Apr 2013 20:41:58 -0700 Subject: IMPORTANT: magic-auth protocol update, plus 'zrl' bbcode tag for the privacy-is-more-important-than-ease-of-use folks. --- include/bbcode.php | 15 +++++++++------ include/text.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/bbcode.php b/include/bbcode.php index 82d25ffc8..930337c5d 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -263,21 +263,24 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // Perform URL Search - $Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1$2', $Text); + $urlchars = '[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]'; - if ($tryoembed) - $Text = preg_replace_callback("/\[bookmark\=([^\]]*)\].*?\[\/bookmark\]/ism",'tryoembed',$Text); - $Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism",'[url=$1]$2[/url]',$Text); + $Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/$urlchars+)/ism", '$1$2', $Text); + +// $Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/$urlchars+)\{zid\}($urlchars*)/ism", '$1$2$3', $Text); $Text = preg_replace_callback("/\[share(.*?)\](.*?)\[\/share\]/ism","bb_ShareAttributes",$Text); - if ($tryoembed) + if($tryoembed) $Text = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism",'tryoembed',$Text); $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/ism", '$1', $Text); $Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$2', $Text); - //$Text = preg_replace("/\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[\/url\]/ism", '$2', $Text); + + + $Text = preg_replace("/\[zrl\]([$URLSearchString]*)\[\/zrl\]/ism", '$1', $Text); + $Text = preg_replace("/\[zrl\=([$URLSearchString]*)\](.*?)\[\/zrl\]/ism", '$2', $Text); // Perform MAIL Search $Text = preg_replace("/\[mail\]([$MAILSearchString]*)\[\/mail\]/", '$1', $Text); diff --git a/include/text.php b/include/text.php index a8d91fade..f0251494d 100644 --- a/include/text.php +++ b/include/text.php @@ -1108,6 +1108,7 @@ function prepare_text($text,$content_type = 'text/bbcode') { $s = bbcode($text); else $s = smilies(bbcode($text)); + $s = zidify_links($s); break; } @@ -1115,6 +1116,34 @@ function prepare_text($text,$content_type = 'text/bbcode') { } +/** + * zidify_callback() and zidify_links() work together to turn any HTML a tags with class="zrl" into zid links + * These will typically be generated by a bbcode '[zrl]' tag. This is done inside prepare_text() rather than bbcode() + * because the latter is used for general purpose conversions and the former is used only when preparing text for + * immediate display. + * + * Issues: Currently the order of HTML parameters in the text is somewhat rigid and inflexible. + * We assume it looks like and will not work if zrl and href appear in a different order. + */ + + +function zidify_callback($match) { + $replace = ' Date: Sun, 14 Apr 2013 22:24:47 -0700 Subject: begin to cut the umbilical --- include/api.php | 8 ++++---- include/enotify.php | 2 +- include/identity.php | 2 +- include/items.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/api.php b/include/api.php index 3f01b90af..91c5b419e 100644 --- a/include/api.php +++ b/include/api.php @@ -1541,8 +1541,8 @@ require_once('include/security.php'); 'private' => $private, 'textlimit' => $textlimit, 'sslserver' => $sslserver, 'ssl' => $ssl, 'shorturllength' => '30', 'friendica' => array( - 'FRIENDICA_PLATFORM' => FRIENDICA_PLATFORM, - 'FRIENDICA_VERSION' => FRIENDICA_VERSION, + 'RED_PLATFORM' => RED_PLATFORM, + 'RED_VERSION' => RED_VERSION, 'ZOT_REVISION' => ZOT_REVISION, 'DB_UPDATE_VERSION' => DB_UPDATE_VERSION ) @@ -1577,12 +1577,12 @@ require_once('include/security.php'); if($type === 'xml') { header("Content-type: application/xml"); - echo '' . "\r\n" . '' . FRIENDICA_VERSION . '' . "\r\n"; + echo '' . "\r\n" . '' . RED_VERSION . '' . "\r\n"; killme(); } elseif($type === 'json') { header("Content-type: application/json"); - echo '"' . FRIENDICA_VERSION . '"'; + echo '"' . RED_VERSION . '"'; killme(); } } diff --git a/include/enotify.php b/include/enotify.php index c24c15188..f789d9bf1 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -34,7 +34,7 @@ function notification($params) { push_lang($recip['account_language']); // should probably have a channel language $banner = t('Red Notification'); - $product = FRIENDICA_PLATFORM; + $product = RED_PLATFORM; $siteurl = $a->get_baseurl(true); $thanks = t('Thank You,'); $sitename = get_config('system','sitename'); diff --git a/include/identity.php b/include/identity.php index 2b7085e85..c8910c018 100644 --- a/include/identity.php +++ b/include/identity.php @@ -257,7 +257,7 @@ function identity_basic_export($channel_id) { $ret = array(); - $ret['compatibility'] = array('project' => FRIENDICA_PLATFORM, 'version' => FRIENDICA_VERSION, 'database' => DB_UPDATE_VERSION); + $ret['compatibility'] = array('project' => RED_PLATFORM, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION); $r = q("select * from channel where channel_id = %d limit 1", intval($channel_id) diff --git a/include/items.php b/include/items.php index 27213b9d2..db00118bc 100755 --- a/include/items.php +++ b/include/items.php @@ -299,7 +299,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) $salmon = feed_salmonlinks($owner_nick); $atom .= replace_macros($feed_template, array( - '$version' => xmlify(FRIENDICA_VERSION), + '$version' => xmlify(RED_VERSION), '$feed_id' => xmlify($a->get_baseurl() . '/channel/' . $owner_nick), '$feed_title' => xmlify($owner['name']), '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now' , ATOM_TIME)) , -- cgit v1.2.3 From 53c69a17c53724f7316173a5aef41edc80acdf9e Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 14 Apr 2013 22:28:45 -0700 Subject: more cleanup --- include/api.php | 2 +- include/nav.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/api.php b/include/api.php index 91c5b419e..bf865a360 100644 --- a/include/api.php +++ b/include/api.php @@ -1524,7 +1524,7 @@ require_once('include/security.php'); $name = get_config('system','sitename'); $server = $a->get_hostname(); - $logo = $a->get_baseurl() . '/images/fred-64.png'; + $logo = $a->get_baseurl() . '/images/r!.png'; $email = get_config('system','admin_email'); $closed = ((get_config('system','register_policy') == REGISTER_CLOSED) ? 'true' : 'false'); $private = ((get_config('system','block_public')) ? 'true' : 'false'); diff --git a/include/nav.php b/include/nav.php index 5e5243f67..049009ad3 100644 --- a/include/nav.php +++ b/include/nav.php @@ -192,7 +192,6 @@ EOT; $banner = get_config('system','banner'); if($banner === false) -// $banner .= 'logo'; $banner = 'red'; $tpl = get_markup_template('nav.tpl'); -- cgit v1.2.3 From ab5151c470e630aa3864bbed927dd02f7b192166 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 14 Apr 2013 22:44:11 -0700 Subject: more Friendica removals --- include/bbcode.php | 2 +- include/network.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/bbcode.php b/include/bbcode.php index 930337c5d..44bde9acb 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -199,7 +199,7 @@ function bb_ShareAttributesSimple($match) { } // BBcode 2 HTML was written by WAY2WEB.net - // extended to work with Mistpark/Friendica - Mike Macgirvin + // extended to work with Mistpark/Friendica/Red - Mike Macgirvin function bbcode($Text,$preserve_nl = false, $tryoembed = true) { diff --git a/include/network.php b/include/network.php index 427519c7a..ed73b00bf 100644 --- a/include/network.php +++ b/include/network.php @@ -38,8 +38,7 @@ function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0, $accept_ } @curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); - //@curl_setopt($ch, CURLOPT_USERAGENT, "Friendica"); - @curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Friendica)"); + @curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Red)"); if(intval($timeout)) { @@ -124,7 +123,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0) curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS,$params); - curl_setopt($ch, CURLOPT_USERAGENT, "Friendica"); + curl_setopt($ch, CURLOPT_USERAGENT, "Red"); if(intval($timeout)) { curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); @@ -240,7 +239,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_CAINFO, get_capath()); @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); @curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); - @curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Friendica Red)"); + @curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Red)"); if (x($opts,'accept_content')){ curl_setopt($ch,CURLOPT_HTTPHEADER, array ( @@ -335,7 +334,7 @@ function z_post_url($url,$params, $headers = null, $redirects = 0, $timeout = 0) curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS,$params); - curl_setopt($ch, CURLOPT_USERAGENT, "Friendica"); + curl_setopt($ch, CURLOPT_USERAGENT, "Red"); if(intval($timeout)) { curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); -- cgit v1.2.3 From 7e6890832b15d8417cb812cbaa00d3ed8c954ef0 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 15 Apr 2013 03:00:08 -0700 Subject: turn all Red links into zrls (not the old zrls, the new bbcode zrl which means we can zidify them) --- include/api.php | 2 +- include/enotify.php | 38 +++++++++++++++++++------------------- include/items.php | 12 ++++++------ include/network.php | 2 +- include/photos.php | 8 ++++---- include/plugin.php | 2 +- include/text.php | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/api.php b/include/api.php index bf865a360..ca43abcce 100644 --- a/include/api.php +++ b/include/api.php @@ -991,7 +991,7 @@ require_once('include/security.php'); if(perm_is_allowed($r[0]['uid'],$observer['xchan_hash'],'view_stream')) { if ($r[0]['body'] != "") { - $_REQUEST['body'] = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body']; + $_REQUEST['body'] = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8')."[zrl=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/zrl] \n".$r[0]['body']; $_REQUEST['profile_uid'] = api_user(); $_REQUEST['type'] = 'wall'; $_REQUEST['api_source'] = true; diff --git a/include/enotify.php b/include/enotify.php index f789d9bf1..b742b17f4 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -66,7 +66,7 @@ function notification($params) { $subject = sprintf( t('[Red:Notify] New mail received at %s'),$sitename); $preamble = sprintf( t('%1$s sent you a new private message at %2$s.'),$sender['xchan_name'],$sitename); - $epreamble = sprintf( t('%1$s sent you %2$s.'),'[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]', '[url=$itemlink]' . t('a private message') . '[/url]'); + $epreamble = sprintf( t('%1$s sent you %2$s.'),'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', '[zrl=$itemlink]' . t('a private message') . '[/zrl]'); $sitelink = t('Please visit %s to view and/or reply to your private messages.'); $tsitelink = sprintf( $sitelink, $siteurl . '/message/' . $params['item']['id'] ); $hsitelink = sprintf( $sitelink, '' . $sitename . ''); @@ -111,23 +111,23 @@ function notification($params) { //$possess_desc = str_replace('',$possess_desc); // "a post" - $dest_str = sprintf(t('%1$s commented on [url=%2$s]a %3$s[/url]'), + $dest_str = sprintf(t('%1$s commented on [zrl=%2$s]a %3$s[/zrl]'), '[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]', $itemlink, $item_post_type); // "George Bull's post" if($p) - $dest_str = sprintf(t('%1$s commented on [url=%2$s]%3$s\'s %4$s[/url]'), - '[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]', + $dest_str = sprintf(t('%1$s commented on [zrl=%2$s]%3$s\'s %4$s[/zrl]'), + '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', $itemlink, $p[0]['author']['xchan_name'], $item_post_type); // "your post" if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && ($p[0]['item_flags'] & ITEM_WALL)) - $dest_str = sprintf(t('%1$s commented on [url=%2$s]your %3$s[/url]'), - '[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]', + $dest_str = sprintf(t('%1$s commented on [zrl=%2$s]your %3$s[/zrl]'), + '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', $itemlink, $item_post_type); @@ -151,8 +151,8 @@ function notification($params) { $preamble = sprintf( t('%1$s posted to your profile wall at %2$s') , $sender['xchan_name'], $sitename); - $epreamble = sprintf( t('%1$s posted to [url=%2$s]your wall[/url]') , - '[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]', + $epreamble = sprintf( t('%1$s posted to [zrl=%2$s]your wall[/zrl]') , + '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', $params['link']); $sitelink = t('Please visit %s to view and/or reply to the conversation.'); @@ -164,8 +164,8 @@ function notification($params) { if($params['type'] == NOTIFY_TAGSELF) { $subject = sprintf( t('[Red:Notify] %s tagged you') , $sender['xchan_name']); $preamble = sprintf( t('%1$s tagged you at %2$s') , $sender['xchan_name'], $sitename); - $epreamble = sprintf( t('%1$s [url=%2$s]tagged you[/url].') , - '[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]', + $epreamble = sprintf( t('%1$s [zrl=%2$s]tagged you[/zrl].') , + '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', $params['link']); $sitelink = t('Please visit %s to view and/or reply to the conversation.'); @@ -178,8 +178,8 @@ function notification($params) { $subject = sprintf( t('[Red:Notify] %1$s poked you') , $sender['xchan_name']); $preamble = sprintf( t('%1$s poked you at %2$s') , $sender['xchan_name'], $sitename); - $epreamble = sprintf( t('%1$s [url=%2$s]poked you[/url].') , - '[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]', + $epreamble = sprintf( t('%1$s [zrl=%2$s]poked you[/zrl].') , + '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', $params['link']); $subject = str_replace('poked', t($params['activity']), $subject); @@ -195,8 +195,8 @@ function notification($params) { if($params['type'] == NOTIFY_TAGSHARE) { $subject = sprintf( t('[Red:Notify] %s tagged your post') , $sender['xchan_name']); $preamble = sprintf( t('%1$s tagged your post at %2$s') , $sender['xchan_name'], $sitename); - $epreamble = sprintf( t('%1$s tagged [url=%2$s]your post[/url]') , - '[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]', + $epreamble = sprintf( t('%1$s tagged [zrl=%2$s]your post[/zrl]') , + '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', $itemlink); $sitelink = t('Please visit %s to view and/or reply to the conversation.'); @@ -208,9 +208,9 @@ function notification($params) { if($params['type'] == NOTIFY_INTRO) { $subject = sprintf( t('[Red:Notify] Introduction received')); $preamble = sprintf( t('You\'ve received an introduction from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename); - $epreamble = sprintf( t('You\'ve received [url=%1$s]an introduction[/url] from %2$s.'), + $epreamble = sprintf( t('You\'ve received [zrl=%1$s]an introduction[/zrl] from %2$s.'), $itemlink, - '[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]'); + '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]'); $body = sprintf( t('You may visit their profile at %s'),$sender['xchan_url']); $sitelink = t('Please visit %s to approve or reject the introduction.'); @@ -222,10 +222,10 @@ function notification($params) { if($params['type'] == NOTIFY_SUGGEST) { $subject = sprintf( t('[Red:Notify] Friend suggestion received')); $preamble = sprintf( t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename); - $epreamble = sprintf( t('You\'ve received [url=%1$s]a friend suggestion[/url] for %2$s from %3$s.'), + $epreamble = sprintf( t('You\'ve received [zrl=%1$s]a friend suggestion[/zrl] for %2$s from %3$s.'), $itemlink, - '[url=' . $params['item']['url'] . ']' . $params['item']['name'] . '[/url]', - '[url=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/url]'); + '[zrl=' . $params['item']['url'] . ']' . $params['item']['name'] . '[/zrl]', + '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]'); $body = t('Name:') . ' ' . $params['item']['name'] . "\n"; $body .= t('Photo:') . ' ' . $params['item']['photo'] . "\n"; diff --git a/include/items.php b/include/items.php index db00118bc..034d27256 100755 --- a/include/items.php +++ b/include/items.php @@ -1918,7 +1918,7 @@ function tag_deliver($uid,$item_id) { $body = preg_replace('/\[share(.*?)\[\/share\]/','',$item['body']); - $pattern = '/@\[url\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'],'/') . '\[\/url\]/'; + $pattern = '/@\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'],'/') . '\[\/zrl\]/'; if(! preg_match($pattern,$body,$matches)) { logger('tag_deliver: mention was in a reshare - ignoring'); @@ -2012,7 +2012,7 @@ function tgroup_check($uid,$item) { $body = preg_replace("/\[share\](.*?)\[\/share\]/ism", '', $item['body']); - $cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism',$body,$matches,PREG_SET_ORDER); + $cnt = preg_match_all('/[\@\!]\[zrl\=(.*?)\](.*?)\[\/zrl\]/ism',$body,$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $mtch) { if(link_compare($link,$mtch[1]) || link_compare($dlink,$mtch[1])) { @@ -2504,7 +2504,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) */ $bdtext = sprintf( t('%s\'s birthday'), $contact['name']); - $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' ) ; + $bdtext2 = sprintf( t('Happy Birthday %s'), ' [zrl=' . $contact['url'] . ']' . $contact['name'] . '[/zrl]' ) ; $r = q("INSERT INTO `event` (`uid`,`cid`,`created`,`edited`,`start`,`finish`,`summary`,`desc`,`type`) @@ -2752,7 +2752,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) // extract tag, if not duplicate, add to parent item if($xo->id && $xo->content) { - $newtag = '#[url=' . $xo->id . ']'. $xo->content . '[/url]'; + $newtag = '#[zrl=' . $xo->id . ']'. $xo->content . '[/zrl]'; if(! (stristr($r[0]['tag'],$newtag))) { q("UPDATE item SET tag = '%s' WHERE id = %d LIMIT 1", dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . $newtag), @@ -3535,7 +3535,7 @@ function local_delivery($importer,$data) { // extract tag, if not duplicate, and this user allows tags, add to parent item //FIXME if($xo->id && $xo->content) { - $newtag = '#[url=' . $xo->id . ']'. $xo->content . '[/url]'; + $newtag = '#[zrl=' . $xo->id . ']'. $xo->content . '[/zrl]'; if(! (stristr($tagp[0]['tag'],$newtag))) { $i = q("SELECT `blocktags` FROM `user` where `uid` = %d LIMIT 1", intval($importer['importer_uid']) @@ -3687,7 +3687,7 @@ function local_delivery($importer,$data) { if($xo->content) { if(! (stristr($r[0]['tag'],trim($xo->content)))) { q("UPDATE item SET tag = '%s' WHERE id = %d LIMIT 1", - dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . $xo->id . ']'. $xo->content . '[/url]'), + dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[zrl=' . $xo->id . ']'. $xo->content . '[/zrl]'), intval($r[0]['id']) ); } diff --git a/include/network.php b/include/network.php index ed73b00bf..d3e6480d6 100644 --- a/include/network.php +++ b/include/network.php @@ -1093,7 +1093,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) logger('scale_external_images: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG); $s = str_replace($mtch[0],'[img=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/img]' . "\n" . (($include_link) - ? '[url=' . $mtch[1] . ']' . t('view full size') . '[/url]' . "\n" + ? '[zrl=' . $mtch[1] . ']' . t('view full size') . '[/zrl]' . "\n" : ''),$s); logger('scale_external_images: new string: ' . $s, LOGGER_DEBUG); } diff --git a/include/photos.php b/include/photos.php index e0d1762bb..123cd0659 100644 --- a/include/photos.php +++ b/include/photos.php @@ -208,9 +208,9 @@ function photo_upload($channel, $observer, $args) { $arr['deny_gid'] = $str_group_deny; - $arr['body'] = '[url=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' + $arr['body'] = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . '[img]' . z_root() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/img]' - . '[/url]'; + . '[/zrl]'; $item_id = item_store($arr); @@ -350,9 +350,9 @@ function photos_create_item($channel, $creator_hash, $photo, $visible = false) { $arr['deny_cid'] = $photo['deny_cid']; $arr['deny_gid'] = $photo['deny_gid']; - $arr['body'] = '[url=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' + $arr['body'] = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . '[img]' . z_root() . '/photo/' . $photo['resource_id'] . '-' . $photo['scale'] . '[/img]' - . '[/url]'; + . '[/zrl]'; $item_id = item_store($arr); return $item_id; diff --git a/include/plugin.php b/include/plugin.php index 281488791..c906d5e58 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -397,7 +397,7 @@ function upgrade_link($bbcode = false) { if(! $l) return ''; if($bbcode) - $t = sprintf('[url=%s]' . t('Click here to upgrade.') . '[/url]', $l); + $t = sprintf('[zrl=%s]' . t('Click here to upgrade.') . '[/zrl]', $l); else $t = sprintf('' . t('Click here to upgrade.') . '', $l); return $t; diff --git a/include/text.php b/include/text.php index f0251494d..360a7357f 100644 --- a/include/text.php +++ b/include/text.php @@ -1662,7 +1662,7 @@ function normalise_openid($s) { function undo_post_tagging($s) { $matches = null; - $cnt = preg_match_all('/([@#])\[url=(.*?)\](.*?)\[\/url\]/ism',$s,$matches,PREG_SET_ORDER); + $cnt = preg_match_all('/([@#])\[zrl=(.*?)\](.*?)\[\/zrl\]/ism',$s,$matches,PREG_SET_ORDER); if($cnt) { foreach($matches as $mtch) { $s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s); -- cgit v1.2.3 From 6e2e8f101a930ec39d3a38ee4aeec5ad3b0c8cf7 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 16 Apr 2013 05:52:10 +0100 Subject: Uncripple zids. --- include/features.php | 2 ++ include/text.php | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/features.php b/include/features.php index 14cf891b3..c2aabbc42 100644 --- a/include/features.php +++ b/include/features.php @@ -23,6 +23,8 @@ function get_features() { array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles')), array('webpages', t('Web Pages'), t('Provide managed web pages on your channel')), array('prettyphoto', t('Enhanced Photo Albums'), t('Enable photo album with enhanced features')), + //FIXME - needs a description, but how the hell do we explain this to normals? + array('sendzid', t('Extended Identity Sharing'), t(' ')), array('expert', t('Expert Mode'), t('Enable Expert Mode to provide advanced configuration options')), diff --git a/include/text.php b/include/text.php index 360a7357f..c7210010c 100644 --- a/include/text.php +++ b/include/text.php @@ -1128,14 +1128,22 @@ function prepare_text($text,$content_type = 'text/bbcode') { function zidify_callback($match) { - $replace = '