From 37368bda6591ccd0b69775c35599d6696f712c27 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 20 Nov 2015 12:49:38 -0800 Subject: change _newwin to _blank because the window named _newwin may be hard to find if you have lots of windows/tabs open. --- doc/faq_developers.bb | 2 +- include/bbcode.php | 32 ++++++++++++++++---------------- include/text.php | 4 ++-- index.php | 6 ++---- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/doc/faq_developers.bb b/doc/faq_developers.bb index dd7f4cda1..603cf238f 100644 --- a/doc/faq_developers.bb +++ b/doc/faq_developers.bb @@ -285,7 +285,7 @@ An example (large) &$a object showing some of its many members and structures-- "xchan_photo_l": "http://hubzilla/photo/profile/l/2" }, "page": { - "content": "<div id="help-content" class="generic-content-wrapper">\n\t<div class="section-title-wrapper">\n\t<h2>Hubzilla Documentation</h2>\n\t</div>\n\t<div class="section-content-wrapper">\n\t<h2>Documentation for Developers</h2><br /><br /><h3>Technical Documentation</h3><br /><a class="zrl" href="http://hubzilla/help/Zot---A-High-Level-Overview" target="_newwin" >A high level overview of Zot</a><br /><a class="zrl" href="http://hubzilla/help/zot" target="_newwin" >An introduction to Zot</a><br /><a class="zrl" href="http://hubzilla/help/zot_structures" target="_newwin" >Zot Stuctures</a><br /><a class="zrl" href="http://hubzilla/help/comanche" target="_newwin" >Comanche Page Descriptions</a><br /><a class="zrl" href="http://hubzilla/help/Creating-Templates" target="_newwin" >Creating Comanche Templates</a><br /><a class="zrl" href="http://hubzilla/help/Widgets" target="_newwin" >Widgets</a><br /><a class="zrl" href="http://hubzilla/help/plugins" target="_newwin" >Plugins</a><br /><a class="zrl" href="http://hubzilla/help/hooks" target="_newwin" >Hooks</a><br /><a class="zrl" href="http://hubzilla/help/doco" target="_newwin" >Contributing Documentation</a><br /><a class="zrl" href="http://hubzilla/help/DerivedTheme1" target="_newwin" >Creating Derivative Themes</a><br /><a class="zrl" href="http://hubzilla/help/schema_development" target="_newwin" >Schemas</a><br /><a class="zrl" href="http://hubzilla/help/Translations" target="_newwin" >Translations</a><br /><a class="zrl" href="http://hubzilla/help/developers" target="_newwin" >Developers</a><br /><a class="zrl" href="http://hubzilla/help/intro_for_developers" target="_newwin" >Intro for Developers</a><br /><a class="zrl" href="http://hubzilla/help/database" target="_newwin" >Database schema documentation</a><br /><a class="zrl" href="http://hubzilla/help/api_functions" target="_newwin" >API functions</a><br /><a class="zrl" href="http://hubzilla/help/api_posting" target="_newwin" >Posting to the red# using the API</a><br /><a class="zrl" href="http://hubzilla/help/developer_function_primer" target="_newwin" >Red Functions 101</a><br /><a class="zrl" href="http://hubzilla/doc/html/" target="_newwin" >Code Reference (Doxygen generated - sets cookies)</a><br /><a class="zrl" href="http://hubzilla/help/to_do_doco" target="_newwin" >To-Do list for the Red Documentation Project</a><br /><a class="zrl" href="http://hubzilla/help/to_do_code" target="_newwin" >To-Do list for Developers</a><br /><a class="zrl" href="http://hubzilla/help/roadmap" target="_newwin" >Version 3 roadmap</a><br /><a class="zrl" href="http://hubzilla/help/git_for_non_developers" target="_newwin" >Git for Non-Developers</a><br /><a class="zrl" href="http://hubzilla/help/dev_beginner" target="_newwin" >Step-for-step manual for beginning developers</a><br /><br /><h3>Frequently Asked Questions For Developers</h3><br /><a class="zrl" href="http://hubzilla/help/faq_developers" target="_newwin" >FAQ For Developers</a><br /><br /><h3>External Resources</h3><br /><br /><a href="https://zothub.com/channel/one" target="_newwin" >Development Channel</a><br /><a href="https://federated.social/channel/postgres" target="_newwin" >Postgres-specific Hubzilla Admin Support Channel</a><br />\n\t</div>\n</div>\n<script>var homebase = "http://hubzilla/channel/testes";</script>", + "content": "<div id="help-content" class="generic-content-wrapper">\n\t<div class="section-title-wrapper">\n\t<h2>Hubzilla Documentation</h2>\n\t</div>\n\t<div class="section-content-wrapper">\n\t<h2>Documentation for Developers</h2><br /><br /><h3>Technical Documentation</h3><br /><a class="zrl" href="http://hubzilla/help/Zot---A-High-Level-Overview" target="_blank" >A high level overview of Zot</a><br /><a class="zrl" href="http://hubzilla/help/zot" target="_blank" >An introduction to Zot</a><br /><a class="zrl" href="http://hubzilla/help/zot_structures" target="_blank" >Zot Stuctures</a><br /><a class="zrl" href="http://hubzilla/help/comanche" target="_blank" >Comanche Page Descriptions</a><br /><a class="zrl" href="http://hubzilla/help/Creating-Templates" target="_blank" >Creating Comanche Templates</a><br /><a class="zrl" href="http://hubzilla/help/Widgets" target="_blank" >Widgets</a><br /><a class="zrl" href="http://hubzilla/help/plugins" target="_blank" >Plugins</a><br /><a class="zrl" href="http://hubzilla/help/hooks" target="_blank" >Hooks</a><br /><a class="zrl" href="http://hubzilla/help/doco" target="_blank" >Contributing Documentation</a><br /><a class="zrl" href="http://hubzilla/help/DerivedTheme1" target="_blank" >Creating Derivative Themes</a><br /><a class="zrl" href="http://hubzilla/help/schema_development" target="_blank" >Schemas</a><br /><a class="zrl" href="http://hubzilla/help/Translations" target="_blank" >Translations</a><br /><a class="zrl" href="http://hubzilla/help/developers" target="_blank" >Developers</a><br /><a class="zrl" href="http://hubzilla/help/intro_for_developers" target="_blank" >Intro for Developers</a><br /><a class="zrl" href="http://hubzilla/help/database" target="_blank" >Database schema documentation</a><br /><a class="zrl" href="http://hubzilla/help/api_functions" target="_blank" >API functions</a><br /><a class="zrl" href="http://hubzilla/help/api_posting" target="_blank" >Posting to the red# using the API</a><br /><a class="zrl" href="http://hubzilla/help/developer_function_primer" target="_blank" >Red Functions 101</a><br /><a class="zrl" href="http://hubzilla/doc/html/" target="_blank" >Code Reference (Doxygen generated - sets cookies)</a><br /><a class="zrl" href="http://hubzilla/help/to_do_doco" target="_blank" >To-Do list for the Red Documentation Project</a><br /><a class="zrl" href="http://hubzilla/help/to_do_code" target="_blank" >To-Do list for Developers</a><br /><a class="zrl" href="http://hubzilla/help/roadmap" target="_blank" >Version 3 roadmap</a><br /><a class="zrl" href="http://hubzilla/help/git_for_non_developers" target="_blank" >Git for Non-Developers</a><br /><a class="zrl" href="http://hubzilla/help/dev_beginner" target="_blank" >Step-for-step manual for beginning developers</a><br /><br /><h3>Frequently Asked Questions For Developers</h3><br /><a class="zrl" href="http://hubzilla/help/faq_developers" target="_blank" >FAQ For Developers</a><br /><br /><h3>External Resources</h3><br /><br /><a href="https://zothub.com/channel/one" target="_blank" >Development Channel</a><br /><a href="https://federated.social/channel/postgres" target="_blank" >Postgres-specific Hubzilla Admin Support Channel</a><br />\n\t</div>\n</div>\n<script>var homebase = "http://hubzilla/channel/testes";</script>", "page_title": "help", "title": "Help: Develop", "nav": "\t<div class="container-fluid">\n\t\t<div class="navbar-header">\n\t\t\t<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1">\n\t\t\t\t<span class="icon-bar"></span>\n\t\t\t\t<span class="icon-bar"></span>\n\t\t\t\t<span class="icon-bar"></span>\n\t\t\t</button>\n\t\t\t<button id="expand-tabs" type="button" class="navbar-toggle" data-toggle="collapse" data-target="#tabs-collapse-1">\n\t\t\t\t<i class="icon-circle-arrow-down" id="expand-tabs-icon"></i>\n\t\t\t</button>\n\t\t\t<button id="expand-aside" type="button" class="navbar-toggle" data-toggle="offcanvas" data-target="#region_1">\n\t\t\t\t<i class="icon-circle-arrow-right" id="expand-aside-icon"></i>\n\t\t\t</button>\n\t\t\t\t\t\t\t<img class="dropdown-toggle fakelink" data-toggle="dropdown" id="avatar" src="http://hubzilla/photo/profile/m/2" alt="testes@hubzilla"><span class="caret" id="usermenu-caret"></span>\n\t\t\t\t\t\t\t\t\t<ul class="dropdown-menu" role="menu" aria-labelledby="avatar">\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="channel/testes" title="Your posts and conversations" role="menuitem" id="channel_nav_btn">Home</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="profile/testes" title="Your profile page" role="menuitem" id="profile_nav_btn">View Profile</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="profiles/2" title="Edit your profile" role="menuitem" id="profiles_nav_btn">Edit Profile</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="photos/testes" title="Your photos" role="menuitem" id="photos_nav_btn">Photos</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="cloud/testes" title="Your files" role="menuitem" id="cloud_nav_btn">Files</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="chat/testes/new" title="Your chatrooms" role="menuitem" id="chat_nav_btn">Chat</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation" class="divider"></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation"><a href="settings" title="Account/Channel Settings" role="menuitem" id="settings_nav_btn">Settings</a></li>\t\t\t\t\t\t<li role="presentation"><a href="manage" title="Manage Your Channels" role="menuitem" id="manage_nav_btn">Channel Manager</a></li>\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation" class="divider"></li>\n\t\t\t\t\t\t<li role="presentation"><a href="admin/" title="Site Setup and Configuration" role="menuitem" id="admin_nav_btn">Admin</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li role="presentation" class="divider"></li>\n\t\t\t\t\t\t<li role="presentation"><a href="logout" title="End this session" role="menuitem" id="logout_nav_btn">Logout</a></li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t<div class="collapse navbar-collapse" id="navbar-collapse-1">\n\t\t\t<ul class="nav navbar-nav navbar-left">\n\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a href="network" title="Your grid" id="network_nav_btn"><i class="icon-th"></i></a>\n\t\t\t\t\t<span class="net-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-network-menu"></span>\n\t\t\t\t\t<ul id="nav-network-menu" role="menu" class="dropdown-menu" rel="network">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<li id="nav-network-mark-all"><a href="#" onclick="markRead('network'); return false;">Mark all grid notifications seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a href="network" title="Your grid" ><i class="icon-th"></i></a>\n\t\t\t\t\t<span class="net-update badge" rel="#nav-network-menu"></span>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a class="" href="channel/testes" title="Channel home" id="home_nav_btn"><i class="icon-home"></i></a>\n\t\t\t\t\t<span class="home-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-home-menu"></span>\n\t\t\t\t\t<ul id="nav-home-menu" class="dropdown-menu" rel="home">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<li id="nav-home-mark-all"><a href="#" onclick="markRead('home'); return false;">Mark all channel notifications seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a class="" href="channel/testes" title="Channel home" ><i class="icon-home"></i></a>\n\t\t\t\t\t<span class="home-update badge" rel="#nav-home-menu"></span>\n\t\t\t\t</li>\n\t\t\t\n\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a class="" href="mail/combined" title="Private mail" id="mail_nav_btn"><i class="icon-envelope"></i></a>\n\t\t\t\t\t<span class="mail-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-messages-menu"></span>\n\t\t\t\t\t<ul id="nav-messages-menu" class="dropdown-menu" rel="messages">\n\t\t\t\t\t\t<li id="nav-messages-see-all"><a href="mail/combined">See all private messages</a></li>\n\t\t\t\t\t\t<li id="nav-messages-mark-all"><a href="#" onclick="markRead('messages'); return false;">Mark all private messages seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a class="" href="mail/combined" title="Private mail" ><i class="icon-envelope"></i></a>\n\t\t\t\t\t<span class="mail-update badge" rel="#nav-messages-menu"></span>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a class="" href="events" title="Event Calendar" id='events_nav_btn'><i class="icon-calendar"></i></a>\n\t\t\t\t\t<span class="all_events-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-all_events-menu"></span>\n\t\t\t\t\t<ul id="nav-all_events-menu" class="dropdown-menu" rel="all_events">\n\t\t\t\t\t\t<li id="nav-all_events-see-all"><a href="events">See all events</a></li>\n\t\t\t\t\t\t<li id="nav-all_events-mark-all"><a href="#" onclick="markRead('all_events'); return false;">Mark all events seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a class="" href="events" title="Event Calendar" ><i class="icon-calendar"></i></a>\n\t\t\t\t\t<span class="all_events-update badge" rel="#nav-all_events-menu"></span>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a class="" href="connections/ifpending" title="Connections" id="connections_nav_btn"><i class="icon-user"></i></a>\n\t\t\t\t\t<span class="intro-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-intros-menu"></span>\n\t\t\t\t\t<ul id="nav-intros-menu" class="dropdown-menu" rel="intros">\n\t\t\t\t\t\t<li id="nav-intros-see-all"><a href=""></a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a class="" href="connections/ifpending" title="Connections" ><i class="icon-user"></i></a>\n\t\t\t\t\t<span class="intro-update badge" rel="#nav-intros-menu"></span>\n\t\t\t\t</li>\n\t\t\t\t\t\n\t\t\t\t\t\t\t<li class=" hidden-xs">\n\t\t\t\t\t<a href="notifications/system" title="Notices" id="notifications_nav_btn"><i class="icon-exclamation"></i></a>\n\t\t\t\t\t<span class="notify-update badge dropdown-toggle" data-toggle="dropdown" rel="#nav-notify-menu"></span>\n\t\t\t\t\t<ul id="nav-notify-menu" class="dropdown-menu" rel="notify">\n\t\t\t\t\t\t<li id="nav-notify-see-all"><a href="notifications/system">See all notifications</a></li>\n\t\t\t\t\t\t<li id="nav-notify-mark-all"><a href="#" onclick="markRead('notify'); return false;">Mark all system notifications seen</a></li>\n\t\t\t\t\t\t<li class="empty">Loading...</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</li>\n\t\t\t\t<li class=" visible-xs">\n\t\t\t\t\t<a href="notifications/system" title="Notices"><i class="icon-exclamation"></i></a>\n\t\t\t\t\t<span class="notify-update badge" rel="#nav-notify-menu"></span>\n\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t<ul class="nav navbar-nav navbar-right">\n\t\t\t\t<li class="hidden-xs">\n\t\t\t\t\t<form method="get" action="search" role="search">\n\t\t\t\t\t\t<div id="nav-search-spinner"></div><input class="icon-search" id="nav-search-text" type="text" value="" placeholder="&#xf002; @name, #tag, ?doc, content" name="search" title="Search site @name, #tag, ?docs, content" onclick="this.submit();"/>\n\t\t\t\t\t</form>\n\t\t\t\t</li>\n\t\t\t\t<li class="visible-xs">\n\t\t\t\t\t<a href="/search" title="Search site @name, #tag, ?docs, content"><i class="icon-search"></i></a>\n\t\t\t\t</li>\n\n\t\t\t\t\t\t\t\t\t\t<li class="">\n\t\t\t\t\t<a class="" href="directory" title="Channel Directory" id="directory_nav_btn"><i class="icon-sitemap"></i></a>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class="">\n\t\t\t\t\t<a class="" href="apps" title="Applications, utilities, links, games" id="apps_nav_btn"><i class="icon-cogs"></i></a>\n\t\t\t\t</li>\n\t\t\t\n\t\t\t\t\t\t\t<li class="active">\n\t\t\t\t\t<a class="" target="hubzilla-help" href="http://hubzilla/help?f=&cmd=help/develop" title="Help and documentation" id="help_nav_btn"><i class="icon-question"></i></a>\n\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t</div>\n\t</div>\n", diff --git a/include/bbcode.php b/include/bbcode.php index 05802aa57..a8372d728 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -570,7 +570,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) $urlchars = '[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,\@]'; if (strpos($Text,'http') !== false) { - $Text = preg_replace("/([^\]\='".'"'."\/]|^|\#\^)(https?\:\/\/$urlchars+)/ism", '$1$2', $Text); + $Text = preg_replace("/([^\]\='".'"'."\/]|^|\#\^)(https?\:\/\/$urlchars+)/ism", '$1$2', $Text); } if (strpos($Text,'[/share]') !== false) { @@ -582,21 +582,21 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) } } if (strpos($Text,'[/url]') !== false) { - $Text = preg_replace("/\#\^\[url\]([$URLSearchString]*)\[\/url\]/ism", '#^$1', $Text); - $Text = preg_replace("/\#\^\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '#^$2', $Text); - $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/ism", '$1', $Text); - $Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$2', $Text); + $Text = preg_replace("/\#\^\[url\]([$URLSearchString]*)\[\/url\]/ism", '#^$1', $Text); + $Text = preg_replace("/\#\^\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '#^$2', $Text); + $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/ism", '$1', $Text); + $Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$2', $Text); } if (strpos($Text,'[/zrl]') !== false) { - $Text = preg_replace("/\#\^\[zrl\]([$URLSearchString]*)\[\/zrl\]/ism", '#^$1', $Text); - $Text = preg_replace("/\#\^\[zrl\=([$URLSearchString]*)\](.*?)\[\/zrl\]/ism", '#^$2', $Text); - $Text = preg_replace("/\[zrl\]([$URLSearchString]*)\[\/zrl\]/ism", '$1', $Text); - $Text = preg_replace("/\[zrl\=([$URLSearchString]*)\](.*?)\[\/zrl\]/ism", '$2', $Text); + $Text = preg_replace("/\#\^\[zrl\]([$URLSearchString]*)\[\/zrl\]/ism", '#^$1', $Text); + $Text = preg_replace("/\#\^\[zrl\=([$URLSearchString]*)\](.*?)\[\/zrl\]/ism", '#^$2', $Text); + $Text = preg_replace("/\[zrl\]([$URLSearchString]*)\[\/zrl\]/ism", '$1', $Text); + $Text = preg_replace("/\[zrl\=([$URLSearchString]*)\](.*?)\[\/zrl\]/ism", '$2', $Text); } // Perform MAIL Search if (strpos($Text,'[/mail]') !== false) { - $Text = preg_replace("/\[mail\]([$MAILSearchString]*)\[\/mail\]/", '$1', $Text); - $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.*?)\[\/mail\]/", '$2', $Text); + $Text = preg_replace("/\[mail\]([$MAILSearchString]*)\[\/mail\]/", '$1', $Text); + $Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.*?)\[\/mail\]/", '$2', $Text); } @@ -886,17 +886,17 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) // if video couldn't be embedded, link to it instead. if (strpos($Text,'[/video]') !== false) { - $Text = preg_replace("/\[video\](.*?)\[\/video\]/", '$1', $Text); + $Text = preg_replace("/\[video\](.*?)\[\/video\]/", '$1', $Text); } if (strpos($Text,'[/audio]') !== false) { - $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '$1', $Text); + $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/", '$1', $Text); } if (strpos($Text,'[/zvideo]') !== false) { - $Text = preg_replace("/\[zvideo\](.*?)\[\/zvideo\]/", '$1', $Text); + $Text = preg_replace("/\[zvideo\](.*?)\[\/zvideo\]/", '$1', $Text); } if (strpos($Text,'[/zaudio]') !== false) { - $Text = preg_replace("/\[zaudio\](.*?)\[\/zaudio\]/", '$1', $Text); + $Text = preg_replace("/\[zaudio\](.*?)\[\/zaudio\]/", '$1', $Text); } if ($tryoembed){ @@ -905,7 +905,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) } } else { if (strpos($Text,'[/iframe]') !== false) { - $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '$1', $Text); + $Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '$1', $Text); } } diff --git a/include/text.php b/include/text.php index 7c8834fc8..eb9171b40 100644 --- a/include/text.php +++ b/include/text.php @@ -1403,13 +1403,13 @@ function prepare_body(&$item,$attach = false) { // if original photo width is <= 640px prepend it to item body if($object['link'][0]['width'] && $object['link'][0]['width'] <= 640) { - $s = '
' . $s; + $s = '
' . $s; } // if original photo width is > 640px make it a cover photo if($object['link'][0]['width'] && $object['link'][0]['width'] > 640) { $scale = ((($object['link'][1]['width'] == 1024) || ($object['link'][1]['height'] == 1024)) ? 1 : 0); - $photo = ''; + $photo = ''; } } diff --git a/index.php b/index.php index dc6000bd6..6ed7eeb11 100755 --- a/index.php +++ b/index.php @@ -36,10 +36,8 @@ require_once('include/dba/dba_driver.php'); if(! $a->install) { $db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, $a->install); - if(! $db->connected){ - header('HTTP/1.0 520 Unknown Error'); - // TODO: much friendlier error message - die("Database error, contact admin."); + if(! $db->connected) { + system_unavailable(); } unset($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type); -- cgit v1.2.3 From f164ddf155a352625bd48e0307f2e81e24de9453 Mon Sep 17 00:00:00 2001 From: ken restivo Date: Fri, 20 Nov 2015 13:03:16 -0800 Subject: Report correct HTTP error code, i.e. for API callers. --- include/system_unavailable.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/system_unavailable.php b/include/system_unavailable.php index dfe7c5e6b..00a73fc38 100644 --- a/include/system_unavailable.php +++ b/include/system_unavailable.php @@ -1,6 +1,7 @@ System Unavailable -- cgit v1.2.3 From 106b4fdd2d4b0cf893d27df7d60085b441f37b9a Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 20 Nov 2015 14:38:32 -0800 Subject: add v4 project roadmap, partial fix for cloning of profile photos on alternate profiles --- doc/roadmapv4.bb | 27 +++++++++++++++++++++++++++ include/identity.php | 11 +++++++++++ mod/profile_photo.php | 3 +++ mod/profiles.php | 16 ++++++++++++---- 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 doc/roadmapv4.bb diff --git a/doc/roadmapv4.bb b/doc/roadmapv4.bb new file mode 100644 index 000000000..4670c73b3 --- /dev/null +++ b/doc/roadmapv4.bb @@ -0,0 +1,27 @@ +[h1]Project Roadmap V4[/h1] + +[h2]Hubzilla 2.0 - code name "Universal Thunder"[/h2] + +[h3]Project Core Development[/h3] + +Goals/Highlights: + + +Focus on visual website design tools, widgets, and sharing mechanisms + +App organisation. + +Conversion of core application to a composer format living under the namespace "Zotlabs" + +Conversion of Modules to a more general purpose Controllers layout with DB/memory based +controller routing as opposed to filesystem routing. + +Conversion of core Zot Protocol to a class library + +Abstraction of nomadic identity so that sending/receiving to/from singleton networks to/from any clone works flawlessly - [b]provided[/b] the clone physically connected to that singleton identity is up. + +[h3]Community Development[/h3] + +CalDAV/CardDAV + +E-Commerce \ No newline at end of file diff --git a/include/identity.php b/include/identity.php index 21d919508..4682cf624 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1689,3 +1689,14 @@ function get_channel_default_perms($uid) { return 0; } + + +function profiles_build_sync($channel_id) { + + $r = q("select * from profile where uid = %d", + intval($channel_id) + ); + if($r) { + build_sync_packet($channel_id,array('profile' => $r)); + } +} diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 7067a9f76..2884505f0 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -6,6 +6,7 @@ */ require_once('include/photo/photo_driver.php'); +require_once('include/identity.php'); /* @brief Function for sync'ing permissions of profile-photos and their profile * @@ -195,6 +196,8 @@ function profile_photo_post(&$a) { ); } + profiles_build_sync(local_channel()); + // We'll set the updated profile-photo timestamp even if it isn't the default profile, // so that browsers will do a cache update unconditionally diff --git a/mod/profiles.php b/mod/profiles.php index 19e5ffc50..282d741ac 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -1,5 +1,6 @@ get_baseurl(true) . '/profiles'); return; // NOTREACHED } @@ -118,7 +125,10 @@ function profiles_init(&$a) { dbesc($name) ); info( t('New profile created.') . EOL); - if(count($r3) == 1) + + profiles_build_sync(local_channel()); + + if(($r3) && (count($r3) == 1)) goaway($a->get_baseurl(true) . '/profiles/' . $r3[0]['id']); goaway($a->get_baseurl(true) . '/profiles'); @@ -193,7 +203,6 @@ function profiles_post(&$a) { $namechanged = false; - call_hooks('profile_post', $_POST); // import from json export file. // Only import fields that are allowed on this hub @@ -220,6 +229,7 @@ function profiles_post(&$a) { } } + call_hooks('profile_post', $_POST); if((argc() > 1) && (argv(1) !== "new") && intval(argv(1))) { @@ -564,8 +574,6 @@ function profiles_post(&$a) { } - - function profiles_content(&$a) { $o = ''; -- cgit v1.2.3