From 9ab57de3562a584519485579e85a45bedc9352c6 Mon Sep 17 00:00:00 2001
From: very-ape <git@verya.pe>
Date: Thu, 20 May 2021 00:16:08 -0700
Subject: [PATCH 01/24] Bug fix: allow authentication addons to create users
 again.

---
 src/Model/User.php | 61 ++++++++++++++++++++++++++++++++++------------
 1 file changed, 45 insertions(+), 16 deletions(-)

diff --git a/src/Model/User.php b/src/Model/User.php
index 3b11ee6ce..4b716f260 100644
--- a/src/Model/User.php
+++ b/src/Model/User.php
@@ -515,7 +515,20 @@ class User
 	 */
 	public static function getIdFromPasswordAuthentication($user_info, $password, $third_party = false)
 	{
-		$user = self::getAuthenticationInfo($user_info);
+		// Addons registered with the "authenticate" hook may create the user on the
+		// fly. `getAuthenticationInfo` will fail if the user doesn't exist yet. If
+		// the user doesn't exist, we should give the addons a chance to create the
+		// user in our database, if applicable, before re-throwing the exception if
+		// they fail.
+		try {
+			$user = self::getAuthenticationInfo($user_info);
+		} catch (Exception $e) {
+			if (is_string($user_info)) {
+				return self::getIdFromAuthenticateHooks($user_info, $password);
+			} else {
+				throw $e;
+			}
+		}
 
 		if ($third_party && DI::pConfig()->get($user['uid'], '2fa', 'verified')) {
 			// Third-party apps can't verify two-factor authentication, we use app-specific passwords instead
@@ -545,23 +558,39 @@ class User
 
 			return $user['uid'];
 		} else {
-			$addon_auth = [
-				'username'      => $user['nickname'],
-				'password'      => $password,
-				'authenticated' => 0,
-				'user_record'   => null
-			];
+			return self::getIdFromAuthenticateHooks($user['nickname'], $password); // throws
+		}
 
-			/*
-			 * An addon indicates successful login by setting 'authenticated' to non-zero value and returning a user record
-			 * Addons should never set 'authenticated' except to indicate success - as hooks may be chained
-			 * and later addons should not interfere with an earlier one that succeeded.
-			 */
-			Hook::callAll('authenticate', $addon_auth);
+		throw new HTTPException\ForbiddenException(DI::l10n()->t('Login failed'));
+	}
 
-			if ($addon_auth['authenticated'] && $addon_auth['user_record']) {
-				return $user['uid'];
-			}
+	/**
+	 * Try to obtain a user ID via "authenticate" hook addons
+	 *
+	 * Returns the user id associated with a successful password authentication
+	 *
+	 * @param string $username
+	 * @param string $password
+	 * @return int User Id if authentication is successful
+	 * @throws HTTPException\ForbiddenException
+	 */
+	public static function getIdFromAuthenticateHooks($username, $password) {
+		$addon_auth = [
+			'username'      => $username,
+			'password'      => $password,
+			'authenticated' => 0,
+			'user_record'   => null
+		];
+
+		/*
+		 * An addon indicates successful login by setting 'authenticated' to non-zero value and returning a user record
+		 * Addons should never set 'authenticated' except to indicate success - as hooks may be chained
+		 * and later addons should not interfere with an earlier one that succeeded.
+		 */
+		Hook::callAll('authenticate', $addon_auth);
+
+		if ($addon_auth['authenticated'] && $addon_auth['user_record']) {
+			return $user['uid'];
 		}
 
 		throw new HTTPException\ForbiddenException(DI::l10n()->t('Login failed'));

From c89241dbd80b1b0503e239f8b468e6efbcb79802 Mon Sep 17 00:00:00 2001
From: very-ape <git@verya.pe>
Date: Thu, 20 May 2021 00:19:09 -0700
Subject: [PATCH 02/24] Bug fix: add missing changes.

---
 src/Model/User.php | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/Model/User.php b/src/Model/User.php
index 4b716f260..8a9f0a930 100644
--- a/src/Model/User.php
+++ b/src/Model/User.php
@@ -523,11 +523,19 @@ class User
 		try {
 			$user = self::getAuthenticationInfo($user_info);
 		} catch (Exception $e) {
-			if (is_string($user_info)) {
-				return self::getIdFromAuthenticateHooks($user_info, $password);
-			} else {
+			// Addons can create users, and creating a numeric username would create
+			// abiguity with user IDs, possibly opening up an attack vector.
+			// So let's be very careful about that.
+			if (is_numeric($user_info) || is_numeric($user_info['nickname'] ?? '')) {
 				throw $e;
 			}
+
+			$username = (is_string($user_info) ? $user_info : $user_info['nickname'] ?? '');
+
+			if (!$username) {
+				throw $e;
+			}
+			return self::getIdFromAuthenticateHooks($user_info, $password);
 		}
 
 		if ($third_party && DI::pConfig()->get($user['uid'], '2fa', 'verified')) {
@@ -590,7 +598,7 @@ class User
 		Hook::callAll('authenticate', $addon_auth);
 
 		if ($addon_auth['authenticated'] && $addon_auth['user_record']) {
-			return $user['uid'];
+			return $addon_auth['user_record']['uid'];
 		}
 
 		throw new HTTPException\ForbiddenException(DI::l10n()->t('Login failed'));

From 8e005f7de2bc8fa9e82d7ae666b9b3b94f2a8cf4 Mon Sep 17 00:00:00 2001
From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Wed, 19 May 2021 17:47:15 -0400
Subject: [PATCH 03/24] Remove whitespace from opening HTML tag ending

---
 view/templates/admin/features.tpl             |  2 +-
 view/templates/album_edit.tpl                 |  8 ++--
 view/templates/birthdays_reminder.tpl         |  2 +-
 view/templates/comment_item.tpl               |  6 +--
 view/templates/contact/advanced.tpl           |  2 +-
 view/templates/contact_edit.tpl               | 10 ++---
 view/templates/contact_template.tpl           | 20 ++++-----
 view/templates/contacts-template.tpl          |  2 +-
 view/templates/conversation.tpl               |  4 +-
 view/templates/dfrn_req_confirm.tpl           |  4 +-
 view/templates/directory_header.tpl           |  4 +-
 view/templates/directory_item.tpl             |  8 ++--
 view/templates/event.tpl                      |  2 +-
 view/templates/event_form.tpl                 |  2 +-
 view/templates/events.tpl                     |  6 +--
 view/templates/events_js.tpl                  |  2 +-
 view/templates/events_reminder.tpl            |  2 +-
 view/templates/field_combobox.tpl             |  4 +-
 view/templates/filebrowser.tpl                |  2 +-
 view/templates/filer_dialog.tpl               |  2 +-
 view/templates/group_drop.tpl                 |  2 +-
 view/templates/group_edit.tpl                 | 10 ++---
 view/templates/group_selection.tpl            |  4 +-
 view/templates/head.tpl                       | 16 +++----
 view/templates/hovercard.tpl                  |  2 +-
 view/templates/invite.tpl                     |  2 +-
 view/templates/jot-header.tpl                 |  2 +-
 view/templates/jot.tpl                        | 30 ++++++-------
 view/templates/login.tpl                      |  6 +--
 view/templates/logout.tpl                     |  2 +-
 view/templates/lostpass.tpl                   |  4 +-
 view/templates/mail_conv.tpl                  | 10 ++---
 view/templates/mail_list.tpl                  | 10 ++---
 view/templates/micropro_img.tpl               |  6 +--
 view/templates/msg-header.tpl                 |  2 +-
 view/templates/nav.tpl                        | 34 +++++++--------
 view/templates/notifications/intros.tpl       |  8 ++--
 view/templates/notifications/netfriend.tpl    |  2 +-
 view/templates/notifications/suggestions.tpl  |  8 ++--
 view/templates/oembed_video.tpl               |  6 +--
 view/templates/photo_album.tpl                |  4 +-
 view/templates/photo_albums.tpl               |  4 +-
 view/templates/photo_edit.tpl                 |  8 ++--
 view/templates/photo_top.tpl                  |  2 +-
 .../photos_default_uploader_submit.tpl        |  2 +-
 view/templates/photos_upload.tpl              | 16 +++----
 view/templates/profile/publish.tpl            |  2 +-
 view/templates/prv_message.tpl                | 16 +++----
 view/templates/register.tpl                   | 42 +++++++++----------
 view/templates/removeme.tpl                   |  2 +-
 view/templates/settings/nick_set.tpl          |  2 +-
 view/templates/settings/oauth_edit.tpl        |  2 +-
 .../templates/settings/profile/index_head.tpl |  2 +-
 .../templates/settings/profile/photo/crop.tpl |  2 +-
 .../templates/settings/twofactor/recovery.tpl |  2 +-
 view/templates/settings/twofactor/verify.tpl  |  2 +-
 view/templates/threaded_conversation.tpl      |  4 +-
 view/templates/uimport.tpl                    | 26 ++++++------
 view/templates/wallmessage.tpl                | 12 +++---
 view/templates/widget/events.tpl              |  4 +-
 view/templates/widget/follow.tpl              |  2 +-
 view/templates/widget/peoplefind.tpl          | 12 +++---
 view/templates/widget_forumlist.tpl           |  4 +-
 view/theme/duepuntozero/templates/nav.tpl     | 34 +++++++--------
 .../frio/templates/admin/users/deleted.tpl    |  2 +-
 view/theme/frio/templates/album_edit.tpl      |  4 +-
 view/theme/frio/templates/confirm.tpl         |  2 +-
 .../theme/frio/templates/contact/advanced.tpl |  4 +-
 view/theme/frio/templates/contact_edit.tpl    | 10 ++---
 .../theme/frio/templates/contact_template.tpl | 20 ++++-----
 .../frio/templates/contacts-template.tpl      |  2 +-
 .../theme/frio/templates/directory_header.tpl |  4 +-
 view/theme/frio/templates/event.tpl           |  4 +-
 view/theme/frio/templates/event_form.tpl      |  4 +-
 .../frio/templates/field_themeselect.tpl      |  2 +-
 view/theme/frio/templates/group_edit.tpl      |  2 +-
 view/theme/frio/templates/invite.tpl          |  2 +-
 view/theme/frio/templates/jot.tpl             |  2 +-
 view/theme/frio/templates/login.tpl           |  6 +--
 view/theme/frio/templates/mail_conv.tpl       |  2 +-
 .../frio/templates/notifications/intros.tpl   | 14 +++----
 view/theme/frio/templates/photo_albums.tpl    |  2 +-
 view/theme/frio/templates/photos_upload.tpl   |  6 +--
 view/theme/frio/templates/prv_message.tpl     |  2 +-
 view/theme/frio/templates/register.tpl        | 24 +++++------
 view/theme/frio/templates/removeme.tpl        |  4 +-
 .../frio/templates/settings/connectors.tpl    |  2 +-
 .../theme/frio/templates/settings/display.tpl |  2 +-
 .../frio/templates/settings/oauth_edit.tpl    |  2 +-
 view/theme/frio/templates/theme_settings.tpl  |  2 +-
 view/theme/frio/templates/wall_thread.tpl     |  2 +-
 .../frio/templates/widget/peoplefind.tpl      | 12 +++---
 .../quattro/templates/contact_template.tpl    | 20 ++++-----
 view/theme/quattro/templates/event_form.tpl   |  4 +-
 view/theme/quattro/templates/events-js.tpl    |  2 +-
 view/theme/quattro/templates/events.tpl       |  6 +--
 view/theme/quattro/templates/jot.tpl          |  2 +-
 view/theme/quattro/templates/mail_conv.tpl    | 10 ++---
 view/theme/quattro/templates/nav.tpl          | 30 ++++++-------
 view/theme/quattro/templates/photo_item.tpl   |  2 +-
 .../theme/quattro/templates/profile/vcard.tpl |  2 +-
 .../theme/quattro/templates/wall_item_tag.tpl |  4 +-
 .../quattro/templates/widget_forumlist.tpl    |  4 +-
 view/theme/smoothly/templates/jot-header.tpl  |  2 +-
 view/theme/smoothly/templates/jot.tpl         | 28 ++++++-------
 view/theme/smoothly/templates/nav.tpl         |  2 +-
 view/theme/smoothly/templates/tools.tpl       |  4 +-
 .../smoothly/templates/widget/follow.tpl      |  2 +-
 .../vier/templates/ch_directory_item.tpl      |  8 ++--
 view/theme/vier/templates/contact_edit.tpl    | 10 ++---
 .../theme/vier/templates/contact_template.tpl | 22 +++++-----
 view/theme/vier/templates/event_form.tpl      |  2 +-
 view/theme/vier/templates/nav.tpl             | 40 +++++++++---------
 view/theme/vier/templates/wall_item_tag.tpl   |  4 +-
 view/theme/vier/templates/wall_thread.tpl     |  2 +-
 .../vier/templates/widget_forumlist_right.tpl |  4 +-
 116 files changed, 415 insertions(+), 415 deletions(-)

diff --git a/view/templates/admin/features.tpl b/view/templates/admin/features.tpl
index 46a7abea2..42058d5ca 100644
--- a/view/templates/admin/features.tpl
+++ b/view/templates/admin/features.tpl
@@ -15,7 +15,7 @@
 			</div>
 		{{/foreach}}
 
-		<div class="settings-submit-wrapper" >
+		<div class="settings-submit-wrapper">
 			<input type="submit" name="submit" class="settings-features-submit" value="{{$submit}}" />
 		</div>
 	</div>
diff --git a/view/templates/album_edit.tpl b/view/templates/album_edit.tpl
index b6f24ec3b..dd4459fe9 100644
--- a/view/templates/album_edit.tpl
+++ b/view/templates/album_edit.tpl
@@ -1,10 +1,10 @@
 
 <div id="photo-album-edit-wrapper">
-<form name="photo-album-edit-form" id="photo-album-edit-form" action="photos/{{$nickname}}/album/{{$hexalbum}}" method="post" >
+<form name="photo-album-edit-form" id="photo-album-edit-form" action="photos/{{$nickname}}/album/{{$hexalbum}}" method="post">
 
 
-<label id="photo-album-edit-name-label" for="photo-album-edit-name" >{{$nametext}}</label>
-<input type="text" size="64" name="albumname" value="{{$album}}" >
+<label id="photo-album-edit-name-label" for="photo-album-edit-name">{{$nametext}}</label>
+<input type="text" size="64" name="albumname" value="{{$album}}">
 
 <div id="photo-album-edit-name-end"></div>
 
@@ -12,4 +12,4 @@
 
 </form>
 </div>
-<div id="photo-album-edit-end" ></div>
+<div id="photo-album-edit-end"></div>
diff --git a/view/templates/birthdays_reminder.tpl b/view/templates/birthdays_reminder.tpl
index 6aa51d470..5fb75a993 100644
--- a/view/templates/birthdays_reminder.tpl
+++ b/view/templates/birthdays_reminder.tpl
@@ -1,7 +1,7 @@
 
 {{if $count}}
 <div id="birthday-notice" class="birthday-notice fakelink {{$classtoday}}" onclick="openClose('birthday-wrapper');">{{$event_reminders}} ({{$count}})</div>
-<div id="birthday-wrapper" style="display: none;" ><div id="birthday-title">{{$event_title}}</div>
+<div id="birthday-wrapper" style="display: none;"><div id="birthday-title">{{$event_title}}</div>
 <div id="birthday-title-end"></div>
 {{foreach $events as $event}}
 <div class="birthday-list" id="birthday-{{$event.id}}"> <a href="{{$event.link}}">{{$event.title}}</a> {{$event.date}} </div>
diff --git a/view/templates/comment_item.tpl b/view/templates/comment_item.tpl
index 856637e26..02d34c47e 100644
--- a/view/templates/comment_item.tpl
+++ b/view/templates/comment_item.tpl
@@ -11,13 +11,13 @@
 				<input type="hidden" name="jsreload" value="{{$jsreload}}" />
 				<input type="hidden" name="post_id_random" value="{{$rand_num}}" />
 
-				<div class="comment-edit-photo" id="comment-edit-photo-{{$id}}" >
+				<div class="comment-edit-photo" id="comment-edit-photo-{{$id}}">
 					<a class="comment-edit-photo-link" href="{{$mylink}}" title="{{$mytitle}}"><img class="my-comment-photo" src="{{$myphoto}}" alt="{{$mytitle}}" title="{{$mytitle}}" /></a>
 				</div>
 				<div class="comment-edit-photo-end"></div>
 				<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});" onBlur="commentClose(this,{{$id}});">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
 				{{if $qcomment}}
-					<select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});" >
+					<select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
 					<option value=""></option>
 				{{foreach $qcomment as $qc}}
 					<option value="{{$qc}}">{{$qc}}</option>
@@ -26,7 +26,7 @@
 				{{/if}}
 
 				<div class="comment-edit-text-end"></div>
-				<div class="comment-edit-submit-wrapper" id="comment-edit-submit-wrapper-{{$id}}" style="display: none;" >
+				<div class="comment-edit-submit-wrapper" id="comment-edit-submit-wrapper-{{$id}}" style="display: none;">
 					<input type="submit" onclick="post_comment({{$id}}); return false;" id="comment-edit-submit-{{$id}}" class="comment-edit-submit" name="submit" value="{{$submit}}" />
 					{{if $preview}}<span onclick="preview_comment({{$id}});" id="comment-edit-preview-link-{{$id}}" class="fakelink">{{$preview}}</span>{{/if}}
 					<div id="comment-edit-preview-{{$id}}" class="comment-edit-preview" style="display:none;"></div>
diff --git a/view/templates/contact/advanced.tpl b/view/templates/contact/advanced.tpl
index 004de53c1..f7708ac57 100644
--- a/view/templates/contact/advanced.tpl
+++ b/view/templates/contact/advanced.tpl
@@ -9,7 +9,7 @@
 </div>
 <br />
 
-<form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post" >
+<form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post">
 
 	<!-- <h4>{{$contact_name}}</h4> -->
 
diff --git a/view/templates/contact_edit.tpl b/view/templates/contact_edit.tpl
index c98b44e43..44751eacc 100644
--- a/view/templates/contact_edit.tpl
+++ b/view/templates/contact_edit.tpl
@@ -1,11 +1,11 @@
-<div id="contact-edit-wrapper" >
+<div id="contact-edit-wrapper">
 
 	{{* Insert Tab-Nav *}}
 	{{$tab_str nofilter}}
 
 
-	<div id="contact-edit-nav-wrapper" >
-		<form action="contact/{{$contact_id}}" method="post" >
+	<div id="contact-edit-nav-wrapper">
+		<form action="contact/{{$contact_id}}" method="post">
 			<div id="contact-edit-links">
 				<div id="contact-edit-status-wrapper">
 					<span id="contact-edit-contact-status">{{$contact_status}}</span>
@@ -14,7 +14,7 @@
 					<div id="contact-edit-actions">
 						<a class="btn" rel="#contact-actions-menu" href="#" id="contact-edit-actions-button">{{$contact_action_button}}</a>
 
-						<ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup" >
+						<ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup">
 							{{if $lblsuggest}}<li role="menuitem"><a  href="#" title="{{$contact_actions.suggest.title}}" onclick="window.location.href='{{$contact_actions.suggest.url}}'; return false;">{{$contact_actions.suggest.label}}</a></li>{{/if}}
 							{{if $poll_enabled}}<li role="menuitem"><a  href="#" title="{{$contact_actions.update.title}}" onclick="window.location.href='{{$contact_actions.update.url}}'; return false;">{{$contact_actions.update.label}}</a></li>{{/if}}
 							{{if $contact_actions.updateprofile}}<li role="menuitem"><a href="{{$contact_actions.updateprofile.url}}" title="{{$contact_actions.updateprofile.title}}">{{$contact_actions.updateprofile.label}}</a></li>{{/if}}
@@ -64,7 +64,7 @@
 			<div id="contact-edit-settings">
 				<input type="hidden" name="contact_id" value="{{$contact_id}}">
 
-					<div id="contact-edit-end" ></div>
+					<div id="contact-edit-end"></div>
 					{{include file="field_checkbox.tpl" field=$notify}}
 					{{if $fetch_further_information}}
 						{{include file="field_select.tpl" field=$fetch_further_information}}
diff --git a/view/templates/contact_template.tpl b/view/templates/contact_template.tpl
index 06918533c..31a2d15d6 100644
--- a/view/templates/contact_template.tpl
+++ b/view/templates/contact_template.tpl
@@ -1,9 +1,9 @@
 
-<div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}" >
-	<div class="contact-entry-photo-wrapper" >
+<div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}">
+	<div class="contact-entry-photo-wrapper">
 		<div class="contact-entry-photo mframe" id="contact-entry-photo-{{$contact.id}}"
 		onmouseover="if (typeof t{{$contact.id}} != 'undefined') clearTimeout(t{{$contact.id}}); openMenu('contact-photo-menu-button-{{$contact.id}}')" 
-		onmouseout="t{{$contact.id}}=setTimeout('closeMenu(\'contact-photo-menu-button-{{$contact.id}}\'); closeMenu(\'contact-photo-menu-{{$contact.id}}\');',200)" >
+		onmouseout="t{{$contact.id}}=setTimeout('closeMenu(\'contact-photo-menu-button-{{$contact.id}}\'); closeMenu(\'contact-photo-menu-{{$contact.id}}\');',200)">
 
 			<a href="{{$contact.url}}" title="{{$contact.img_hover}}" /><img src="{{$contact.thumb}}" {{$contact.sparkle}} alt="{{$contact.name}}" /></a>
 
@@ -30,17 +30,17 @@
 	</div>
 
 	<div class="contact-entry-desc">
-		<div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >
+		<div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}">
 			{{$contact.name}}
 			{{if $contact.account_type}} <span class="contact-entry-details" id="contact-entry-accounttype-{{$contact.id}}">({{$contact.account_type}})</span>{{/if}}
 		</div>
-		{{if $contact.alt_text}}<div class="contact-entry-details" id="contact-entry-rel-{{$contact.id}}" >{{$contact.alt_text}}</div>{{/if}}
-		{{if $contact.itemurl}}<div class="contact-entry-details" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</div>{{/if}}
-		{{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}" >{{$contact.tags}}</div>{{/if}}
-		{{if $contact.details}}<div class="contact-entry-details" id="contact-entry-details-{{$contact.id}}" >{{$contact.details}}</div>{{/if}}
-		{{if $contact.network}}<div class="contact-entry-details" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
+		{{if $contact.alt_text}}<div class="contact-entry-details" id="contact-entry-rel-{{$contact.id}}">{{$contact.alt_text}}</div>{{/if}}
+		{{if $contact.itemurl}}<div class="contact-entry-details" id="contact-entry-url-{{$contact.id}}">{{$contact.itemurl}}</div>{{/if}}
+		{{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}">{{$contact.tags}}</div>{{/if}}
+		{{if $contact.details}}<div class="contact-entry-details" id="contact-entry-details-{{$contact.id}}">{{$contact.details}}</div>{{/if}}
+		{{if $contact.network}}<div class="contact-entry-details" id="contact-entry-network-{{$contact.id}}">{{$contact.network}}</div>{{/if}}
 		
 	</div>
 
-	<div class="contact-entry-end" ></div>
+	<div class="contact-entry-end"></div>
 </div>
diff --git a/view/templates/contacts-template.tpl b/view/templates/contacts-template.tpl
index b320b0d05..1631640a0 100644
--- a/view/templates/contacts-template.tpl
+++ b/view/templates/contacts-template.tpl
@@ -4,7 +4,7 @@
 {{if $finding}}<h4>{{$finding}}</h4>{{/if}}
 
 <div id="contacts-search-wrapper">
-<form id="contacts-search-form" action="{{$cmd}}" method="get" >
+<form id="contacts-search-form" action="{{$cmd}}" method="get">
 <span class="contacts-search-desc">{{$desc nofilter}}</span>
 <input type="text" name="search" id="contacts-search" class="search-input" onfocus="this.select();" value="{{$search}}" />
 <input type="submit" name="submit" id="contacts-search-submit" value="{{$submit}}" />
diff --git a/view/templates/conversation.tpl b/view/templates/conversation.tpl
index 761a31a84..2f1222e5d 100644
--- a/view/templates/conversation.tpl
+++ b/view/templates/conversation.tpl
@@ -21,8 +21,8 @@
 
 {{if $dropping}}
 <div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();">
-  <div id="item-delete-selected-icon" class="icon drophide" title="{{$dropping}}" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>
-  <div id="item-delete-selected-desc" >{{$dropping}}</div>
+  <div id="item-delete-selected-icon" class="icon drophide" title="{{$dropping}}" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></div>
+  <div id="item-delete-selected-desc">{{$dropping}}</div>
 </div>
 <div id="item-delete-selected-end"></div>
 {{/if}}
diff --git a/view/templates/dfrn_req_confirm.tpl b/view/templates/dfrn_req_confirm.tpl
index 693f8cbf9..2e586ec33 100644
--- a/view/templates/dfrn_req_confirm.tpl
+++ b/view/templates/dfrn_req_confirm.tpl
@@ -1,6 +1,6 @@
 
 
-<p id="dfrn-request-homecoming" >
+<p id="dfrn-request-homecoming">
 {{$welcome}}
 <br />
 {{$please}}
@@ -16,7 +16,7 @@
 <input type="checkbox" name="hidden-contact" value="1" />
 
 
-<div id="dfrn-request-homecoming-submit-wrapper" >
+<div id="dfrn-request-homecoming-submit-wrapper">
 <input id="dfrn-request-homecoming-submit" type="submit" name="submit" value="{{$submit}}" />
 </div>
 </form>
\ No newline at end of file
diff --git a/view/templates/directory_header.tpl b/view/templates/directory_header.tpl
index 14b1074dc..e277c29da 100644
--- a/view/templates/directory_header.tpl
+++ b/view/templates/directory_header.tpl
@@ -8,7 +8,7 @@
 {{/if}}
 
 <div id="directory-search-wrapper">
-	<form id="directory-search-form" action="{{$search_mod}}" method="get" >
+	<form id="directory-search-form" action="{{$search_mod}}" method="get">
 		<span class="dirsearch-desc">{{$desc nofilter}}</span>
 		<input type="text" name="search" id="directory-search" class="search-input" onfocus="this.select();" value="{{$search}}" />
 		<input type="submit" name="submit" id="directory-search-submit" value="{{$submit}}" class="button" />
@@ -25,6 +25,6 @@
 	{{include file="contact_template.tpl"}}
 {{/foreach}}
 
-<div class="directory-end" ></div>
+<div class="directory-end"></div>
 
 {{$paginate nofilter}}
diff --git a/view/templates/directory_item.tpl b/view/templates/directory_item.tpl
index 4dbe8a951..e80c4b9ab 100644
--- a/view/templates/directory_item.tpl
+++ b/view/templates/directory_item.tpl
@@ -1,9 +1,9 @@
 
 
-<div class="directory-item lframe" id="directory-item-{{$entry.id}}" >
-	<div class="contact-photo-wrapper" id="directory-photo-wrapper-{{$entry.id}}" > 
-		<div class="contact-photo" id="directory-photo-{{$entry.id}}" >
-			<a href="{{$entry.profile_link}}" class="directory-profile-link" id="directory-profile-link-{{$entry.id}}" >
+<div class="directory-item lframe" id="directory-item-{{$entry.id}}">
+	<div class="contact-photo-wrapper" id="directory-photo-wrapper-{{$entry.id}}">
+		<div class="contact-photo" id="directory-photo-{{$entry.id}}">
+			<a href="{{$entry.profile_link}}" class="directory-profile-link" id="directory-profile-link-{{$entry.id}}">
 				<img class="directory-photo-img" src="{{$entry.photo}}" alt="{{$entry.alt_text}}" title="{{$entry.alt_text}}" />
 			</a>
 		</div>
diff --git a/view/templates/event.tpl b/view/templates/event.tpl
index 62317519b..c8250c8ef 100644
--- a/view/templates/event.tpl
+++ b/view/templates/event.tpl
@@ -2,7 +2,7 @@
 {{foreach $events as $event}}
 	<div class="event">
 	
-	{{if $event.item.author_name}}<a href="{{$event.item.author_link}}" ><img src="{{$event.item.author_avatar}}" height="32" width="32" />{{$event.item.author_name}}</a>{{/if}}
+	{{if $event.item.author_name}}<a href="{{$event.item.author_link}}"><img src="{{$event.item.author_avatar}}" height="32" width="32" />{{$event.item.author_name}}</a>{{/if}}
 	{{$event.html nofilter}}
 	{{if $event.plink.orig}}<a href="{{$event.plink.orig}}" title="{{$event.plink.orig_title}}" target="_blank" rel="noopener noreferrer" class="plink-event-link icon s22 remote-link"></a>{{/if}}
 	{{if $event.edit}}<a href="{{$event.edit.0}}" title="{{$event.edit.1}}" class="edit-event-link icon s22 pencil"></a>{{/if}}
diff --git a/view/templates/event_form.tpl b/view/templates/event_form.tpl
index 0527c6990..b22c3c64f 100644
--- a/view/templates/event_form.tpl
+++ b/view/templates/event_form.tpl
@@ -5,7 +5,7 @@
 {{$desc nofilter}}
 </p>
 
-<form id="event-edit-form" action="{{$post}}" method="post" >
+<form id="event-edit-form" action="{{$post}}" method="post">
 
 <input type="hidden" name="event_id" value="{{$eid}}" />
 <input type="hidden" name="cid" value="{{$cid}}" />
diff --git a/view/templates/events.tpl b/view/templates/events.tpl
index 7f55e52d8..07943bd5c 100644
--- a/view/templates/events.tpl
+++ b/view/templates/events.tpl
@@ -2,7 +2,7 @@
 {{$tabs nofilter}}
 {{include file="section_title.tpl"}}
 
-<div id="new-event-link"><a href="{{$new_event.0}}" >{{$new_event.1}}</a></div>
+<div id="new-event-link"><a href="{{$new_event.0}}">{{$new_event.1}}</a></div>
 
 <div id="event-calendar-wrapper">
 	<a href="{{$previus.0}}" class="prevcal {{$previus.2}}"><div id="event-calendar-prev" class="icon s22 prev" title="{{$previus.1}}"></div></a>
@@ -14,8 +14,8 @@
 
 {{foreach $events as $event}}
 	<div class="event">
-	{{if $event.is_first}}<hr /><a name="link-{{$event.j}}" ><div class="event-list-date">{{$event.d}}</div></a>{{/if}}
-	{{if $event.item.author_name}}<a href="{{$event.item.author_link}}" ><img src="{{$event.item.author_avatar}}" height="32" width="32" />{{$event.item.author_name}}</a>{{/if}}
+	{{if $event.is_first}}<hr /><a name="link-{{$event.j}}"><div class="event-list-date">{{$event.d}}</div></a>{{/if}}
+	{{if $event.item.author_name}}<a href="{{$event.item.author_link}}"><img src="{{$event.item.author_avatar}}" height="32" width="32" />{{$event.item.author_name}}</a>{{/if}}
 	{{$event.html nofilter}}
 	{{if $event.item.plink}}<a href="{{$event.plink.0}}" title="{{$event.plink.1}}" target="_blank" rel="noopener noreferrer" class="plink-event-link icon s22 remote-link"></a>{{/if}}
 	{{if $event.edit}}<a href="{{$event.edit.0}}" title="{{$event.edit.1}}" class="edit-event-link icon s22 pencil"></a>{{/if}}
diff --git a/view/templates/events_js.tpl b/view/templates/events_js.tpl
index ab375401a..dfafc6a3c 100644
--- a/view/templates/events_js.tpl
+++ b/view/templates/events_js.tpl
@@ -2,6 +2,6 @@
 {{$tabs nofilter}}
 <h2>{{$title}}</h2>
 
-<div id="new-event-link"><a href="{{$new_event.0}}" >{{$new_event.1}}</a></div>
+<div id="new-event-link"><a href="{{$new_event.0}}">{{$new_event.1}}</a></div>
 
 <div id="events-calendar"></div>
diff --git a/view/templates/events_reminder.tpl b/view/templates/events_reminder.tpl
index 2fcb1908d..228a741b0 100644
--- a/view/templates/events_reminder.tpl
+++ b/view/templates/events_reminder.tpl
@@ -1,7 +1,7 @@
 
 {{if $count}}
 <div id="event-notice" class="birthday-notice fakelink {{$classtoday}}" onclick="openClose('event-wrapper');">{{$event_reminders}} ({{$count}})</div>
-<div id="event-wrapper" style="display: none;" ><div id="event-title">{{$event_title}}</div>
+<div id="event-wrapper" style="display: none;"><div id="event-title">{{$event_title}}</div>
 <div id="event-title-end"></div>
 {{foreach $events as $event}}
 <div class="event-list" id="event-{{$event.id}}"> <a class="ajax-popupbox" href="events/?id={{$event.id}}">{{$event.title}}</a> - {{$event.date}} </div>
diff --git a/view/templates/field_combobox.tpl b/view/templates/field_combobox.tpl
index a22be7f46..3e6e06052 100644
--- a/view/templates/field_combobox.tpl
+++ b/view/templates/field_combobox.tpl
@@ -2,8 +2,8 @@
 	<div class='field combobox'>
 		<label for='id_{{$field.0}}' id='id_{{$field.0}}_label'>{{$field.1}}</label>
 		{{* html5 don't work on Chrome, Safari and IE9
-		<input id="id_{{$field.0}}" type="text" list="data_{{$field.0}}" >
-		<datalist id="data_{{$field.0}}" >
+		<input id="id_{{$field.0}}" type="text" list="data_{{$field.0}}">
+		<datalist id="data_{{$field.0}}">
 		   {{foreach $field.4 as $opt=>$val}}<option value="{{$val}}">{{/foreach}}
 		</datalist> *}}
 		
diff --git a/view/templates/filebrowser.tpl b/view/templates/filebrowser.tpl
index 683ca4ec6..7afcad390 100644
--- a/view/templates/filebrowser.tpl
+++ b/view/templates/filebrowser.tpl
@@ -1,7 +1,7 @@
 <!--
 	This is the template used by mod/fbrowser.php
 -->
-<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
+<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script type="text/javascript" src="{{$baseurl}}/view/js/filebrowser.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script>
 	$(function() {
diff --git a/view/templates/filer_dialog.tpl b/view/templates/filer_dialog.tpl
index 77f48e8ae..aa7420098 100644
--- a/view/templates/filer_dialog.tpl
+++ b/view/templates/filer_dialog.tpl
@@ -1,5 +1,5 @@
 
 {{include file="field_combobox.tpl"}}
-<div class="settings-submit-wrapper" >
+<div class="settings-submit-wrapper">
 	<input id="filer_save" type="button" class="settings-submit" value="{{$submit}}" />
 </div>
diff --git a/view/templates/group_drop.tpl b/view/templates/group_drop.tpl
index b9a6953d8..e28411d03 100644
--- a/view/templates/group_drop.tpl
+++ b/view/templates/group_drop.tpl
@@ -1,5 +1,5 @@
 
-<div class="group-delete-wrapper button" id="group-delete-wrapper-{{$id}}" >
+<div class="group-delete-wrapper button" id="group-delete-wrapper-{{$id}}">
 	<a href="group/drop/{{$id}}?t={{$form_security_token}}"
 		onclick="return confirmDelete();"
 		id="group-delete-icon-{{$id}}"
diff --git a/view/templates/group_edit.tpl b/view/templates/group_edit.tpl
index cc12bc736..1984dc197 100644
--- a/view/templates/group_edit.tpl
+++ b/view/templates/group_edit.tpl
@@ -3,16 +3,16 @@
 
 
 {{if $editable == 1}}
-<div id="group-edit-wrapper" >
-	<form action="group/{{$gid}}" id="group-edit-form" method="post" >
+<div id="group-edit-wrapper">
+	<form action="group/{{$gid}}" id="group-edit-form" method="post">
 		<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
 		
 		{{include file="field_input.tpl" field=$gname}}
 		{{if $drop}}{{$drop nofilter}}{{/if}}
-		<div id="group-edit-submit-wrapper" >
-			<input type="submit" name="submit" value="{{$submit}}" >
+		<div id="group-edit-submit-wrapper">
+			<input type="submit" name="submit" value="{{$submit}}">
 		</div>
-		<div id="group-edit-select-end" ></div>
+		<div id="group-edit-select-end"></div>
 	</form>
 </div>
 {{/if}}
diff --git a/view/templates/group_selection.tpl b/view/templates/group_selection.tpl
index 52546af2a..7d01df7a7 100644
--- a/view/templates/group_selection.tpl
+++ b/view/templates/group_selection.tpl
@@ -1,9 +1,9 @@
 
 <div class="field custom">
 <label for="group-selection" id="group-selection-lbl">{{$label}}</label>
-<select name="group-selection" id="group-selection" >
+<select name="group-selection" id="group-selection">
 {{foreach $groups as $group}}
-<option value="{{$group.id}}" {{if $group.selected}}selected="selected"{{/if}} >{{$group.name}}</option>
+<option value="{{$group.id}}"{{if $group.selected}} selected="selected"{{/if}}>{{$group.name}}</option>
 {{/foreach}}
 </select>
 </div>
diff --git a/view/templates/head.tpl b/view/templates/head.tpl
index 1decacd5d..5ba9e47a3 100644
--- a/view/templates/head.tpl
+++ b/view/templates/head.tpl
@@ -32,19 +32,19 @@
 <!--[if IE]>
 <script type="text/javascript" src="https://html5shiv.googlecode.com/svn/trunk/html5.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <![endif]-->
-<script type="text/javascript" src="view/js/modernizr.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
-<script type="text/javascript" src="view/asset/jquery/dist/jquery.min.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
-<script type="text/javascript" src="view/js/jquery.textinputs.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
-<script type="text/javascript" src="view/asset/textcomplete/dist/textcomplete.min.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
-<script type="text/javascript" src="view/js/autocomplete.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
+<script type="text/javascript" src="view/js/modernizr.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<script type="text/javascript" src="view/asset/jquery/dist/jquery.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<script type="text/javascript" src="view/js/jquery.textinputs.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<script type="text/javascript" src="view/asset/textcomplete/dist/textcomplete.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<script type="text/javascript" src="view/js/autocomplete.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script type="text/javascript" src="view/asset/jquery-colorbox/jquery.colorbox-min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script type="text/javascript" src="view/asset/jgrowl/jquery.jgrowl.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script type="text/javascript" src="view/asset/jquery-datetimepicker/build/jquery.datetimepicker.full.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<script type="text/javascript" src="view/asset/perfect-scrollbar/dist/js/perfect-scrollbar.jquery.min.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
+<script type="text/javascript" src="view/asset/perfect-scrollbar/dist/js/perfect-scrollbar.jquery.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script type="text/javascript" src="view/asset/imagesloaded/imagesloaded.pkgd.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<script type="text/javascript" src="view/asset/base64/base64.min.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
+<script type="text/javascript" src="view/asset/base64/base64.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script type="text/javascript" src="view/asset/dompurify/dist/purify.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<script type="text/javascript" src="view/js/main.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
+<script type="text/javascript" src="view/js/main.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script>
 
 	// Lifted from https://css-tricks.com/snippets/jquery/move-cursor-to-end-of-textarea-or-input/
diff --git a/view/templates/hovercard.tpl b/view/templates/hovercard.tpl
index 4f41c204e..862871dca 100644
--- a/view/templates/hovercard.tpl
+++ b/view/templates/hovercard.tpl
@@ -1,4 +1,4 @@
-<div class="basic-content" >
+<div class="basic-content">
 	<div class="hover-card-details">
 		<div class="hover-card-header left-align">
 			<div class="hover-card-pic left-align">
diff --git a/view/templates/invite.tpl b/view/templates/invite.tpl
index 6f161fd4f..6ce9d5146 100644
--- a/view/templates/invite.tpl
+++ b/view/templates/invite.tpl
@@ -1,5 +1,5 @@
 
-<form action="invite" method="post" id="invite-form" >
+<form action="invite" method="post" id="invite-form">
 
 	<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
 
diff --git a/view/templates/jot-header.tpl b/view/templates/jot-header.tpl
index db2e893e9..ba186bc82 100644
--- a/view/templates/jot-header.tpl
+++ b/view/templates/jot-header.tpl
@@ -40,7 +40,7 @@ function enableOnUser(){
 }
 
 </script>
-<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
+<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script>
 	var ispublic = '{{$ispublic nofilter}}';
 
diff --git a/view/templates/jot.tpl b/view/templates/jot.tpl
index c0f463e48..167e47da5 100644
--- a/view/templates/jot.tpl
+++ b/view/templates/jot.tpl
@@ -1,11 +1,11 @@
-<div id="profile-jot-wrapper" >
+<div id="profile-jot-wrapper">
 	<div id="profile-jot-banner-wrapper">
-		<div id="profile-jot-desc" >&nbsp;</div>
+		<div id="profile-jot-desc">&nbsp;</div>
 		<div id="character-counter" class="grey"></div>
 	</div>
 	<div id="profile-jot-banner-end"></div>
 
-	<form id="profile-jot-form" action="{{$action}}" method="post" >
+	<form id="profile-jot-form" action="{{$action}}" method="post">
 		<input type="hidden" name="wall" value="{{$wall}}" />
 		<input type="hidden" name="post_type" value="{{$posttype}}" />
 		<input type="hidden" name="profile_uid" value="{{$profile_uid}}" />
@@ -30,31 +30,31 @@
 <div id="profile-jot-submit-wrapper" class="jothidden">
 	<input type="submit" id="profile-jot-submit" name="submit" value="{{$share}}" />
 
-	<div id="profile-upload-wrapper" style="display: {{$visitor}};" >
-		<div id="wall-image-upload-div" ><a href="#" onclick="return false;" id="wall-image-upload" class="icon camera" title="{{$upload}}"></a></div>
+	<div id="profile-upload-wrapper" style="display: {{$visitor}};">
+		<div id="wall-image-upload-div"><a href="#" onclick="return false;" id="wall-image-upload" class="icon camera" title="{{$upload}}"></a></div>
 	</div>
-	<div id="profile-attach-wrapper" style="display: {{$visitor}};" >
-		<div id="wall-file-upload-div" ><a href="#" onclick="return false;" id="wall-file-upload" class="icon attach" title="{{$attach}}"></a></div>
+	<div id="profile-attach-wrapper" style="display: {{$visitor}};">
+		<div id="wall-file-upload-div"><a href="#" onclick="return false;" id="wall-file-upload" class="icon attach" title="{{$attach}}"></a></div>
 	</div>
 
-	<div id="profile-link-wrapper" style="display: {{$visitor}};" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" >
+	<div id="profile-link-wrapper" style="display: {{$visitor}};" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);">
 		<a id="profile-link" class="icon link" title="{{$weblink}}" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"></a>
 	</div>
-	<div id="profile-video-wrapper" style="display: {{$visitor}};" >
+	<div id="profile-video-wrapper" style="display: {{$visitor}};">
 		<a id="profile-video" class="icon video" title="{{$video}}" onclick="jotVideoURL();return false;"></a>
 	</div>
-	<div id="profile-audio-wrapper" style="display: {{$visitor}};" >
+	<div id="profile-audio-wrapper" style="display: {{$visitor}};">
 		<a id="profile-audio" class="icon audio" title="{{$audio}}" onclick="jotAudioURL();return false;"></a>
 	</div>
-	<div id="profile-location-wrapper" style="display: {{$visitor}};" >
+	<div id="profile-location-wrapper" style="display: {{$visitor}};">
 		<a id="profile-location" class="icon globe" title="{{$setloc}}" onclick="jotGetLocation();return false;"></a>
 	</div>
-	<div id="profile-nolocation-wrapper" style="display: none;" >
+	<div id="profile-nolocation-wrapper" style="display: none;">
 		<a id="profile-nolocation" class="icon noglobe" title="{{$noloc}}" onclick="jotClearLocation();return false;"></a>
 	</div>
 
-	<div id="profile-jot-perms" class="profile-jot-perms" style="display: {{$pvisit}};" >
-		<a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon {{$lockstate}}"  title="{{$permset}}" ></a>{{$bang}}
+	<div id="profile-jot-perms" class="profile-jot-perms" style="display: {{$pvisit}};">
+		<a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon {{$lockstate}}"  title="{{$permset}}"></a>{{$bang}}
 	</div>
 
 	<!-- {{if $preview}}<span onclick="preview_post();" id="jot-preview-link" class="fakelink">{{$preview}}</span>{{/if}} -->
@@ -67,7 +67,7 @@
 	{{$jotplugins nofilter}}
 	</div>
 
-	<div id="profile-rotator-wrapper" style="display: {{$visitor}};" >
+	<div id="profile-rotator-wrapper" style="display: {{$visitor}};">
 		<img id="profile-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
 	</div>
 
diff --git a/view/templates/login.tpl b/view/templates/login.tpl
index 733c21816..cfca19317 100644
--- a/view/templates/login.tpl
+++ b/view/templates/login.tpl
@@ -1,6 +1,6 @@
 
 
-<form id="login-form" action="{{$dest_url}}" role="form" method="post" >
+<form id="login-form" action="{{$dest_url}}" role="form" method="post">
 <div id="login-group" role="group" aria-labelledby="login-head">
 	<input type="hidden" name="auth-params" value="login" />
 
@@ -10,7 +10,7 @@
 	{{include file="field_input.tpl" field=$lname}}
 	{{include file="field_password.tpl" field=$lpassword}}
 	<div id="login-lost-password-link">
-		<a href="lostpass" title="{{$lostpass}}" id="lost-password-link" >{{$lostlink}}</a>
+		<a href="lostpass" title="{{$lostpass}}" id="lost-password-link">{{$lostlink}}</a>
 	</div>
 	</div>
 	
@@ -20,7 +20,7 @@
 		</div>
 	{{/if}}
 
-	<div id="login-submit-wrapper" >
+	<div id="login-submit-wrapper">
 		<input type="submit" name="submit" id="login-submit-button" value="{{$login}}" />
 	</div>
 
diff --git a/view/templates/logout.tpl b/view/templates/logout.tpl
index ba66f831c..df5df0dbd 100644
--- a/view/templates/logout.tpl
+++ b/view/templates/logout.tpl
@@ -1,5 +1,5 @@
 
-<form action="{{$dest_url}}" method="post" >
+<form action="{{$dest_url}}" method="post">
 <div class="logout-wrapper">
 <input type="hidden" name="auth-params" value="logout" />
 <input type="submit" name="submit" id="logout-button" value="{{$logout}}" />
diff --git a/view/templates/lostpass.tpl b/view/templates/lostpass.tpl
index 3c4f42219..4348d9ef8 100644
--- a/view/templates/lostpass.tpl
+++ b/view/templates/lostpass.tpl
@@ -5,13 +5,13 @@
 {{$desc nofilter}}
 </p>
 
-<form action="lostpass" method="post" >
+<form action="lostpass" method="post">
 <div id="login-name-wrapper">
         <label for="login-name" id="label-login-name">{{$name}}</label>
         <input type="text" maxlength="60" name="login-name" id="login-name" value="" />
 </div>
 <div id="login-extra-end"></div>
-<div id="login-submit-wrapper" >
+<div id="login-submit-wrapper">
         <input type="submit" name="submit" id="lostpass-submit-button" value="{{$submit}}" />
 </div>
 <div id="login-submit-end"></div>
diff --git a/view/templates/mail_conv.tpl b/view/templates/mail_conv.tpl
index 905bf3625..588f2509a 100644
--- a/view/templates/mail_conv.tpl
+++ b/view/templates/mail_conv.tpl
@@ -1,14 +1,14 @@
 
 <div class="mail-conv-outside-wrapper">
-	<div class="mail-conv-sender" >
-		<a href="{{$mail.from_url}}" title="{{$mail.from_addr}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" /></a>
+	<div class="mail-conv-sender">
+		<a href="{{$mail.from_url}}" title="{{$mail.from_addr}}" class="mail-conv-sender-url"><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" /></a>
 	</div>
-	<div class="mail-conv-detail" >
-		<div class="mail-conv-sender-name" >{{$mail.from_name}}</div>
+	<div class="mail-conv-detail">
+		<div class="mail-conv-sender-name">{{$mail.from_name}}</div>
 		<div class="mail-conv-date">{{$mail.date}}</div>
 		<div class="mail-conv-subject">{{$mail.subject}}</div>
 		<div class="mail-conv-body">{{$mail.body nofilter}}</div>
-	<div class="mail-conv-delete-wrapper" id="mail-conv-delete-wrapper-{{$mail.id}}" ><a href="message/drop/{{$mail.id}}" class="icon drophide delete-icon mail-list-delete-icon" onclick="return confirmDelete();" title="{{$mail.delete}}" id="mail-conv-delete-icon-{{$mail.id}}" class="mail-conv-delete-icon" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a></div><div class="mail-conv-delete-end"></div>
+	<div class="mail-conv-delete-wrapper" id="mail-conv-delete-wrapper-{{$mail.id}}"><a href="message/drop/{{$mail.id}}" class="icon drophide delete-icon mail-list-delete-icon" onclick="return confirmDelete();" title="{{$mail.delete}}" id="mail-conv-delete-icon-{{$mail.id}}" class="mail-conv-delete-icon" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></a></div><div class="mail-conv-delete-end"></div>
 	<div class="mail-conv-outside-wrapper-end"></div>
 </div>
 </div>
diff --git a/view/templates/mail_list.tpl b/view/templates/mail_list.tpl
index 04f23a371..1c3b8c229 100644
--- a/view/templates/mail_list.tpl
+++ b/view/templates/mail_list.tpl
@@ -1,14 +1,14 @@
 
 <div class="mail-list-outside-wrapper">
-	<div class="mail-list-sender" >
-		<a href="{{$from_url}}" title="{{$from_addr}}" class="mail-list-sender-url" ><img class="mail-list-sender-photo{{$sparkle}}" src="{{$from_photo}}" height="80" width="80" alt="{{$from_name}}" title="{{$from_addr}}" /></a>
+	<div class="mail-list-sender">
+		<a href="{{$from_url}}" title="{{$from_addr}}" class="mail-list-sender-url"><img class="mail-list-sender-photo{{$sparkle}}" src="{{$from_photo}}" height="80" width="80" alt="{{$from_name}}" title="{{$from_addr}}" /></a>
 	</div>
 	<div class="mail-list-detail">
-		<div class="mail-list-sender-name" >{{$from_name}}</div>
+		<div class="mail-list-sender-name">{{$from_name}}</div>
 		<div class="mail-list-date">{{$date}}</div>
 		<div class="mail-list-subject"><a href="message/{{$id}}" class="mail-list-link">{{$subject}}</a></div>
-	<div class="mail-list-delete-wrapper" id="mail-list-delete-wrapper-{{$id}}" >
-		<a href="message/dropconv/{{$id}}" onclick="return confirmDelete();"  title="{{$delete}}" class="icon drophide mail-list-delete	delete-icon" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a>
+	<div class="mail-list-delete-wrapper" id="mail-list-delete-wrapper-{{$id}}">
+		<a href="message/dropconv/{{$id}}" onclick="return confirmDelete();"  title="{{$delete}}" class="icon drophide mail-list-delete	delete-icon" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></a>
 	</div>
 </div>
 </div>
diff --git a/view/templates/micropro_img.tpl b/view/templates/micropro_img.tpl
index ff0ff15e6..8c2228089 100644
--- a/view/templates/micropro_img.tpl
+++ b/view/templates/micropro_img.tpl
@@ -1,6 +1,6 @@
 
-<div class="contact-block-div {{if $class}}{{$class}}{{/if}}">
-	<a class="contact-block-link {{if $class}}{{$class }}{{/if}} {{if $sparkle}}sparkle{{/if}} {{if $click}}fakelink{{/if}}" {{if $redir}}target="redir"{{/if}} {{if $url}}href="{{$url}}"{{/if}} {{if $click}}onclick="{{$click}}"{{/if}} >
-		<img class="contact-block-img {{if $class}}{{$class }}{{/if}} {{if $sparkle}}sparkle{{/if}}" src="{{$photo}}" title="{{$title}}" alt="{{$name}}" />
+<div class="contact-block-div{{if $class}} {{$class}}{{/if}}">
+	<a class="contact-block-link{{if $class}} {{$class }}{{/if}}{{if $sparkle}} sparkle{{/if}}{{if $click}} fakelink{{/if}}"{{if $redir}} target="redir"{{/if}}{{if $url}} href="{{$url}}"{{/if}}{{if $click}} onclick="{{$click}}"{{/if}}>
+		<img class="contact-block-img{{if $class}} {{$class }}{{/if}}{{if $sparkle}} sparkle{{/if}}" src="{{$photo}}" title="{{$title}}" alt="{{$name}}"/>
 	</a>
 </div>
diff --git a/view/templates/msg-header.tpl b/view/templates/msg-header.tpl
index 1e1d51661..d37287800 100644
--- a/view/templates/msg-header.tpl
+++ b/view/templates/msg-header.tpl
@@ -1,7 +1,7 @@
 <script language="javascript" type="text/javascript">
 	$("#prvmail-text").editor_autocomplete(baseurl + '/search/acl');
 </script>
-<script type="text/javascript" src="view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
+<script type="text/javascript" src="view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 <script>
 	$(document).ready(function() {
 		var uploader = new window.AjaxUpload(
diff --git a/view/templates/nav.tpl b/view/templates/nav.tpl
index 07e9469a8..fbce697ea 100644
--- a/view/templates/nav.tpl
+++ b/view/templates/nav.tpl
@@ -4,41 +4,41 @@
 
 	<div id="site-location">{{$sitelocation}}</div>
 
-	{{if $nav.logout}}<a id="nav-logout-link" class="nav-link {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" >{{$nav.logout.1}}</a> {{/if}}
-	{{if $nav.login}}<a id="nav-login-link" class="nav-login-link {{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}" >{{$nav.login.1}}</a> {{/if}}
+	{{if $nav.logout}}<a id="nav-logout-link" class="nav-link {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}">{{$nav.logout.1}}</a> {{/if}}
+	{{if $nav.login}}<a id="nav-login-link" class="nav-login-link {{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}">{{$nav.login.1}}</a> {{/if}}
 
-	<span id="nav-link-wrapper" >
+	<span id="nav-link-wrapper">
 
-	{{if $nav.register}}<a id="nav-register-link" class="nav-commlink {{$nav.register.2}} {{$sel.register}}" href="{{$nav.register.0}}" title="{{$nav.register.3}}" >{{$nav.register.1}}</a>{{/if}}
+	{{if $nav.register}}<a id="nav-register-link" class="nav-commlink {{$nav.register.2}} {{$sel.register}}" href="{{$nav.register.0}}" title="{{$nav.register.3}}">{{$nav.register.1}}</a>{{/if}}
 		
-	{{if $nav.help}} <a id="nav-help-link" class="nav-link {{$nav.help.2}}" target="friendica-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" >{{$nav.help.1}}</a>{{/if}}
+	{{if $nav.help}} <a id="nav-help-link" class="nav-link {{$nav.help.2}}" target="friendica-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}">{{$nav.help.1}}</a>{{/if}}
 
-	{{if $nav.tos}} <a id="nav-tos-link" class="nav-link {{$nav.tos.2}}" href="{{$nav.tos.0}}" title="{{$nav.tos.3}}" >{{$nav.tos.1}}</a>{{/if}}
+	{{if $nav.tos}} <a id="nav-tos-link" class="nav-link {{$nav.tos.2}}" href="{{$nav.tos.0}}" title="{{$nav.tos.3}}">{{$nav.tos.1}}</a>{{/if}}
 		
-	{{if $nav.apps}}<a id="nav-apps-link" class="nav-link {{$nav.apps.2}}" href="{{$nav.apps.0}}" title="{{$nav.apps.3}}" >{{$nav.apps.1}}</a>{{/if}}
+	{{if $nav.apps}}<a id="nav-apps-link" class="nav-link {{$nav.apps.2}}" href="{{$nav.apps.0}}" title="{{$nav.apps.3}}">{{$nav.apps.1}}</a>{{/if}}
 
-	<a accesskey="s" id="nav-search-link" class="nav-link {{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}" >{{$nav.search.1}}</a>
-	<a id="nav-directory-link" class="nav-link {{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}" >{{$nav.directory.1}}</a>
+	<a accesskey="s" id="nav-search-link" class="nav-link {{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}">{{$nav.search.1}}</a>
+	<a id="nav-directory-link" class="nav-link {{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}">{{$nav.directory.1}}</a>
 
-	{{if $nav.admin}}<a accesskey="a" id="nav-admin-link" class="nav-link {{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" >{{$nav.admin.1}}</a>{{/if}}
+	{{if $nav.admin}}<a accesskey="a" id="nav-admin-link" class="nav-link {{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}">{{$nav.admin.1}}</a>{{/if}}
 
 	{{if $nav.network}}
-	<a accesskey="n" id="nav-network-link" class="nav-commlink {{$nav.network.2}} {{$sel.network}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}" >{{$nav.network.1}}</a>
+	<a accesskey="n" id="nav-network-link" class="nav-commlink {{$nav.network.2}} {{$sel.network}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}">{{$nav.network.1}}</a>
 	<span id="net-update" class="nav-ajax-left"></span>
 	{{/if}}
 	{{if $nav.home}}
-	<a accesskey="p" id="nav-home-link" class="nav-commlink {{$nav.home.2}} {{$sel.home}}" href="{{$nav.home.0}}" title="{{$nav.home.3}}" >{{$nav.home.1}}</a>
+	<a accesskey="p" id="nav-home-link" class="nav-commlink {{$nav.home.2}} {{$sel.home}}" href="{{$nav.home.0}}" title="{{$nav.home.3}}">{{$nav.home.1}}</a>
 	<span id="home-update" class="nav-ajax-left"></span>
 	{{/if}}
 	{{if $nav.community}}
-	<a accesskey="c" id="nav-community-link" class="nav-commlink {{$nav.community.2}} {{$sel.community}}" href="{{$nav.community.0}}" title="{{$nav.community.3}}" >{{$nav.community.1}}</a>
+	<a accesskey="c" id="nav-community-link" class="nav-commlink {{$nav.community.2}} {{$sel.community}}" href="{{$nav.community.0}}" title="{{$nav.community.3}}">{{$nav.community.1}}</a>
 	{{/if}}
 	{{if $nav.introductions}}
-	<a id="nav-notification-link" class="nav-commlink {{$nav.introductions.2}} {{$sel.introductions}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}" >{{$nav.introductions.1}}</a>
+	<a id="nav-notification-link" class="nav-commlink {{$nav.introductions.2}} {{$sel.introductions}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}">{{$nav.introductions.1}}</a>
 	<span id="intro-update" class="nav-ajax-left"></span>
 	{{/if}}
 	{{if $nav.messages}}
-	<a id="nav-messages-link" class="nav-commlink {{$nav.messages.2}} {{$sel.messages}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}" >{{$nav.messages.1}}</a>
+	<a id="nav-messages-link" class="nav-commlink {{$nav.messages.2}} {{$sel.messages}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}">{{$nav.messages.1}}</a>
 	<span id="mail-update" class="nav-ajax-left"></span>
 	{{/if}}
 
@@ -58,9 +58,9 @@
 		{{/if}}		
 
 	{{if $nav.settings}}<a id="nav-settings-link" class="nav-link {{$nav.settings.2}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}">{{$nav.settings.1}}</a>{{/if}}
-	{{if $nav.profiles}}<a id="nav-profiles-link" class="nav-link {{$nav.profiles.2}}" href="{{$nav.profiles.0}}" title="{{$nav.profiles.3}}" >{{$nav.profiles.1}}</a>{{/if}}
+	{{if $nav.profiles}}<a id="nav-profiles-link" class="nav-link {{$nav.profiles.2}}" href="{{$nav.profiles.0}}" title="{{$nav.profiles.3}}">{{$nav.profiles.1}}</a>{{/if}}
 
-	{{if $nav.contacts}}<a id="nav-contacts-link" class="nav-link {{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}" >{{$nav.contacts.1}}</a>{{/if}}
+	{{if $nav.contacts}}<a id="nav-contacts-link" class="nav-link {{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}">{{$nav.contacts.1}}</a>{{/if}}
 	</span>
 	<span id="nav-end"></span>
 	<span id="banner">{{$banner nofilter}}</span>
diff --git a/view/templates/notifications/intros.tpl b/view/templates/notifications/intros.tpl
index 3943e7232..97e74d460 100644
--- a/view/templates/notifications/intros.tpl
+++ b/view/templates/notifications/intros.tpl
@@ -1,6 +1,6 @@
 <h2>{{$header}}</h2>
 
-<div class="intro-wrapper" id="intro-{{$contact_id}}" >
+<div class="intro-wrapper" id="intro-{{$contact_id}}">
 
 <p class="intro-desc">{{$str_notification_type}} {{$str_type}}</p>
 <img id="photo-{{$contact_id}}" class="intro-photo" src="{{$photo}}" width="175" height=175" title="{{$fullname}}" alt="{{$fullname}}" />
@@ -25,9 +25,9 @@
 	{{include file="field_radio.tpl" field=$follower}}
 </div>
 
-<input type="hidden" name="dfrn_id" value="{{$dfrn_id}}" >
-<input type="hidden" name="intro_id" value="{{$intro_id}}" >
-<input type="hidden" name="contact_id" value="{{$contact_id}}" >
+<input type="hidden" name="dfrn_id" value="{{$dfrn_id}}">
+<input type="hidden" name="intro_id" value="{{$intro_id}}">
+<input type="hidden" name="contact_id" value="{{$contact_id}}">
 
 <input class="intro-submit-approve" type="submit" name="submit" value="{{$approve}}" />
 </form>
diff --git a/view/templates/notifications/netfriend.tpl b/view/templates/notifications/netfriend.tpl
index 465d7eb2b..51b2c40f5 100644
--- a/view/templates/notifications/netfriend.tpl
+++ b/view/templates/notifications/netfriend.tpl
@@ -8,7 +8,7 @@
 <div class="intro-approve-as-friend-wrapper">
 	<label class="intro-approve-as-friend-label" for="intro-approve-as-friend-{{$intro_id}}">{{$as_friend}}</label>
 	<input type="radio" name="duplex" id="intro-approve-as-friend-{{$intro_id}}" class="intro-approve-as-friend" {{$friend_selected}} value="1" />
-	<div class="intro-approve-friend-break" ></div>	
+	<div class="intro-approve-friend-break"></div>
 </div>
 <div class="intro-approve-as-friend-end"></div>
 <div class="intro-approve-as-fan-wrapper">
diff --git a/view/templates/notifications/suggestions.tpl b/view/templates/notifications/suggestions.tpl
index d0c013ac5..4ecc39d81 100644
--- a/view/templates/notifications/suggestions.tpl
+++ b/view/templates/notifications/suggestions.tpl
@@ -1,12 +1,12 @@
 
 
-<div class="intro-wrapper" >
+<div class="intro-wrapper">
 
 <p class="intro-desc">{{$str_notification_type}} {{$str_type}}</p>
 {{if $madeby}}<div class="intro-madeby">{{$lbl_madeby}} {{$madeby}}</div>{{/if}}
-<div class="intro-fullname" >{{$fullname}}</div>
-<a class="intro-url-link" href="{{$url}}" ><img class="intro-photo lframe" src="{{$photo}}" width="175" height="175" title="{{$fullname}}" alt="{{$fullname}}" /></a>
-<div class="intro-note" >{{$note}}</div>
+<div class="intro-fullname">{{$fullname}}</div>
+<a class="intro-url-link" href="{{$url}}"><img class="intro-photo lframe" src="{{$photo}}" width="175" height="175" title="{{$fullname}}" alt="{{$fullname}}" /></a>
+<div class="intro-note">{{$note}}</div>
 <div class="intro-wrapper-end"></div>
 <form class="intro-form" action="notification/{{$intro_id}}" method="post">
 <input class="intro-submit-ignore" type="submit" name="submit" value="{{$ignore}}" />
diff --git a/view/templates/oembed_video.tpl b/view/templates/oembed_video.tpl
index 52e11defd..3e8606ce5 100644
--- a/view/templates/oembed_video.tpl
+++ b/view/templates/oembed_video.tpl
@@ -1,4 +1,4 @@
-<a class="embed_video" href="{{$embedurl}}" onclick='this.innerHTML=window.atob("{{$escapedhtml}}"); this.classList.add("active"); return false;'>
-	<img width='{{$tw}}' height='{{$th}}' src='{{$turl}}' >
-	<div style='width: {{$tw}}px; height: {{$th}}px;'></div>
+<a class="embed_video" href="{{$embedurl}}" onclick="this.innerHTML=window.atob('{{$escapedhtml}}'); this.classList.add('active'); return false;">
+	<img width="{{$tw}}" height="{{$th}}" src="{{$turl}}">
+	<div style="width: {{$tw}}px; height: {{$th}}px;"></div>
 </a>
diff --git a/view/templates/photo_album.tpl b/view/templates/photo_album.tpl
index 724a2abb3..653284701 100644
--- a/view/templates/photo_album.tpl
+++ b/view/templates/photo_album.tpl
@@ -6,9 +6,9 @@
 {{if $drop}}
 <div id="album-drop-link"><a href="{{$drop.1}}" title="{{$drop.0}}">{{$drop.0}}</a></div>
 {{/if}}
-<div class="photos-upload-link" ><a href="{{$order.1}}" title="{{$order.0}}">{{$order.0}}</a></div>
+<div class="photos-upload-link"><a href="{{$order.1}}" title="{{$order.0}}">{{$order.0}}</a></div>
 {{if $can_post}}
-<div class="photos-upload-link" ><a href="{{$upload.1}}">{{$upload.0}}</a></div>
+<div class="photos-upload-link"><a href="{{$upload.1}}">{{$upload.0}}</a></div>
 {{/if}}
 
 {{foreach $photos as $photo}}
diff --git a/view/templates/photo_albums.tpl b/view/templates/photo_albums.tpl
index 934e818ec..86b468e06 100644
--- a/view/templates/photo_albums.tpl
+++ b/view/templates/photo_albums.tpl
@@ -2,7 +2,7 @@
 	<h3>{{$title}}</h3>
 	<ul role="menubar" class="sidebar-photos-albums-ul">
 		<li role="menuitem" class="sidebar-photos-albums-li">
-			<a href="{{$baseurl}}/photos/{{$nick}}" class="sidebar-photos-albums-element" title="{{$title}}" >{{$recent}}</a>
+			<a href="{{$baseurl}}/photos/{{$nick}}" class="sidebar-photos-albums-element" title="{{$title}}">{{$recent}}</a>
 		</li>
 
 		{{if $albums}}
@@ -19,6 +19,6 @@
 	</ul>
 
 	{{if $can_post}}
-	<div class="photos-upload-link" ><a href="{{$upload.1}}">{{$upload.0}}</a></div>
+	<div class="photos-upload-link"><a href="{{$upload.1}}">{{$upload.0}}</a></div>
 	{{/if}}
 </div>
diff --git a/view/templates/photo_edit.tpl b/view/templates/photo_edit.tpl
index 49a550e42..512eaf73b 100644
--- a/view/templates/photo_edit.tpl
+++ b/view/templates/photo_edit.tpl
@@ -1,5 +1,5 @@
 
-<form action="photos/{{$nickname}}/image/{{$resource_id}}/edit" method="post" id="photo_edit_form" >
+<form action="photos/{{$nickname}}/image/{{$resource_id}}/edit" method="post" id="photo_edit_form">
 
 	<input type="hidden" name="item_id" value="{{$item_id}}" />
 	<input type="hidden" name="origaname" value="{{$album.2}}" />
@@ -12,14 +12,14 @@
 	{{include file="field_radio.tpl" field=$rotate_cw}}
 	{{include file="field_radio.tpl" field=$rotate_ccw}}
 
-	<div id="photo-edit-perms" class="photo-edit-perms" >
+	<div id="photo-edit-perms" class="photo-edit-perms">
 		<a href="#photo-edit-perms-select" id="photo-edit-perms-menu" class="button popupbox" title="{{$permissions}}">
-			<span id="jot-perms-icon" class="icon {{$lockstate}}" ></span>{{$permissions}}
+			<span id="jot-perms-icon" class="icon {{$lockstate}}"></span>{{$permissions}}
 		</a>
 		<div id="photo-edit-perms-menu-end"></div>
 
 		<div style="display: none;">
-			<div id="photo-edit-perms-select" >
+			<div id="photo-edit-perms-select">
 				{{$aclselect nofilter}}
 			</div>
 		</div>
diff --git a/view/templates/photo_top.tpl b/view/templates/photo_top.tpl
index 902f74232..08f436679 100644
--- a/view/templates/photo_top.tpl
+++ b/view/templates/photo_top.tpl
@@ -2,6 +2,6 @@
 	<a href="{{$photo.link}}" class="photo-top-photo-link" id="photo-top-photo-link-{{$photo.id}}" title="{{$photo.title}}">
 		<img src="{{$photo.src}}" alt="{{$photo.alt}}" title="{{$photo.title}}" class="photo-top-photo{{$photo.twist}}" id="photo-top-photo-{{$photo.id}}" />
 	</a>
-	<div class="photo-top-album-name"><a href="{{$photo.album.link}}" class="photo-top-album-link" title="{{$photo.album.alt}}" >{{$photo.album.name}}</a></div>
+	<div class="photo-top-album-name"><a href="{{$photo.album.link}}" class="photo-top-album-link" title="{{$photo.album.alt}}">{{$photo.album.name}}</a></div>
 </div>
 
diff --git a/view/templates/photos_default_uploader_submit.tpl b/view/templates/photos_default_uploader_submit.tpl
index e178e977a..586ae58db 100644
--- a/view/templates/photos_default_uploader_submit.tpl
+++ b/view/templates/photos_default_uploader_submit.tpl
@@ -1,4 +1,4 @@
 
-<div class="photos-upload-submit-wrapper" >
+<div class="photos-upload-submit-wrapper">
 	<input type="submit" name="submit" value="{{$submit}}" id="photos-upload-submit" />
 </div>
diff --git a/view/templates/photos_upload.tpl b/view/templates/photos_upload.tpl
index 054fd1a33..5c5727bcc 100644
--- a/view/templates/photos_upload.tpl
+++ b/view/templates/photos_upload.tpl
@@ -3,10 +3,10 @@
 
 <div id="photos-usage-message">{{$usage}}</div>
 
-<form action="photos/{{$nickname}}" enctype="multipart/form-data" method="post" name="photos-upload-form" id="photos-upload-form" >
-	<div id="photos-upload-new-wrapper" >
+<form action="photos/{{$nickname}}" enctype="multipart/form-data" method="post" name="photos-upload-form" id="photos-upload-form">
+	<div id="photos-upload-new-wrapper">
 		<div id="photos-upload-newalbum-div">
-			<label id="photos-upload-newalbum-text" for="photos-upload-newalbum" >{{$newalbum}}</label>
+			<label id="photos-upload-newalbum-text" for="photos-upload-newalbum">{{$newalbum}}</label>
 		</div>
 		<input id="photos-upload-newalbum" type="text" name="newalbum" />
 	</div>
@@ -19,15 +19,15 @@
 	</div>
 	<div id="photos-upload-exist-end"></div>
 
-	<div id="photos-upload-noshare-div" class="photos-upload-noshare-div" >
+	<div id="photos-upload-noshare-div" class="photos-upload-noshare-div">
 		<input id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" checked/>
-		<label id="photos-upload-noshare-text" for="photos-upload-noshare" >{{$nosharetext}}</label>
+		<label id="photos-upload-noshare-text" for="photos-upload-noshare">{{$nosharetext}}</label>
 	</div>
 
 
-	<div id="photos-upload-perms" class="photos-upload-perms" >
+	<div id="photos-upload-perms" class="photos-upload-perms">
 		<a href="#photos-upload-permissions-wrapper" id="photos-upload-perms-menu" class="button popupbox" />
-		<span id="jot-perms-icon" class="icon {{$lockstate}}" ></span>{{$permissions}}
+		<span id="jot-perms-icon" class="icon {{$lockstate}}"></span>{{$permissions}}
 		</a>
 	</div>
 	<div id="photos-upload-perms-end"></div>
@@ -45,6 +45,6 @@
 	{{$default_upload_box nofilter}}
 	{{$default_upload_submit nofilter}}
 
-	<div class="photos-upload-end" ></div>
+	<div class="photos-upload-end"></div>
 </form>
 
diff --git a/view/templates/profile/publish.tpl b/view/templates/profile/publish.tpl
index a62292ff5..4ab8550f5 100644
--- a/view/templates/profile/publish.tpl
+++ b/view/templates/profile/publish.tpl
@@ -7,7 +7,7 @@
 		<label id="profile-publish-yes-label-{{$instance}}" for="profile-publish-yes-{{$instance}}">{{$str_yes}}</label>
 		<input type="radio" name="profile_publish_{{$instance}}" id="profile-publish-yes-{{$instance}}" {{$yes_selected}} value="1" />
 
-		<div id="profile-publish-break-{{$instance}}" ></div>	
+		<div id="profile-publish-break-{{$instance}}"></div>
 		</div>
 		<div id="profile-publish-no-wrapper-{{$instance}}">
 		<label id="profile-publish-no-label-{{$instance}}" for="profile-publish-no-{{$instance}}">{{$str_no}}</label>
diff --git a/view/templates/prv_message.tpl b/view/templates/prv_message.tpl
index 087d08dbb..c41f1d406 100644
--- a/view/templates/prv_message.tpl
+++ b/view/templates/prv_message.tpl
@@ -2,8 +2,8 @@
 
 <h3>{{$header}}</h3>
 
-<div id="prvmail-wrapper" >
-<form id="prvmail-form" action="message" method="post" >
+<div id="prvmail-wrapper">
+<form id="prvmail-form" action="message" method="post">
 
 {{$parent nofilter}}
 
@@ -17,15 +17,15 @@
 <textarea rows="8" cols="72" class="prvmail-text" id="prvmail-text" name="body" tabindex="12">{{$text}}</textarea>
 
 
-<div id="prvmail-submit-wrapper" >
+<div id="prvmail-submit-wrapper">
 	<input type="submit" id="prvmail-submit" name="submit" value="{{$submit}}" tabindex="13" />
-	<div id="prvmail-upload-wrapper" >
-		<div id="prvmail-upload" class="icon border camera" title="{{$upload}}" ></div>
+	<div id="prvmail-upload-wrapper">
+		<div id="prvmail-upload" class="icon border camera" title="{{$upload}}"></div>
 	</div> 
-	<div id="prvmail-link-wrapper" >
-		<div id="prvmail-link" class="icon border link" title="{{$insert}}" onclick="jotGetLink();" ></div>
+	<div id="prvmail-link-wrapper">
+		<div id="prvmail-link" class="icon border link" title="{{$insert}}" onclick="jotGetLink();"></div>
 	</div> 
-	<div id="prvmail-rotator-wrapper" >
+	<div id="prvmail-rotator-wrapper">
 		<img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
 	</div> 
 </div>
diff --git a/view/templates/register.tpl b/view/templates/register.tpl
index d79da2d33..bf6c9e37a 100644
--- a/view/templates/register.tpl
+++ b/view/templates/register.tpl
@@ -13,40 +13,40 @@
 	<p id="register-fill-ext">{{$fillext}}</p>
 
 {{if $oidlabel}}
-	<div id="register-openid-wrapper" >
-	<label for="register-openid" id="label-register-openid" >{{$oidlabel}}</label><input type="text" maxlength="60" size="32" name="openid_url" class="openid" id="register-openid" value="{{$openid}}" >
+	<div id="register-openid-wrapper">
+	<label for="register-openid" id="label-register-openid">{{$oidlabel}}</label><input type="text" maxlength="60" size="32" name="openid_url" class="openid" id="register-openid" value="{{$openid}}">
 	</div>
-	<div id="register-openid-end" ></div>
+	<div id="register-openid-end"></div>
 {{/if}}
 
 {{if $invitations}}
 	<p id="register-invite-desc">{{$invite_desc nofilter}}</p>
-	<div id="register-invite-wrapper" >
-		<label for="register-invite" id="label-register-invite" >{{$invite_label}}</label>
-		<input type="text" maxlength="60" size="32" name="invite_id" id="register-invite" value="{{$invite_id}}" >
+	<div id="register-invite-wrapper">
+		<label for="register-invite" id="label-register-invite">{{$invite_label}}</label>
+		<input type="text" maxlength="60" size="32" name="invite_id" id="register-invite" value="{{$invite_id}}">
 	</div>
-	<div id="register-name-end" ></div>
+	<div id="register-name-end"></div>
 {{/if}}
 
-	<div id="register-name-wrapper" >
-		<label for="register-name" id="label-register-name" >{{$namelabel}}</label>
+	<div id="register-name-wrapper">
+		<label for="register-name" id="label-register-name">{{$namelabel}}</label>
 		<input type="text" maxlength="60" size="32" name="username" id="register-name" value="{{$username}}" required>
 	</div>
-	<div id="register-name-end" ></div>
+	<div id="register-name-end"></div>
 
 
 	{{if !$additional}}
-		<div id="register-email-wrapper" >
-			<label for="register-email" id="label-register-email" >{{$addrlabel}}</label>
+		<div id="register-email-wrapper">
+			<label for="register-email" id="label-register-email">{{$addrlabel}}</label>
 			<input type="text" maxlength="60" size="32" name="field1" id="register-email" value="{{$email}}" required>
 		</div>
-		<div id="register-email-end" ></div>
+		<div id="register-email-end"></div>
 
-		<div id="register-repeat-wrapper" >
-			<label for="register-repeat" id="label-register-repeat" >{{$addrlabel2}}</label>
+		<div id="register-repeat-wrapper">
+			<label for="register-repeat" id="label-register-repeat">{{$addrlabel2}}</label>
 			<input type="text" maxlength="60" size="32" name="repeat" id="register-repeat" value="" required>
 		</div>
-		<div id="register-repeat-end" ></div>
+		<div id="register-repeat-end"></div>
 	{{/if}}
 
 {{if $ask_password}}
@@ -54,13 +54,13 @@
 	{{include file="field_password.tpl" field=$password2}}
 {{/if}}
 
-	<p id="register-nickname-desc" >{{$nickdesc nofilter}}</p>
+	<p id="register-nickname-desc">{{$nickdesc nofilter}}</p>
 
-	<div id="register-nickname-wrapper" >
-		<label for="register-nickname" id="label-register-nickname" >{{$nicklabel}}</label>
+	<div id="register-nickname-wrapper">
+		<label for="register-nickname" id="label-register-nickname">{{$nicklabel}}</label>
 		<input type="text" maxlength="60" size="32" name="nickname" id="register-nickname" value="{{$nickname}}" required><div id="register-sitename">@{{$sitename}}</div>
 	</div>
-	<div id="register-nickname-end" ></div>
+	<div id="register-nickname-end"></div>
 
 	<input type="input" id=tarpit" name="email" style="display: none;" placeholder="Don't enter anything here"/>
 
@@ -87,7 +87,7 @@
 	<div id="register-submit-wrapper">
 		<input type="submit" name="submit" id="register-submit-button" value="{{$regbutt}}" />
 	</div>
-	<div id="register-submit-end" ></div>
+	<div id="register-submit-end"></div>
 
 	{{if !$additional}}
 		<h3>{{$importh}}</h3>
diff --git a/view/templates/removeme.tpl b/view/templates/removeme.tpl
index 1e52bfa4e..2f64483fd 100644
--- a/view/templates/removeme.tpl
+++ b/view/templates/removeme.tpl
@@ -5,7 +5,7 @@
 
 <div id="remove-account-desc">{{$desc nofilter}}</div>
 
-<form action="{{$basedir}}/removeme" autocomplete="off" method="post" >
+<form action="{{$basedir}}/removeme" autocomplete="off" method="post">
 <input type="hidden" name="verify" value="{{$hash}}" />
 
 <div id="remove-account-pass-wrapper">
diff --git a/view/templates/settings/nick_set.tpl b/view/templates/settings/nick_set.tpl
index a6dc4d74c..432c20d6c 100644
--- a/view/templates/settings/nick_set.tpl
+++ b/view/templates/settings/nick_set.tpl
@@ -2,4 +2,4 @@
 <div id="settings-nick-wrapper">
 	<div id="settings-nickname-desc" class="info-message">{{$desc nofilter}}</div>
 </div>
-<div id="settings-nick-end" ></div>
+<div id="settings-nick-end"></div>
diff --git a/view/templates/settings/oauth_edit.tpl b/view/templates/settings/oauth_edit.tpl
index eed9f6ea3..86eb7663d 100644
--- a/view/templates/settings/oauth_edit.tpl
+++ b/view/templates/settings/oauth_edit.tpl
@@ -10,7 +10,7 @@
 {{include file="field_input.tpl" field=$redirect}}
 {{include file="field_input.tpl" field=$icon}}
 
-<div class="settings-submit-wrapper" >
+<div class="settings-submit-wrapper">
 <input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
 <!-- <input type="submit" name="cancel" class="settings-submit" value="{{$cancel}}" /> -->
 </div>
diff --git a/view/templates/settings/profile/index_head.tpl b/view/templates/settings/profile/index_head.tpl
index c4dec1539..60b832bd8 100644
--- a/view/templates/settings/profile/index_head.tpl
+++ b/view/templates/settings/profile/index_head.tpl
@@ -1 +1 @@
-<script type="text/javascript" src="view/js/country.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
\ No newline at end of file
+<script type="text/javascript" src="view/js/country.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
\ No newline at end of file
diff --git a/view/templates/settings/profile/photo/crop.tpl b/view/templates/settings/profile/photo/crop.tpl
index 679c9d135..d3e4fbb4c 100644
--- a/view/templates/settings/profile/photo/crop.tpl
+++ b/view/templates/settings/profile/photo/crop.tpl
@@ -8,7 +8,7 @@
 		<p><img src="{{$image_url}}" id="croppa" class="imgCrop" alt="{{$title}}"></p>
 	</div>
 
-	<div id="cropimage-preview-wrapper" >
+	<div id="cropimage-preview-wrapper">
 		<div id="previewWrap" class="crop-preview"></div>
 	</div>
 
diff --git a/view/templates/settings/twofactor/recovery.tpl b/view/templates/settings/twofactor/recovery.tpl
index 8ecd0198d..60b1ed71b 100644
--- a/view/templates/settings/twofactor/recovery.tpl
+++ b/view/templates/settings/twofactor/recovery.tpl
@@ -18,7 +18,7 @@
 		<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
 		<div>{{$regenerate_message}}</div>
 
-		<div class="form-group pull-right settings-submit-wrapper" >
+		<div class="form-group pull-right settings-submit-wrapper">
 			<button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="regenerate">{{$regenerate_label}}</button>
 		</div>
 	</form>
diff --git a/view/templates/settings/twofactor/verify.tpl b/view/templates/settings/twofactor/verify.tpl
index 03138659e..8402b1d81 100644
--- a/view/templates/settings/twofactor/verify.tpl
+++ b/view/templates/settings/twofactor/verify.tpl
@@ -11,7 +11,7 @@
 
 		{{include file="field_input.tpl" field=$verify_code}}
 
-		<div class="form-group settings-submit-wrapper" >
+		<div class="form-group settings-submit-wrapper">
 			<button type="submit" name="action" id="confirm-submit-button" class="btn btn-primary confirm-button" value="verify">{{$verify_label}}</button>
 		</div>
 	</form>
diff --git a/view/templates/threaded_conversation.tpl b/view/templates/threaded_conversation.tpl
index f4a47354e..afc0eaa68 100644
--- a/view/templates/threaded_conversation.tpl
+++ b/view/templates/threaded_conversation.tpl
@@ -7,8 +7,8 @@
 
 {{if $dropping}}
 <div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();">
-  <div id="item-delete-selected-icon" class="icon drophide" title="{{$dropping}}" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>
-  <div id="item-delete-selected-desc" >{{$dropping}}</div>
+  <div id="item-delete-selected-icon" class="icon drophide" title="{{$dropping}}" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></div>
+  <div id="item-delete-selected-desc">{{$dropping}}</div>
 </div>
 <img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
 <div id="item-delete-selected-end"></div>
diff --git a/view/templates/uimport.tpl b/view/templates/uimport.tpl
index 05c79ab75..227c37304 100644
--- a/view/templates/uimport.tpl
+++ b/view/templates/uimport.tpl
@@ -1,14 +1,14 @@
 
-<form action="uimport" method="post" id="uimport-form" enctype="multipart/form-data">
-<h1>{{$import.title}}</h1>
-    <p>{{$import.intro}}</p>
-    <p>{{$import.instruct}}</p>
-    <p><b>{{$import.warn}}</b></p>
-     {{include file="field_custom.tpl" field=$import.field}}
-     
-     
-	<div id="register-submit-wrapper">
-		<input type="submit" name="submit" id="register-submit-button" value="{{$regbutt}}" />
-	</div>
-	<div id="register-submit-end" ></div>    
-</form>
+<form action="uimport" method="post" id="uimport-form" enctype="multipart/form-data">
+<h1>{{$import.title}}</h1>
+    <p>{{$import.intro}}</p>
+    <p>{{$import.instruct}}</p>
+    <p><b>{{$import.warn}}</b></p>
+     {{include file="field_custom.tpl" field=$import.field}}
+     
+     
+	<div id="register-submit-wrapper">
+		<input type="submit" name="submit" id="register-submit-button" value="{{$regbutt}}" />
+	</div>
+	<div id="register-submit-end"></div>
+</form>
diff --git a/view/templates/wallmessage.tpl b/view/templates/wallmessage.tpl
index 29f95fe49..b21507d49 100644
--- a/view/templates/wallmessage.tpl
+++ b/view/templates/wallmessage.tpl
@@ -4,8 +4,8 @@
 
 <h4>{{$subheader}}</h4>
 
-<div id="prvmail-wrapper" >
-<form id="prvmail-form" action="wallmessage/{{$nickname}}" method="post" >
+<div id="prvmail-wrapper">
+<form id="prvmail-form" action="wallmessage/{{$nickname}}" method="post">
 
 {{$parent nofilter}}
 
@@ -19,12 +19,12 @@
 <textarea rows="8" cols="72" class="prvmail-text" id="prvmail-text" name="body" tabindex="12">{{$text}}</textarea>
 
 
-<div id="prvmail-submit-wrapper" >
+<div id="prvmail-submit-wrapper">
 	<input type="submit" id="prvmail-submit" name="submit" value="Submit" tabindex="13" />
-	<div id="prvmail-link-wrapper" >
-		<div id="prvmail-link" class="icon border link" title="{{$insert}}" onclick="jotGetLink();" ></div>
+	<div id="prvmail-link-wrapper">
+		<div id="prvmail-link" class="icon border link" title="{{$insert}}" onclick="jotGetLink();"></div>
 	</div> 
-	<div id="prvmail-rotator-wrapper" >
+	<div id="prvmail-rotator-wrapper">
 		<img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
 	</div> 
 </div>
diff --git a/view/templates/widget/events.tpl b/view/templates/widget/events.tpl
index e9b54771d..81dde7046 100644
--- a/view/templates/widget/events.tpl
+++ b/view/templates/widget/events.tpl
@@ -3,7 +3,7 @@
 	<h3>{{$etitle}}</h3>
 
 	<ul class="sidebar-calendar-export-ul">
-		<li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/cal/{{$user}}/export/ical" >{{$export_ical}}</a></li>
-		<li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/cal/{{$user}}/export/csv" >{{$export_csv}}</a></li>
+		<li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/cal/{{$user}}/export/ical">{{$export_ical}}</a></li>
+		<li role="menuitem" class="sidebar-calendar-export-li"><a href="{{$baseurl}}/cal/{{$user}}/export/csv">{{$export_csv}}</a></li>
 	</ul>
 </div>
diff --git a/view/templates/widget/follow.tpl b/view/templates/widget/follow.tpl
index 12a562123..076940a62 100644
--- a/view/templates/widget/follow.tpl
+++ b/view/templates/widget/follow.tpl
@@ -2,7 +2,7 @@
 <div id="follow-sidebar" class="widget">
 	<h3>{{$connect}}</h3>
 	<div id="connect-desc">{{$desc nofilter}}</div>
-	<form action="follow" method="get" >
+	<form action="follow" method="get">
 		<input id="side-follow-url" type="text" name="url" value="{{$value}}" size="24" placeholder="{{$hint}}" title="{{$hint}}" /><input id="side-follow-submit" type="submit" name="submit" value="{{$follow}}" />
 	</form>
 </div>
diff --git a/view/templates/widget/peoplefind.tpl b/view/templates/widget/peoplefind.tpl
index d4d99c2da..7104dc6f3 100644
--- a/view/templates/widget/peoplefind.tpl
+++ b/view/templates/widget/peoplefind.tpl
@@ -5,13 +5,13 @@
 	<form action="dirfind" method="get" />
 		<input id="side-peoplefind-url" type="text" name="search" size="24" title="{{$nv.hint}}" /><input id="side-peoplefind-submit" type="submit" name="submit" value="{{$nv.findthem}}" />
 	</form>
-	<div class="side-link" id="side-match-link"><a href="match" >{{$nv.similar}}</a></div>
-	<div class="side-link" id="side-suggest-link"><a href="suggest" >{{$nv.suggest}}</a></div>
-	<div class="side-link" id="side-directory-link"><a href="directory" >{{$nv.local_directory}}</a></div>
-	<div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink" >{{$nv.directory}}</a></div>
-	<div class="side-link" id="side-random-profile-link" ><a href="randprof" target="extlink" >{{$nv.random}}</a></div>
+	<div class="side-link" id="side-match-link"><a href="match">{{$nv.similar}}</a></div>
+	<div class="side-link" id="side-suggest-link"><a href="suggest">{{$nv.suggest}}</a></div>
+	<div class="side-link" id="side-directory-link"><a href="directory">{{$nv.local_directory}}</a></div>
+	<div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink">{{$nv.directory}}</a></div>
+	<div class="side-link" id="side-random-profile-link"><a href="randprof" target="extlink">{{$nv.random}}</a></div>
 	{{if $nv.inv}} 
-	<div class="side-link" id="side-invite-link" ><a href="invite" >{{$nv.inv}}</a></div>
+	<div class="side-link" id="side-invite-link"><a href="invite">{{$nv.inv}}</a></div>
 	{{/if}}
 </div>
 
diff --git a/view/templates/widget_forumlist.tpl b/view/templates/widget_forumlist.tpl
index 49e66df7b..6d0af8ce2 100644
--- a/view/templates/widget_forumlist.tpl
+++ b/view/templates/widget_forumlist.tpl
@@ -27,7 +27,7 @@ function showHideForumlist() {
 			<a href="{{$forum.external_url}}" title="{{$forum.link_desc}}" class="label sparkle" target="_blank" rel="noopener noreferrer">
 				<img class="forumlist-img" src="{{$forum.micro}}" alt="{{$forum.link_desc}}" />
 			</a>
-			<a class="forum-widget-link {{if $forum.selected}}forum-selected{{/if}}" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}" >{{$forum.name}}</a>
+			<a class="forum-widget-link {{if $forum.selected}}forum-selected{{/if}}" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}">{{$forum.name}}</a>
 		</li>
 		{{/if}}
 	
@@ -37,7 +37,7 @@ function showHideForumlist() {
 			<a href="{{$forum.external_url}}" title="{{$forum.link_desc}}" class="label sparkle" target="_blank" rel="noopener noreferrer">
 				<img class="forumlist-img" src="{{$forum.micro}}" alt="{{$forum.link_desc}}" />
 			</a>
-			<a class="forum-widget-link {{if $forum.selected}}forum-selected{{/if}}" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}" >{{$forum.name}}</a>
+			<a class="forum-widget-link {{if $forum.selected}}forum-selected{{/if}}" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}">{{$forum.name}}</a>
 		</li>
 		{{/if}}
 		{{/foreach}}
diff --git a/view/theme/duepuntozero/templates/nav.tpl b/view/theme/duepuntozero/templates/nav.tpl
index bde59784b..85c6b047e 100644
--- a/view/theme/duepuntozero/templates/nav.tpl
+++ b/view/theme/duepuntozero/templates/nav.tpl
@@ -4,41 +4,41 @@
 
 	<div id="site-location">{{$sitelocation}}</div>
 
-	{{if $nav.logout}}<a id="nav-logout-link" class="nav-link {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" >{{$nav.logout.1}}</a> {{/if}}
-	{{if $nav.login}}<a id="nav-login-link" class="nav-login-link {{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}" >{{$nav.login.1}}</a> {{/if}}
+	{{if $nav.logout}}<a id="nav-logout-link" class="nav-link {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}">{{$nav.logout.1}}</a> {{/if}}
+	{{if $nav.login}}<a id="nav-login-link" class="nav-login-link {{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}">{{$nav.login.1}}</a> {{/if}}
 
-	<span id="nav-link-wrapper" >
+	<span id="nav-link-wrapper">
 
-	{{if $nav.register}}<a id="nav-register-link" class="nav-commlink {{$nav.register.2}} {{$sel.register}}" href="{{$nav.register.0}}" title="{{$nav.register.3}}" >{{$nav.register.1}}</a>{{/if}}
+	{{if $nav.register}}<a id="nav-register-link" class="nav-commlink {{$nav.register.2}} {{$sel.register}}" href="{{$nav.register.0}}" title="{{$nav.register.3}}">{{$nav.register.1}}</a>{{/if}}
 		
-	{{if $nav.help}} <a id="nav-help-link" class="nav-link {{$nav.help.2}}" target="friendica-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" >{{$nav.help.1}}</a>{{/if}}
+	{{if $nav.help}} <a id="nav-help-link" class="nav-link {{$nav.help.2}}" target="friendica-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}">{{$nav.help.1}}</a>{{/if}}
 
-	{{if $nav.tos}} <a id="nav-tos-link" class="nav-link {{$nav.tos.2}}" href="{{$nav.tos.0}}" title="{{$nav.tos.3}}" >{{$nav.tos.1}}</a>{{/if}}
+	{{if $nav.tos}} <a id="nav-tos-link" class="nav-link {{$nav.tos.2}}" href="{{$nav.tos.0}}" title="{{$nav.tos.3}}">{{$nav.tos.1}}</a>{{/if}}
 		
-	{{if $nav.apps}}<a id="nav-apps-link" class="nav-link {{$nav.apps.2}}" href="{{$nav.apps.0}}" title="{{$nav.apps.3}}" >{{$nav.apps.1}}</a>{{/if}}
+	{{if $nav.apps}}<a id="nav-apps-link" class="nav-link {{$nav.apps.2}}" href="{{$nav.apps.0}}" title="{{$nav.apps.3}}">{{$nav.apps.1}}</a>{{/if}}
 
-	<a accesskey="s" id="nav-search-link" class="nav-link {{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}" >{{$nav.search.1}}</a>
-	<a id="nav-directory-link" class="nav-link {{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}" >{{$nav.directory.1}}</a>
+	<a accesskey="s" id="nav-search-link" class="nav-link {{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}">{{$nav.search.1}}</a>
+	<a id="nav-directory-link" class="nav-link {{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}">{{$nav.directory.1}}</a>
 
-	{{if $nav.admin}}<a accesskey="a" id="nav-admin-link" class="nav-link {{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" >{{$nav.admin.1}}</a>{{/if}}
+	{{if $nav.admin}}<a accesskey="a" id="nav-admin-link" class="nav-link {{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}">{{$nav.admin.1}}</a>{{/if}}
 
 	{{if $nav.network}}
-	<a accesskey="n" id="nav-network-link" class="nav-commlink {{$nav.network.2}} {{$sel.network}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}" >{{$nav.network.1}}</a>
+	<a accesskey="n" id="nav-network-link" class="nav-commlink {{$nav.network.2}} {{$sel.network}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}">{{$nav.network.1}}</a>
 	<span id="net-update" class="nav-ajax-left"></span>
 	{{/if}}
 	{{if $nav.home}}
-	<a accesskey="p" id="nav-home-link" class="nav-commlink {{$nav.home.2}} {{$sel.home}}" href="{{$nav.home.0}}" title="{{$nav.home.3}}" >{{$nav.home.1}}</a>
+	<a accesskey="p" id="nav-home-link" class="nav-commlink {{$nav.home.2}} {{$sel.home}}" href="{{$nav.home.0}}" title="{{$nav.home.3}}">{{$nav.home.1}}</a>
 	<span id="home-update" class="nav-ajax-left"></span>
 	{{/if}}
 	{{if $nav.community}}
-	<a accesskey="c" id="nav-community-link" class="nav-commlink {{$nav.community.2}} {{$sel.community}}" href="{{$nav.community.0}}" title="{{$nav.community.3}}" >{{$nav.community.1}}</a>
+	<a accesskey="c" id="nav-community-link" class="nav-commlink {{$nav.community.2}} {{$sel.community}}" href="{{$nav.community.0}}" title="{{$nav.community.3}}">{{$nav.community.1}}</a>
 	{{/if}}
 	{{if $nav.introductions}}
-	<a id="nav-notification-link" class="nav-commlink {{$nav.introductions.2}} {{$sel.introductions}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}" >{{$nav.introductions.1}}</a>
+	<a id="nav-notification-link" class="nav-commlink {{$nav.introductions.2}} {{$sel.introductions}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}">{{$nav.introductions.1}}</a>
 	<span id="intro-update" class="nav-ajax-left"></span>
 	{{/if}}
 	{{if $nav.messages}}
-	<a id="nav-messages-link" class="nav-commlink {{$nav.messages.2}} {{$sel.messages}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}" >{{$nav.messages.1}}</a>
+	<a id="nav-messages-link" class="nav-commlink {{$nav.messages.2}} {{$sel.messages}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}">{{$nav.messages.1}}</a>
 	<span id="mail-update" class="nav-ajax-left"></span>
 	{{/if}}
 
@@ -57,9 +57,9 @@
 		{{/if}}		
 
 	{{if $nav.settings}}<a id="nav-settings-link" class="nav-link {{$nav.settings.2}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}">{{$nav.settings.1}}</a>{{/if}}
-	{{if $nav.profiles}}<a id="nav-profiles-link" class="nav-link {{$nav.profiles.2}}" href="{{$nav.profiles.0}}" title="{{$nav.profiles.3}}" >{{$nav.profiles.1}}</a>{{/if}}
+	{{if $nav.profiles}}<a id="nav-profiles-link" class="nav-link {{$nav.profiles.2}}" href="{{$nav.profiles.0}}" title="{{$nav.profiles.3}}">{{$nav.profiles.1}}</a>{{/if}}
 
-	{{if $nav.contacts}}<a id="nav-contacts-link" class="nav-link {{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}" >{{$nav.contacts.1}}</a>{{/if}}
+	{{if $nav.contacts}}<a id="nav-contacts-link" class="nav-link {{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}">{{$nav.contacts.1}}</a>{{/if}}
 
 
 	{{if $nav.delegation}}<a id="nav-delegation-link" class="nav-link {{$nav.delegation.2}} {{$sel.delegation}}" href="{{$nav.delegation.0}}" title="{{$nav.delegation.3}}">{{$nav.delegation.1}}</a>{{/if}}
diff --git a/view/theme/frio/templates/admin/users/deleted.tpl b/view/theme/frio/templates/admin/users/deleted.tpl
index 9ec127267..cc4fa5ac0 100644
--- a/view/theme/frio/templates/admin/users/deleted.tpl
+++ b/view/theme/frio/templates/admin/users/deleted.tpl
@@ -22,7 +22,7 @@
 			{{foreach $users as $u}}
 				<tr>
 					<td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
-					<td><a href="{{$u.url}}" title="{{$u.nickname}}" >{{$u.name}}</a></td>
+					<td><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
 					<td>{{$u.email}}</td>
 					<td>{{$u.deleted}}</td>
 				</tr>
diff --git a/view/theme/frio/templates/album_edit.tpl b/view/theme/frio/templates/album_edit.tpl
index 4f240922a..76223881d 100644
--- a/view/theme/frio/templates/album_edit.tpl
+++ b/view/theme/frio/templates/album_edit.tpl
@@ -1,6 +1,6 @@
 <div id="photo-album-edit-wrapper">
-	<form name="photo-album-edit-form" id="photo-album-edit-form" action="photos/{{$nickname}}/album/{{$hexalbum}}" method="post" >
-		<label id="photo-album-edit-name-label" for="photo-album-edit-name" >{{$nametext}}</label>
+	<form name="photo-album-edit-form" id="photo-album-edit-form" action="photos/{{$nickname}}/album/{{$hexalbum}}" method="post">
+		<label id="photo-album-edit-name-label" for="photo-album-edit-name">{{$nametext}}</label>
 		<div class="pull-left photo-album-edit-name">
 			<input class="form-control" type="text" size="64" name="albumname" value="{{$album}}" id="photo-album-edit-name">
 		</div>
diff --git a/view/theme/frio/templates/confirm.tpl b/view/theme/frio/templates/confirm.tpl
index d17b94d76..187078b68 100644
--- a/view/theme/frio/templates/confirm.tpl
+++ b/view/theme/frio/templates/confirm.tpl
@@ -2,7 +2,7 @@
 <form action="{{$confirm_url}}" id="confirm-form" method="{{$method}}" class="generic-page-wrapper">
 	<div id="confirm-message">{{$message}}</div>
 
-	<div class="form-group pull-right settings-submit-wrapper" >
+	<div class="form-group pull-right settings-submit-wrapper">
 		<button type="submit" name="{{$confirm_name}}" id="confirm-submit-button" class="btn btn-primary confirm-button" value="{{$confirm}}">{{$confirm}}</button>
 		<button type="submit" name="canceled" id="confirm-cancel-button" class="btn confirm-button" data-dismiss="modal">{{$cancel}}</button>
 	</div>
diff --git a/view/theme/frio/templates/contact/advanced.tpl b/view/theme/frio/templates/contact/advanced.tpl
index 9aca5997a..c968d00f5 100644
--- a/view/theme/frio/templates/contact/advanced.tpl
+++ b/view/theme/frio/templates/contact/advanced.tpl
@@ -11,7 +11,7 @@
 	</div>
 	<br />
 
-	<form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post" >
+	<form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post">
 
 		<!-- <h4>{{$contact_name}}</h4> -->
 
@@ -35,7 +35,7 @@
 
 		{{include file="field_input.tpl" field=$photo}}
 
-		<div class="pull-right settings-submit-wrapper" >
+		<div class="pull-right settings-submit-wrapper">
 			<button type="submit" name="submit" class="btn btn-primary" value="{{$lbl_submit}}">{{$lbl_submit}}</button>
 		</div>
 		<div class="clear"></div>
diff --git a/view/theme/frio/templates/contact_edit.tpl b/view/theme/frio/templates/contact_edit.tpl
index 776e8f8af..9194127df 100644
--- a/view/theme/frio/templates/contact_edit.tpl
+++ b/view/theme/frio/templates/contact_edit.tpl
@@ -2,14 +2,14 @@
 <div class="generic-page-wrapper">
 	{{if $header}}<h3>{{$header}}:&nbsp;{{$name}}{{if $account_type}}&nbsp;<small>({{$account_type}})</small>{{/if}}</h3>{{/if}}
 
-	<div id="contact-edit-wrapper" >
+	<div id="contact-edit-wrapper">
 
 		{{* Insert Tab-Nav *}}
 		{{$tab_str nofilter}}
 
 
 		<div id="contact-edit-content-wrapper">
-			<form action="contact/{{$contact_id}}" method="post" >
+			<form action="contact/{{$contact_id}}" method="post">
 
 				{{* This is the Action menu where contact related actions like 'ignore', 'hide' can be performed *}}
 				<ul id="contact-edit-actions" class="nav nav-pills preferences">
@@ -18,7 +18,7 @@
 							<i class="fa fa-angle-down" aria-hidden="true"></i>&nbsp;{{$contact_action_button}}
 						</button>
 
-						<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="contact-edit-actions-button" aria-haspopup="true" id="contact-actions-menu" >
+						<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="contact-edit-actions-button" aria-haspopup="true" id="contact-actions-menu">
 							{{if $lblsuggest}}<li role="presentation"><a role="menuitem" href="{{$contact_actions.suggest.url}}" title="{{$contact_actions.suggest.title}}">{{$contact_actions.suggest.label}}</a></li>{{/if}}
 							{{if $poll_enabled}}<li role="presentation"><a role="menuitem" href="{{$contact_actions.update.url}}" title="{{$contact_actions.update.title}}">{{$contact_actions.update.label}}</a></li>{{/if}}
 							{{if $contact_actions.updateprofile}}<li role="presentation"><a role="menuitem" href="{{$contact_actions.updateprofile.url}}" title="{{$contact_actions.updateprofile.title}}">{{$contact_actions.updateprofile.label}}</a></li>{{/if}}
@@ -141,7 +141,7 @@
 
 								{{include file="field_checkbox.tpl" field=$hidden}}
 
-								<div class="pull-right settings-submit-wrapper" >
+								<div class="pull-right settings-submit-wrapper">
 									<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
 								</div>
 								<div class="clear"></div>
@@ -164,7 +164,7 @@
 
 								{{include file="field_textarea.tpl" field=$cinfo}}
 
-								<div class="pull-right settings-submit-wrapper" >
+								<div class="pull-right settings-submit-wrapper">
 									<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
 								</div>
 								<div class="clear"></div>
diff --git a/view/theme/frio/templates/contact_template.tpl b/view/theme/frio/templates/contact_template.tpl
index 8bb817ed5..a950500ce 100644
--- a/view/theme/frio/templates/contact_template.tpl
+++ b/view/theme/frio/templates/contact_template.tpl
@@ -110,11 +110,11 @@
 					{{* @todo this needs some changing in core because $contact.account_type contains a translated string which may notbe the same in every language *}}
 					</h4>
 				</div>
-				{{if $contact.alt_text}}<div class="contact-entry-details contact-entry-rel" id="contact-entry-rel-{{$contact.id}}" >{{$contact.alt_text}}</div>{{/if}}
-				{{if $contact.itemurl}}<div class="contact-entry-details contact-entry-url" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</div>{{/if}}
-				{{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}" >{{$contact.tags}}</div>{{/if}}
-				{{if $contact.details}}<div class="contact-entry-details contact-entry-tags" id="contact-entry-details-{{$contact.id}}" >{{$contact.details}}</div>{{/if}}
-				{{if $contact.network}}<div class="contact-entry-details contact-entry-network" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
+				{{if $contact.alt_text}}<div class="contact-entry-details contact-entry-rel" id="contact-entry-rel-{{$contact.id}}">{{$contact.alt_text}}</div>{{/if}}
+				{{if $contact.itemurl}}<div class="contact-entry-details contact-entry-url" id="contact-entry-url-{{$contact.id}}">{{$contact.itemurl}}</div>{{/if}}
+				{{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}">{{$contact.tags}}</div>{{/if}}
+				{{if $contact.details}}<div class="contact-entry-details contact-entry-tags" id="contact-entry-details-{{$contact.id}}">{{$contact.details}}</div>{{/if}}
+				{{if $contact.network}}<div class="contact-entry-details contact-entry-network" id="contact-entry-network-{{$contact.id}}">{{$contact.network}}</div>{{/if}}
 			</div>
 
 			{{* The checkbox to perform batch actions to these contacts (for batch actions have a look at contacts-template.tpl) *}}
@@ -233,11 +233,11 @@ We use this part to filter the contacts with jquery.textcomplete *}}
 					{{* @todo this needs some changing in core because $contact.account_type contains a translated string which may notbe the same in every language *}}
 					</h4>
 				</div>
-				{if $alt_text}<div class="contact-entry-details" id="contact-entry-rel-{$id}" >{$alt_text}</div>{/if}
-				{if $itemurl}<div class="contact-entry-details" id="contact-entry-url-{$id}" >{$itemurl}</div>{/if}
-				{if $tags}<div class="contact-entry-details" id="contact-entry-tags-{$id}" >{$tags}</div>{/if}
-				{if $details}<div class="contact-entry-details" id="contact-entry-details-{$id}" >{$details}</div>{/if}
-				{if $network}<div class="contact-entry-details" id="contact-entry-network-{$id}" >{$network}</div>{/if}
+				{if $alt_text}<div class="contact-entry-details" id="contact-entry-rel-{$id}">{$alt_text}</div>{/if}
+				{if $itemurl}<div class="contact-entry-details" id="contact-entry-url-{$id}">{$itemurl}</div>{/if}
+				{if $tags}<div class="contact-entry-details" id="contact-entry-tags-{$id}">{$tags}</div>{/if}
+				{if $details}<div class="contact-entry-details" id="contact-entry-details-{$id}">{$details}</div>{/if}
+				{if $network}<div class="contact-entry-details" id="contact-entry-network-{$id}">{$network}</div>{/if}
 			</div>
 
 			{{* The checkbox to perform batch actions to these contacts (for batch actions have a look at contacts-template.tpl) *}}
diff --git a/view/theme/frio/templates/contacts-template.tpl b/view/theme/frio/templates/contacts-template.tpl
index 37821a587..ad8a26792 100644
--- a/view/theme/frio/templates/contacts-template.tpl
+++ b/view/theme/frio/templates/contacts-template.tpl
@@ -14,7 +14,7 @@
 
 	{{* The search input field to search for contacts *}}
 	<div id="contacts-search-wrapper">
-		<form id="contacts-search-form" class="navbar-form" role="search" action="{{$cmd}}" method="get" >
+		<form id="contacts-search-form" class="navbar-form" role="search" action="{{$cmd}}" method="get">
 			<div class="row">
 				<div class="form-group form-group-search">
 					<input type="text" name="search" id="contacts-search" class="search-input form-control form-search" onfocus="this.select();" value="{{$search}}" placeholder="{{$desc nofilter}}"/>
diff --git a/view/theme/frio/templates/directory_header.tpl b/view/theme/frio/templates/directory_header.tpl
index 36812916d..f4c9f0f4b 100644
--- a/view/theme/frio/templates/directory_header.tpl
+++ b/view/theme/frio/templates/directory_header.tpl
@@ -10,7 +10,7 @@
 
 	{{* The search input field to search for contacts *}}
 	<div id="directory-search-wrapper">
-		<form id="directory-search-form" class="navbar-form" role="search" action="{{$search_mod}}" method="get" >
+		<form id="directory-search-form" class="navbar-form" role="search" action="{{$search_mod}}" method="get">
 			<div class="row">
 				<div class="col-md-2"></div>
 				<div class="col-md-8 ">
@@ -35,7 +35,7 @@
 	{{/foreach}}
 	</ul>
 
-	<div class="directory-end" ></div>
+	<div class="directory-end"></div>
 
 	{{$paginate nofilter}}
 </div>
diff --git a/view/theme/frio/templates/event.tpl b/view/theme/frio/templates/event.tpl
index 5dcc7e6f3..89fe283c1 100644
--- a/view/theme/frio/templates/event.tpl
+++ b/view/theme/frio/templates/event.tpl
@@ -5,8 +5,8 @@
 			<div class="media">
 				<div class="event-owner media-left">
 					{{if $event.item.author_name}}
-					<a href="{{$event.item.author_link}}" ><img src="{{$event.item.author_avatar}}" /></a>
-					<a href="{{$event.item.author_link}}" >{{$event.item.author_name}}</a>
+					<a href="{{$event.item.author_link}}"><img src="{{$event.item.author_avatar}}" /></a>
+					<a href="{{$event.item.author_link}}">{{$event.item.author_name}}</a>
 					{{/if}}
 				</div>
 				<div class="media-body">
diff --git a/view/theme/frio/templates/event_form.tpl b/view/theme/frio/templates/event_form.tpl
index 1d4f26a6b..54dad0047 100644
--- a/view/theme/frio/templates/event_form.tpl
+++ b/view/theme/frio/templates/event_form.tpl
@@ -63,7 +63,7 @@
 			{{/if}}
 
 			{{* The submit button - saves the event *}}
-			<div class="pull-right" >
+			<div class="pull-right">
 				<button id="event-submit" type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
 			</div>
 			<div class="clear"></div>
@@ -75,7 +75,7 @@
 			{{* The textarea for the event description *}}
 			<div class="form-group">
 				<div id="event-desc-text"><b>{{$d_text}}</b></div>
-				<textarea id="comment-edit-text-desc" class="form-control text-autosize" name="desc" >{{$d_orig}}</textarea>
+				<textarea id="comment-edit-text-desc" class="form-control text-autosize" name="desc">{{$d_orig}}</textarea>
 				<ul id="event-desc-text-edit-bb" class="comment-edit-bb comment-icon-list nav nav-pills hidden-xs pull-left">
 					{{* commented out because it isn't implemented yet
 					<li>
diff --git a/view/theme/frio/templates/field_themeselect.tpl b/view/theme/frio/templates/field_themeselect.tpl
index f71b19131..ddebc7871 100644
--- a/view/theme/frio/templates/field_themeselect.tpl
+++ b/view/theme/frio/templates/field_themeselect.tpl
@@ -4,7 +4,7 @@
 {{/if}}
 	<div class="form-group field select">
 		<label for="id_{{$field.0}}">{{$field.1}}</label>
-		<select class="form-control" name="{{$field.0}}" id="id_{{$field.0}}" {{if $field.5=="preview"}}onchange="previewTheme(this);"{{/if}} aria-describedby="{{$field.0}}_tip" >
+		<select class="form-control" name="{{$field.0}}" id="id_{{$field.0}}" {{if $field.5=="preview"}}onchange="previewTheme(this);"{{/if}} aria-describedby="{{$field.0}}_tip">
 	{{foreach $field.4 as $opt=>$val}}
 			<option value="{{$opt}}" {{if $opt==$field.2}}selected="selected"{{/if}}>{{$val}}</option>
 	{{/foreach}}
diff --git a/view/theme/frio/templates/group_edit.tpl b/view/theme/frio/templates/group_edit.tpl
index e02119354..149608a9f 100644
--- a/view/theme/frio/templates/group_edit.tpl
+++ b/view/theme/frio/templates/group_edit.tpl
@@ -43,7 +43,7 @@
 
 	{{* The search input field to search for contacts *}}
 	<div id="contacts-search-wrapper">
-		<form id="contacts-search-form" class="navbar-form" role="search" method="get" >
+		<form id="contacts-search-form" class="navbar-form" role="search" method="get">
 			<div class="row">
 				<div class="form-group form-group-search">
 					<input type="text" name="search" id="contacts-search" class="search-input form-control form-search" onfocus="this.select();" onkeyup="filterList(); return false;" />
diff --git a/view/theme/frio/templates/invite.tpl b/view/theme/frio/templates/invite.tpl
index 31da60665..482ae5451 100644
--- a/view/theme/frio/templates/invite.tpl
+++ b/view/theme/frio/templates/invite.tpl
@@ -3,7 +3,7 @@
 
 	<h3 class="heading">{{$title}}</h3>
 
-	<form action="invite" method="post" id="invite-form" >
+	<form action="invite" method="post" id="invite-form">
 		<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
 
 		<div id="invite-content-wrapper">
diff --git a/view/theme/frio/templates/jot.tpl b/view/theme/frio/templates/jot.tpl
index e0c602a28..4ecf6a7c3 100644
--- a/view/theme/frio/templates/jot.tpl
+++ b/view/theme/frio/templates/jot.tpl
@@ -121,7 +121,7 @@
 							</button>
 						</li>
 						<li role="presentation" id="character-counter" class="grey jothidden text-info pull-right"></li>
-						<li role="presentation" id="profile-rotator-wrapper" class="pull-right" style="display: {{$visitor}};" >
+						<li role="presentation" id="profile-rotator-wrapper" class="pull-right" style="display: {{$visitor}};">
 							<img role="presentation" id="profile-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
 						</li>
 						<li role="presentation" id="profile-jot-plugin-wrapper">
diff --git a/view/theme/frio/templates/login.tpl b/view/theme/frio/templates/login.tpl
index 09df08bd0..17303d132 100644
--- a/view/theme/frio/templates/login.tpl
+++ b/view/theme/frio/templates/login.tpl
@@ -1,5 +1,5 @@
 
-<form id="login-form" action="{{$dest_url}}" role="form" method="post" >
+<form id="login-form" action="{{$dest_url}}" role="form" method="post">
 	<div id="login-group" role="group" aria-labelledby="login-head">
 		<input type="hidden" name="auth-params" value="login" />
 
@@ -9,7 +9,7 @@
 			{{include file="field_input.tpl" field=$lname}}
 			{{include file="field_password.tpl" field=$lpassword}}
 			<div id="login-lost-password-link">
-				<a href="lostpass" title="{{$lostpass}}" id="lost-password-link" >{{$lostlink}}</a>
+				<a href="lostpass" title="{{$lostpass}}" id="lost-password-link">{{$lostlink}}</a>
 			</div>
 			<div id="login-end"></div>
 		</div>
@@ -23,7 +23,7 @@
 		{{include file="field_checkbox.tpl" field=$lremember}}
 
 		<div id="login-submit-wrapper">
-			<div class="pull-right" >
+			<div class="pull-right">
 				<button type="submit" name="submit" id="login-submit-button" class="btn btn-primary" value="{{$login}}">{{$login}}</button>
 			</div>
 		</div>
diff --git a/view/theme/frio/templates/mail_conv.tpl b/view/theme/frio/templates/mail_conv.tpl
index 80f5e7547..f41089388 100644
--- a/view/theme/frio/templates/mail_conv.tpl
+++ b/view/theme/frio/templates/mail_conv.tpl
@@ -13,7 +13,7 @@
 			<div class="mail-body">
 				{{$mail.body nofilter}}
 			</div>
-			{{*<a href="message/dropconv/{{$mail.id}}" onclick="return confirmDelete();" title="{{$delete}}" class="close pull-right" onmouseover="imgbright(this);" onmouseout="imgdull(this);" >&times;</a> *}}
+			{{*<a href="message/dropconv/{{$mail.id}}" onclick="return confirmDelete();" title="{{$delete}}" class="close pull-right" onmouseover="imgbright(this);" onmouseout="imgdull(this);">&times;</a> *}}
 		</div>
 	</div>
 	<div class="mail-conv-wrapper-end"></div>
diff --git a/view/theme/frio/templates/notifications/intros.tpl b/view/theme/frio/templates/notifications/intros.tpl
index 6e083201e..3f100eb0b 100644
--- a/view/theme/frio/templates/notifications/intros.tpl
+++ b/view/theme/frio/templates/notifications/intros.tpl
@@ -1,10 +1,10 @@
 
 {{* template incomming contact request and suggested contacts *}}
 
-<div class="intro-wrapper media" id="intro-{{$intro_id}}" >
+<div class="intro-wrapper media" id="intro-{{$intro_id}}">
 
 	{{* Contact Photo *}}
-	<div class="intro-photo-wrapper dropdown pull-left" >
+	<div class="intro-photo-wrapper dropdown pull-left">
 		<img id="photo-{{$intro_id}}" class="intro-photo media-object" src="{{$photo}}" title="{{$fullname}}" alt="{{$fullname}}" />
 	</div>
 
@@ -70,13 +70,13 @@
 					{{include file="field_radio.tpl" field=$friend}}
 					{{include file="field_radio.tpl" field=$follower}}
 				</div>
-				<input type="hidden" name="dfrn_id" value="{{$dfrn_id}}" >
-				<input type="hidden" name="intro_id" value="{{$intro_id}}" >
-				<input type="hidden" name="contact_id" value="{{$contact_id}}" >
+				<input type="hidden" name="dfrn_id" value="{{$dfrn_id}}">
+				<input type="hidden" name="intro_id" value="{{$intro_id}}">
+				<input type="hidden" name="contact_id" value="{{$contact_id}}">
 				{{else}}
 				{{if $note}}<div>{{$note}}</div>{{/if}}
-				<input type="hidden" name="url" value="{{$url}}" >
-				<input type="hidden" name="dfrn-url" value="{{$dfrn_url}}" >
+				<input type="hidden" name="url" value="{{$url}}">
+				<input type="hidden" name="dfrn-url" value="{{$dfrn_url}}">
 				{{/if}}
 				<div class="pull-right">
 					<button class="btn btn-primary intro-submit-approve" type="submit" name="submit" value="{{$approve}}">{{$approve}}</button>
diff --git a/view/theme/frio/templates/photo_albums.tpl b/view/theme/frio/templates/photo_albums.tpl
index f510bd976..d19ab0638 100644
--- a/view/theme/frio/templates/photo_albums.tpl
+++ b/view/theme/frio/templates/photo_albums.tpl
@@ -15,7 +15,7 @@
 
 	<ul role="menubar" class="sidebar-photos-albums-ul clear">
 		<li role="menuitem" class="sidebar-photos-albums-li">
-			<a href="{{$baseurl}}/photos/{{$nick}}" class="sidebar-photos-albums-element" title="{{$title}}" >{{$recent}}</a>
+			<a href="{{$baseurl}}/photos/{{$nick}}" class="sidebar-photos-albums-element" title="{{$title}}">{{$recent}}</a>
 		</li>
 
 		{{if $albums}}
diff --git a/view/theme/frio/templates/photos_upload.tpl b/view/theme/frio/templates/photos_upload.tpl
index e3bcd3069..a93211671 100644
--- a/view/theme/frio/templates/photos_upload.tpl
+++ b/view/theme/frio/templates/photos_upload.tpl
@@ -6,16 +6,16 @@
 
 	<form action="photos/{{$nickname}}" enctype="multipart/form-data" method="post" name="photos-upload-form" id="photos-upload-form">
 		<div id="photos-upload-div" class="form-group">
-			<label id="photos-upload-text" for="photos-upload-newalbum" >{{$newalbum}}</label>
+			<label id="photos-upload-text" for="photos-upload-newalbum">{{$newalbum}}</label>
 
 			<input id="photos-upload-album-select" class="form-control" placeholder="{{$existalbumtext}}" list="dl-photo-upload" type="text" name="album" size="4">
 			<datalist id="dl-photo-upload">{{$albumselect  nofilter}}</datalist>
 		</div>
 		<div id="photos-upload-end" class="clearfix"></div>
 
-		<div id="photos-upload-noshare-div" class="photos-upload-noshare-div checkbox pull-left" >
+		<div id="photos-upload-noshare-div" class="photos-upload-noshare-div checkbox pull-left">
 			<input id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" checked/>
-			<label id="photos-upload-noshare-text" for="photos-upload-noshare" >{{$nosharetext}}</label>
+			<label id="photos-upload-noshare-text" for="photos-upload-noshare">{{$nosharetext}}</label>
 		</div>
 
 		{{if $alt_uploader}}
diff --git a/view/theme/frio/templates/prv_message.tpl b/view/theme/frio/templates/prv_message.tpl
index f936741c0..741116bb1 100644
--- a/view/theme/frio/templates/prv_message.tpl
+++ b/view/theme/frio/templates/prv_message.tpl
@@ -1,6 +1,6 @@
 
 <div id="prvmail-wrapper">
-<form id="prvmail-form" action="message" method="post" >
+<form id="prvmail-form" action="message" method="post">
 
 	{{$parent nofilter}}
 
diff --git a/view/theme/frio/templates/register.tpl b/view/theme/frio/templates/register.tpl
index c2ac17436..6ef70b3e6 100644
--- a/view/theme/frio/templates/register.tpl
+++ b/view/theme/frio/templates/register.tpl
@@ -13,41 +13,41 @@
 
 		{{if $oidlabel}}
 		<div id="register-openid-wrapper" class="form-group">
-			<label for="register-openid" id="label-register-openid" >{{$oidlabel}}</label>
+			<label for="register-openid" id="label-register-openid">{{$oidlabel}}</label>
 			<input type="text" maxlength="60" size="32" name="openid_url" class="openid form-control" id="register-openid" value="{{$openid}}">
 			<span class="help-block" id="openid_url_tip">{{$fillwith}}&nbsp;{{$fillext}}</span>
 		</div>
-		<div id="register-openid-end" ></div>
+		<div id="register-openid-end"></div>
 		{{/if}}
 
 		{{if $invitations}}
 		<div id="register-invite-wrapper" class="form-group">
-			<label for="register-invite" id="label-register-invite" >{{$invite_label}}</label>
+			<label for="register-invite" id="label-register-invite">{{$invite_label}}</label>
 			<input type="text" maxlength="60" size="32" name="invite_id" id="register-invite" class="form-control" value="{{$invite_id}}">
 			<span class="help-block" id="invite_id_tip">{{$invite_desc nofilter}}</span>
 		</div>
-		<div id="register-name-end" ></div>
+		<div id="register-name-end"></div>
 		{{/if}}
 
 		<div id="register-name-wrapper" class="form-group">
-			<label for="register-name" id="label-register-name" >{{$namelabel}}</label>
+			<label for="register-name" id="label-register-name">{{$namelabel}}</label>
 			<input type="text" maxlength="60" size="32" name="username" id="register-name" class="form-control" value="{{$username}}" required>
 		</div>
-		<div id="register-name-end" ></div>
+		<div id="register-name-end"></div>
 
 
 		{{if !$additional}}
 			<div id="register-email-wrapper" class="form-group">
-				<label for="register-email" id="label-register-email" >{{$addrlabel}}</label>
+				<label for="register-email" id="label-register-email">{{$addrlabel}}</label>
 				<input type="text" maxlength="60" size="32" name="field1" id="register-email" class="form-control" value="{{$email}}" required>
 			</div>
-			<div id="register-email-end" ></div>
+			<div id="register-email-end"></div>
 
 			<div id="register-repeat-wrapper" class="form-group">
-				<label for="register-repeat" id="label-register-repeat" >{{$addrlabel2}}</label>
+				<label for="register-repeat" id="label-register-repeat">{{$addrlabel2}}</label>
 				<input type="text" maxlength="60" size="32" name="repeat" id="register-repeat" class="form-control" value="" required>
 			</div>
-			<div id="register-repeat-end" ></div>
+			<div id="register-repeat-end"></div>
 		{{/if}}
 
 		{{if $ask_password}}
@@ -56,11 +56,11 @@
 		{{/if}}
 
 		<div id="register-nickname-wrapper" class="form-group">
-			<label for="register-nickname" id="label-register-nickname" >{{$nicklabel}}</label>
+			<label for="register-nickname" id="label-register-nickname">{{$nicklabel}}</label>
 			<input type="text" maxlength="60" size="32" name="nickname" id="register-nickname" class="form-control" value="{{$nickname}}" required>
 			<span class="help-block" id="nickname_tip">{{$nickdesc nofilter}}</span>
 		</div>
-		<div id="register-nickname-end" ></div>
+		<div id="register-nickname-end"></div>
 
 		{{if $additional}}
 			{{include file="field_password.tpl" field=$parent_password}}
diff --git a/view/theme/frio/templates/removeme.tpl b/view/theme/frio/templates/removeme.tpl
index 2410363d5..ad687e897 100644
--- a/view/theme/frio/templates/removeme.tpl
+++ b/view/theme/frio/templates/removeme.tpl
@@ -5,7 +5,7 @@
 	<div id="remove-account-wrapper">
 		<div id="remove-account-desc">{{$desc nofilter}}</div>
 
-		<form action="{{$basedir}}/removeme" autocomplete="off" method="post" >
+		<form action="{{$basedir}}/removeme" autocomplete="off" method="post">
 			<input type="hidden" name="verify" value="{{$hash}}" />
 
 			<div id="remove-account-pass-wrapper" class="form-group">
@@ -14,7 +14,7 @@
 			</div>
 			<div id="remove-account-pass-end"></div>
 
-			<div class="form-group pull-right settings-submit-wrapper" >
+			<div class="form-group pull-right settings-submit-wrapper">
 				<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}"><i class="fa fa-trash fa-fw"></i>&nbsp;{{$submit}}</button>
 			</div>
 			<div class="clear"></div>
diff --git a/view/theme/frio/templates/settings/connectors.tpl b/view/theme/frio/templates/settings/connectors.tpl
index 2f3564c94..6818c66bd 100644
--- a/view/theme/frio/templates/settings/connectors.tpl
+++ b/view/theme/frio/templates/settings/connectors.tpl
@@ -64,7 +64,7 @@
 			{{include file="field_select.tpl" field=$mail_action}}
 			{{include file="field_input.tpl" field=$mail_movetofolder}}
 
-			<div class="settings-submit-wrapper" >
+			<div class="settings-submit-wrapper">
 				<input type="submit" id="imap-submit" name="imap-submit" class="settings-submit" value="{{$submit}}" />
 			</div>
 		</div>
diff --git a/view/theme/frio/templates/settings/display.tpl b/view/theme/frio/templates/settings/display.tpl
index 6e018dfc9..8036f7259 100644
--- a/view/theme/frio/templates/settings/display.tpl
+++ b/view/theme/frio/templates/settings/display.tpl
@@ -1,6 +1,6 @@
 <div class="generic-page-wrapper">
 	<h1>{{$ptitle}}</h1>
-	<form action="settings/display" id="settings-form" method="post" autocomplete="off" >
+	<form action="settings/display" id="settings-form" method="post" autocomplete="off">
 		<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
 
 		<div class="panel-group panel-group-settings" id="settings" role="tablist" aria-multiselectable="true">
diff --git a/view/theme/frio/templates/settings/oauth_edit.tpl b/view/theme/frio/templates/settings/oauth_edit.tpl
index 419e1b203..bd650bc08 100644
--- a/view/theme/frio/templates/settings/oauth_edit.tpl
+++ b/view/theme/frio/templates/settings/oauth_edit.tpl
@@ -10,7 +10,7 @@
 	{{include file="field_input.tpl" field=$redirect}}
 	{{include file="field_input.tpl" field=$icon}}
 
-	<div class="form-group pull-right settings-submit-wrapper" >
+	<div class="form-group pull-right settings-submit-wrapper">
 		<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>
 	</div>
 	<div class="clear"></div>
diff --git a/view/theme/frio/templates/theme_settings.tpl b/view/theme/frio/templates/theme_settings.tpl
index c9b350865..7dfc49719 100644
--- a/view/theme/frio/templates/theme_settings.tpl
+++ b/view/theme/frio/templates/theme_settings.tpl
@@ -1,5 +1,5 @@
 <script src="{{$baseurl}}/view/theme/quattro/jquery.tools.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}" ></script>
+<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
 
 <div class="form-group field select">
 	<label for="id_{{$scheme.0}}">{{$scheme.1}}</label>
diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl
index 2d9d0a8ab..de46a12ac 100644
--- a/view/theme/frio/templates/wall_thread.tpl
+++ b/view/theme/frio/templates/wall_thread.tpl
@@ -104,7 +104,7 @@ as the value of $top_child_total (this is done at the end of this file)
 
 			{{* The litle overlay avatar picture if someone is posting directly to a wall or a forum *}}
 			{{if $item.owner_url}}
-			<div aria-hidden="true" class="contact-photo-wrapper mframe wwto" id="wall-item-ownerphoto-wrapper-{{$item.id}}" >
+			<div aria-hidden="true" class="contact-photo-wrapper mframe wwto" id="wall-item-ownerphoto-wrapper-{{$item.id}}">
 				<a href="{{$item.owner_url}}" target="redir" title="{{$item.olinktitle}}" class="contact-photo-link" id="wall-item-ownerphoto-link-{{$item.id}}">
 					<img src="{{$item.owner_photo}}" class="contact-photo {{$item.osparkle}}" id="wall-item-ownerphoto-{{$item.id}}" alt="{{$item.owner_name}}" />
 				</a>
diff --git a/view/theme/frio/templates/widget/peoplefind.tpl b/view/theme/frio/templates/widget/peoplefind.tpl
index b6d1e3ff2..7c69e6bff 100644
--- a/view/theme/frio/templates/widget/peoplefind.tpl
+++ b/view/theme/frio/templates/widget/peoplefind.tpl
@@ -11,14 +11,14 @@
 	</form>
 
 	{{* Directory links *}}
-	<div class="side-link" id="side-directory-link"><a href="directory" >{{$nv.local_directory}}</a></div>
-	<div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink" >{{$nv.directory}}</a></div>
+	<div class="side-link" id="side-directory-link"><a href="directory">{{$nv.local_directory}}</a></div>
+	<div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink">{{$nv.directory}}</a></div>
 	{{* Additional links *}}
-	<div class="side-link" id="side-match-link"><a href="match" >{{$nv.similar}}</a></div>
-	<div class="side-link" id="side-suggest-link"><a href="suggest" >{{$nv.suggest}}</a></div>
-	<div class="side-link" id="side-random-profile-link" ><a href="randprof" target="extlink" >{{$nv.random}}</a></div>
+	<div class="side-link" id="side-match-link"><a href="match">{{$nv.similar}}</a></div>
+	<div class="side-link" id="side-suggest-link"><a href="suggest">{{$nv.suggest}}</a></div>
+	<div class="side-link" id="side-random-profile-link"><a href="randprof" target="extlink">{{$nv.random}}</a></div>
 
 	{{if $nv.inv}} 
-	<div class="side-link" id="side-invite-link" ><button type="button" class="btn-link" onclick="addToModal('invite'); return false;">{{$nv.inv}}</button></div>
+	<div class="side-link" id="side-invite-link"><button type="button" class="btn-link" onclick="addToModal('invite'); return false;">{{$nv.inv}}</button></div>
 	{{/if}}
 </div>
diff --git a/view/theme/quattro/templates/contact_template.tpl b/view/theme/quattro/templates/contact_template.tpl
index 2d59a8a25..13eea60de 100644
--- a/view/theme/quattro/templates/contact_template.tpl
+++ b/view/theme/quattro/templates/contact_template.tpl
@@ -1,10 +1,10 @@
 
-<div class="contact-wrapper" id="contact-entry-wrapper-{{$id}}" >
-	{{if $contact.ignlnk}}<a href="{{$contact.ignlnk}}" title="{{$contact.ignore}}" class="icon drophide profile-match-ignore" onmouseout="imgdull(this);" onmouseover="imgbright(this);" onclick="return confirmDelete();" ></a>{{/if}}
-	<div class="contact-photo-wrapper" >
+<div class="contact-wrapper" id="contact-entry-wrapper-{{$id}}">
+	{{if $contact.ignlnk}}<a href="{{$contact.ignlnk}}" title="{{$contact.ignore}}" class="icon drophide profile-match-ignore" onmouseout="imgdull(this);" onmouseover="imgbright(this);" onclick="return confirmDelete();"></a>{{/if}}
+	<div class="contact-photo-wrapper">
 		<div class="contact-photo mframe" id="contact-entry-photo-{{$contact.id}}"
 		onmouseover="if (typeof t{{$contact.id}} != 'undefined') clearTimeout(t{{$contact.id}}); openMenu('contact-photo-menu-button-{{$contact.id}}')" 
-		onmouseout="t{{$contact.id}}=setTimeout('closeMenu(\'contact-photo-menu-button-{{$contact.id}}\'); closeMenu(\'contact-photo-menu-{{$contact.id}}\');',200)" >
+		onmouseout="t{{$contact.id}}=setTimeout('closeMenu(\'contact-photo-menu-button-{{$contact.id}}\'); closeMenu(\'contact-photo-menu-{{$contact.id}}\');',200)">
 
 			<a href="{{$contact.url}}" title="{{$contact.img_hover}}" /><img src="{{$contact.thumb}}" {{$contact.sparkle}} alt="{{$contact.name}}" /></a>
 
@@ -26,15 +26,15 @@
 		</div>
 			
 	</div>
-	<div class="contact-name" id="contact-entry-name-{{$contact.id}}" >
+	<div class="contact-name" id="contact-entry-name-{{$contact.id}}">
 		{{$contact.name}}
 		{{if $contact.account_type}} <span class="contact-entry-details" id="contact-entry-accounttype-{{$contact.id}}">({{$contact.account_type}})</span>{{/if}}
 	</div>
-	{{if $contact.alt_text}}<div class="contact-details" id="contact-entry-rel-{{$contact.id}}" >{{$contact.alt_text}}</div>{{/if}}
-	{{if $contact.itemurl}}<div class="contact-details" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</div>{{/if}}
-	{{if $contact.tags}}<div class="contact-details" id="contact-entry-tags-{{$contact.id}}" >{{$contact.tags}}</div>{{/if}}
-	{{if $contact.details}}<div class="contact-details" id="contact-entry-details-{{$contact.id}}" >{{$contact.details}}</div>{{/if}}
-	{{if $contact.network}}<div class="contact-details" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
+	{{if $contact.alt_text}}<div class="contact-details" id="contact-entry-rel-{{$contact.id}}">{{$contact.alt_text}}</div>{{/if}}
+	{{if $contact.itemurl}}<div class="contact-details" id="contact-entry-url-{{$contact.id}}">{{$contact.itemurl}}</div>{{/if}}
+	{{if $contact.tags}}<div class="contact-details" id="contact-entry-tags-{{$contact.id}}">{{$contact.tags}}</div>{{/if}}
+	{{if $contact.details}}<div class="contact-details" id="contact-entry-details-{{$contact.id}}">{{$contact.details}}</div>{{/if}}
+	{{if $contact.network}}<div class="contact-details" id="contact-entry-network-{{$contact.id}}">{{$contact.network}}</div>{{/if}}
 
 	{{if $contact.connlnk}}
 	<div class="contact-entry-connect"><a href="{{$contact.connlnk}}" title="{{$contact.conntxt}}">{{$contact.conntxt}}</a></div>
diff --git a/view/theme/quattro/templates/event_form.tpl b/view/theme/quattro/templates/event_form.tpl
index 9cb0bdc4e..8054ba876 100644
--- a/view/theme/quattro/templates/event_form.tpl
+++ b/view/theme/quattro/templates/event_form.tpl
@@ -3,7 +3,7 @@
 
 <p>{{$desc nofilter}}</p>
 
-<form id="event-edit-form" action="{{$post}}" method="post" >
+<form id="event-edit-form" action="{{$post}}" method="post">
 
 	<input type="hidden" name="event_id" value="{{$eid}}" />
 	<input type="hidden" name="cid" value="{{$cid}}" />
@@ -30,7 +30,7 @@
 
 	{{$acl nofilter}}
 
-	<div class="settings-submit-wrapper" >
+	<div class="settings-submit-wrapper">
 		<input id="event-edit-preview" type="submit" name="preview" value="{{$preview}}" onclick="doEventPreview(); return false;" />
 		<input id="event-submit" type="submit" name="submit" value="{{$submit}}" />
 	</div>
diff --git a/view/theme/quattro/templates/events-js.tpl b/view/theme/quattro/templates/events-js.tpl
index bfe446f9f..62b9e6667 100644
--- a/view/theme/quattro/templates/events-js.tpl
+++ b/view/theme/quattro/templates/events-js.tpl
@@ -1,6 +1,6 @@
 
 {{$tabs nofilter}}
-<h2>{{$title}} <a class="actionbutton" href="{{$new_event.0}}" ><i class="icon add s10"></i> {{$new_event.1}}</a></h2>
+<h2>{{$title}} <a class="actionbutton" href="{{$new_event.0}}"><i class="icon add s10"></i> {{$new_event.1}}</a></h2>
 
 <div id="new-event-link"></div>
 
diff --git a/view/theme/quattro/templates/events.tpl b/view/theme/quattro/templates/events.tpl
index 6df1cf94b..052846f10 100644
--- a/view/theme/quattro/templates/events.tpl
+++ b/view/theme/quattro/templates/events.tpl
@@ -1,5 +1,5 @@
 {{$tabs nofilter}}
-<h2>{{$title}} <a class="actionbutton" href="{{$new_event.0}}" ><i class="icon add s10"></i> {{$new_event.1}}</a></h2>
+<h2>{{$title}} <a class="actionbutton" href="{{$new_event.0}}"><i class="icon add s10"></i> {{$new_event.1}}</a></h2>
 
 <div id="event-calendar-wrapper">
 	<a href="{{$previus.0}}" class="prevcal {{$previus.2}}"><div id="event-calendar-prev" class="icon s22 prev" title="{{$previus.1}}"></div></a>
@@ -10,8 +10,8 @@
 
 {{foreach $events as $event}}
 	<div class="event">
-	{{if $event.is_first}}<hr /><a name="link-{{$event.j}}" ><div class="event-list-date">{{$event.d}}</div></a>{{/if}}
-	{{if $event.item.author_name}}<a href="{{$event.item.author_link}}" ><img src="{{$event.item.author_avatar}}" height="32" width="32" />{{$event.item.author_name}}</a>{{/if}}
+	{{if $event.is_first}}<hr /><a name="link-{{$event.j}}"><div class="event-list-date">{{$event.d}}</div></a>{{/if}}
+	{{if $event.item.author_name}}<a href="{{$event.item.author_link}}"><img src="{{$event.item.author_avatar}}" height="32" width="32" />{{$event.item.author_name}}</a>{{/if}}
 	{{$event.html nofilter}}
 	{{if $event.item.plink}}<a href="{{$event.plink.0}}" title="{{$event.plink.1}}" target="_blank" rel="noopener noreferrer" class="plink-event-link icon s22 remote-link"></a>{{/if}}
 	{{if $event.edit}}<a href="{{$event.edit.0}}" title="{{$event.edit.1}}" class="edit-event-link icon s22 pencil"></a>{{/if}}
diff --git a/view/theme/quattro/templates/jot.tpl b/view/theme/quattro/templates/jot.tpl
index d4aff2cb2..0c2324408 100644
--- a/view/theme/quattro/templates/jot.tpl
+++ b/view/theme/quattro/templates/jot.tpl
@@ -35,7 +35,7 @@
 			{{$jotplugins nofilter}}
 
 			{{if !$is_edit}}
-			<li class="perms"><a id="jot-perms-icon" href="#profile-jot-acl-wrapper" class="icon s22 {{$lockstate}} {{$bang}}"  title="{{$permset}}" ></a></li>
+			<li class="perms"><a id="jot-perms-icon" href="#profile-jot-acl-wrapper" class="icon s22 {{$lockstate}} {{$bang}}"  title="{{$permset}}"></a></li>
 			{{/if}}
 			<li class="submit"><input type="submit" id="profile-jot-submit" name="submit" value="{{$share}}" /></li>
 			<li id="profile-rotator" class="loading" style="display: none"><img src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}"  /></li>
diff --git a/view/theme/quattro/templates/mail_conv.tpl b/view/theme/quattro/templates/mail_conv.tpl
index 1e791f618..c7ddd7e71 100644
--- a/view/theme/quattro/templates/mail_conv.tpl
+++ b/view/theme/quattro/templates/mail_conv.tpl
@@ -46,15 +46,15 @@
 
 
 <div class="mail-conv-outside-wrapper">
-	<div class="mail-conv-sender" >
-		<a href="{{$mail.from_url}}" title="{{$mail.from_addr}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" title="{{$mail.from_addr}}" /></a>
+	<div class="mail-conv-sender">
+		<a href="{{$mail.from_url}}" title="{{$mail.from_addr}}" class="mail-conv-sender-url"><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" title="{{$mail.from_addr}}" /></a>
 	</div>
-	<div class="mail-conv-detail" >
-		<div class="mail-conv-sender-name" >{{$mail.from_name}}</div>
+	<div class="mail-conv-detail">
+		<div class="mail-conv-sender-name">{{$mail.from_name}}</div>
 		<div class="mail-conv-date">{{$mail.date}}</div>
 		<div class="mail-conv-subject">{{$mail.subject}}</div>
 		<div class="mail-conv-body">{{$mail.body nofilter}}</div>
-	<div class="mail-conv-delete-wrapper" id="mail-conv-delete-wrapper-{{$mail.id}}" ><a href="message/drop/{{$mail.id}}" class="icon drophide delete-icon mail-list-delete-icon" onclick="return confirmDelete();" title="{{$mail.delete}}" id="mail-conv-delete-icon-{{$mail.id}}" class="mail-conv-delete-icon" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a></div><div class="mail-conv-delete-end"></div>
+	<div class="mail-conv-delete-wrapper" id="mail-conv-delete-wrapper-{{$mail.id}}"><a href="message/drop/{{$mail.id}}" class="icon drophide delete-icon mail-list-delete-icon" onclick="return confirmDelete();" title="{{$mail.delete}}" id="mail-conv-delete-icon-{{$mail.id}}" class="mail-conv-delete-icon" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></a></div><div class="mail-conv-delete-end"></div>
 	<div class="mail-conv-outside-wrapper-end"></div>
 </div>
 </div>
diff --git a/view/theme/quattro/templates/nav.tpl b/view/theme/quattro/templates/nav.tpl
index 13b3aa1d3..fc757c9a4 100644
--- a/view/theme/quattro/templates/nav.tpl
+++ b/view/theme/quattro/templates/nav.tpl
@@ -13,36 +13,36 @@
 						<li><a class="{{$usermenu.2}}" href="{{$usermenu.0}}" title="{{$usermenu.3}}">{{$usermenu.1}}</a></li>
 					{{/foreach}}
 					
-					{{if $nav.notifications}}<li><a class="{{$nav.notifications.2}}" href="{{$nav.notifications.0}}" title="{{$nav.notifications.3}}" >{{$nav.notifications.1}}</a></li>{{/if}}
-					{{if $nav.messages}}<li><a class="{{$nav.messages.2}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}" >{{$nav.messages.1}}</a></li>{{/if}}
-					{{if $nav.contacts}}<li><a class="{{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}" >{{$nav.contacts.1}}</a></li>{{/if}}	
+					{{if $nav.notifications}}<li><a class="{{$nav.notifications.2}}" href="{{$nav.notifications.0}}" title="{{$nav.notifications.3}}">{{$nav.notifications.1}}</a></li>{{/if}}
+					{{if $nav.messages}}<li><a class="{{$nav.messages.2}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}">{{$nav.messages.1}}</a></li>{{/if}}
+					{{if $nav.contacts}}<li><a class="{{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}">{{$nav.contacts.1}}</a></li>{{/if}}
 				</ul>
 			</li>
 		{{/if}}
 
 		{{if $nav.community}}
 			<li id="nav-community-link" class="nav-menu {{$sel.community}}">
-				<a class="{{$nav.community.2}}" href="{{$nav.community.0}}" title="{{$nav.community.3}}" >{{$nav.community.1}}</a>
+				<a class="{{$nav.community.2}}" href="{{$nav.community.0}}" title="{{$nav.community.3}}">{{$nav.community.1}}</a>
 			</li>
 		{{/if}}
 
 		{{if $nav.network}}
 			<li id="nav-network-link" class="nav-menu {{$sel.network}}">
-				<a accesskey="n" class="{{$nav.network.2}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}" >{{$nav.network.1}}</a>
+				<a accesskey="n" class="{{$nav.network.2}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}">{{$nav.network.1}}</a>
 				<span id="net-update" class="nav-notification"></span>
 			</li>
 		{{/if}}
 
 		{{if $nav.home}}
 			<li id="nav-home-link" class="nav-menu {{$sel.home}}">
-				<a accesskey="p" class="{{$nav.home.2}}" href="{{$nav.home.0}}" title="{{$nav.home.3}}" >{{$nav.home.1}}</a>
+				<a accesskey="p" class="{{$nav.home.2}}" href="{{$nav.home.0}}" title="{{$nav.home.3}}">{{$nav.home.1}}</a>
 				<span id="home-update" class="nav-notification"></span>
 			</li>
 		{{/if}}
 
 		{{if $nav.introductions}}
 			<li id="nav-introductions-link" class="nav-menu-icon {{$sel.introductions}}">
-				<a class="{{$nav.introductions.2}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}" >
+				<a class="{{$nav.introductions.2}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}">
 				    <span class="icon s22 intro">{{$nav.introductions.1}}</a>
 				</a>
 				<span id="intro-update" class="nav-notification"></span>
@@ -51,7 +51,7 @@
 
 		{{if $nav.messages}}
 			<li id="nav-messages-link" class="nav-menu-icon {{$sel.messages}}">
-				<a class="{{$nav.messages.2}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}" >
+				<a class="{{$nav.messages.2}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}">
 				    <span class="icon s22 mail">{{$nav.messages.1}}</a>
 				</a>
 				<span id="mail-update" class="nav-notification"></span>
@@ -74,30 +74,30 @@
 				{{if $nav.delegation}}<li><a class="{{$nav.delegation.2}}" href="{{$nav.delegation.0}}" title="{{$nav.delegation.3}}">{{$nav.delegation.1}}</a></li>{{/if}}
 
 				{{if $nav.settings}}<li><a class="{{$nav.settings.2}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}">{{$nav.settings.1}}</a></li>{{/if}}
-				{{if $nav.admin}}<li><a accesskey="a" class="{{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" >{{$nav.admin.1}}</a></li>{{/if}}
+				{{if $nav.admin}}<li><a accesskey="a" class="{{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}">{{$nav.admin.1}}</a></li>{{/if}}
 
-				{{if $nav.logout}}<li><a class="menu-sep {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" >{{$nav.logout.1}}</a></li>{{/if}}
-				{{if $nav.login}}<li><a class="{{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}" >{{$nav.login.1}}</a><li>{{/if}}
+				{{if $nav.logout}}<li><a class="menu-sep {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}">{{$nav.logout.1}}</a></li>{{/if}}
+				{{if $nav.login}}<li><a class="{{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}">{{$nav.login.1}}</a><li>{{/if}}
 				{{if $nav.tos}}<li><a class="menu-sep {{$nav.tos.2}}" href="{{$nav.tos.0}}" title="{{$nav.tos.3}}">{{$nav.tos.1}}</a></li>{{/if}}
 			</ul>
 		</li>
 
 		{{if $nav.help}} 
 		<li id="nav-help-link" class="nav-menu {{$sel.help}}">
-			<a class="{{$nav.help.2}}" target="friendica-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" >{{$nav.help.1}}</a>
+			<a class="{{$nav.help.2}}" target="friendica-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}">{{$nav.help.1}}</a>
 		</li>
 		{{/if}}
 
 		<li id="nav-search-link" class="nav-menu {{$sel.search}}">
-			<a accesskey="s" class="{{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}" >{{$nav.search.1}}</a>
+			<a accesskey="s" class="{{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}">{{$nav.search.1}}</a>
 		</li>
 		<li id="nav-directory-link" class="nav-menu {{$sel.directory}}">
-			<a class="{{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}" >{{$nav.directory.1}}</a>
+			<a class="{{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}">{{$nav.directory.1}}</a>
 		</li>
 		
 		{{if $nav.apps}}
 			<li id="nav-apps-link" class="nav-menu {{$sel.apps}}">
-				<a class=" {{$nav.apps.2}}" href="#" rel="#nav-apps-menu" title="{{$nav.apps.3}}" >{{$nav.apps.1}}</a>
+				<a class=" {{$nav.apps.2}}" href="#" rel="#nav-apps-menu" title="{{$nav.apps.3}}">{{$nav.apps.1}}</a>
 				<ul id="nav-apps-menu" class="menu-popup">
 					{{foreach $apps as $ap}}
 					<li>{{$ap nofilter}}</li>
diff --git a/view/theme/quattro/templates/photo_item.tpl b/view/theme/quattro/templates/photo_item.tpl
index 4a43d2cb8..ee64f5eda 100644
--- a/view/theme/quattro/templates/photo_item.tpl
+++ b/view/theme/quattro/templates/photo_item.tpl
@@ -68,7 +68,7 @@
 		<div class="wall-item-like" id="wall-item-like-{{$id}}">{{$like nofilter}}</div>
 		<div class="wall-item-dislike" id="wall-item-dislike-{{$id}}">{{$dislike nofilter}}</div>
 		{{if $conv}}
-		<div class="wall-item-conv" id="wall-item-conv-{{$id}}" >
+		<div class="wall-item-conv" id="wall-item-conv-{{$id}}">
 			<a href='{{$conv.href}}' id='context-{{$id}}' title='{{$conv.title}}'>{{$conv.title}}</a>
 		</div>
 		{{/if}}
diff --git a/view/theme/quattro/templates/profile/vcard.tpl b/view/theme/quattro/templates/profile/vcard.tpl
index a0f0f2502..b849a4435 100644
--- a/view/theme/quattro/templates/profile/vcard.tpl
+++ b/view/theme/quattro/templates/profile/vcard.tpl
@@ -9,7 +9,7 @@
 				<li>
 					<a href="{{$profile.edit.0}}">{{$profile.edit.1}}</a>
 				</li>
-				<li><a href="settings/profile/photo" >{{$profile.menu.chg_photo}}</a></li>
+				<li><a href="settings/profile/photo">{{$profile.menu.chg_photo}}</a></li>
 			</ul>
 			</div>
 		{{/if}}
diff --git a/view/theme/quattro/templates/wall_item_tag.tpl b/view/theme/quattro/templates/wall_item_tag.tpl
index 71c7e0844..5f2021b3e 100644
--- a/view/theme/quattro/templates/wall_item_tag.tpl
+++ b/view/theme/quattro/templates/wall_item_tag.tpl
@@ -59,9 +59,9 @@
 
 {{* top thread comment box *}}
 {{if $item.threaded}}{{if $item.comment_html}}{{if $item.thread_level==1}}
-<div class="wall-item-comment-wrapper" >{{$item.comment_html nofilter}}</div>
+<div class="wall-item-comment-wrapper">{{$item.comment_html nofilter}}</div>
 {{/if}}{{/if}}{{/if}}
 
 {{if $item.flatten}}
-<div class="wall-item-comment-wrapper" >{{$item.comment_html nofilter}}</div>
+<div class="wall-item-comment-wrapper">{{$item.comment_html nofilter}}</div>
 {{/if}}
diff --git a/view/theme/quattro/templates/widget_forumlist.tpl b/view/theme/quattro/templates/widget_forumlist.tpl
index 79a283481..d99d62863 100644
--- a/view/theme/quattro/templates/widget_forumlist.tpl
+++ b/view/theme/quattro/templates/widget_forumlist.tpl
@@ -24,7 +24,7 @@ function showHideForumlist() {
 			<a href="{{$forum.external_url}}" title="{{$forum.link_desc}}" class="label sparkle" target="_blank" rel="noopener noreferrer">
 				<img class="forumlist-img" src="{{$forum.micro}}" alt="{{$forum.link_desc}}" />
 			</a>
-			<a class="forum-widget-link" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}" >{{$forum.name}}</a>
+			<a class="forum-widget-link" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}">{{$forum.name}}</a>
 		</li>
 		{{/if}}
 	
@@ -34,7 +34,7 @@ function showHideForumlist() {
 			<a href="{{$forum.external_url}}" title="{{$forum.link_desc}}" class="label sparkle" target="_blank" rel="noopener noreferrer">
 				<img class="forumlist-img" src="{{$forum.micro}}" alt="{{$forum.link_desc}}" />
 			</a>
-			<a class="forum-widget-link" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}" >{{$forum.name}}</a>
+			<a class="forum-widget-link" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}">{{$forum.name}}</a>
 		</li>
 		{{/if}}
 		{{/foreach}}
diff --git a/view/theme/smoothly/templates/jot-header.tpl b/view/theme/smoothly/templates/jot-header.tpl
index 3f0040ddf..7acb8812e 100644
--- a/view/theme/smoothly/templates/jot-header.tpl
+++ b/view/theme/smoothly/templates/jot-header.tpl
@@ -48,7 +48,7 @@ function enableOnUser(){
 
 </script>
 
-<script type="text/javascript" src="view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}" >
+<script type="text/javascript" src="view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}">
 </script>
 
 <script>
diff --git a/view/theme/smoothly/templates/jot.tpl b/view/theme/smoothly/templates/jot.tpl
index 07c452c7e..61d6b5b01 100644
--- a/view/theme/smoothly/templates/jot.tpl
+++ b/view/theme/smoothly/templates/jot.tpl
@@ -1,11 +1,11 @@
-<div id="profile-jot-wrapper" >
+<div id="profile-jot-wrapper">
 	<div id="profile-jot-banner-wrapper">
-		<div id="profile-jot-desc" >&nbsp;</div>
+		<div id="profile-jot-desc">&nbsp;</div>
 		<div id="character-counter" class="grey" style="display: none;">0</div>
 	</div>
 	<div id="profile-jot-banner-end"></div>
 
-	<form id="profile-jot-form" action="{{$action}}" method="post" >
+	<form id="profile-jot-form" action="{{$action}}" method="post">
 		<input type="hidden" name="wall" value="{{$wall}}" />
 		<input type="hidden" name="post_type" value="{{$posttype}}" />
 		<input type="hidden" name="profile_uid" value="{{$profile_uid}}" />
@@ -30,33 +30,33 @@
 			</textarea>
 		</div>
 
-	<div id="profile-upload-wrapper" class="jot-tool" style="display: none;" >
-		<div id="wall-image-upload-div" ><a onclick="return false;" id="wall-image-upload" class="icon border camera" title="{{$upload}}"></a></div>
+	<div id="profile-upload-wrapper" class="jot-tool" style="display: none;">
+		<div id="wall-image-upload-div"><a onclick="return false;" id="wall-image-upload" class="icon border camera" title="{{$upload}}"></a></div>
 	</div>
-	<div id="profile-attach-wrapper" class="jot-tool" style="display: none;" >
-		<div id="wall-file-upload-div" ><a href="#" onclick="return false;" id="wall-file-upload" class="icon border attach" title="{{$attach}}"></a></div>
+	<div id="profile-attach-wrapper" class="jot-tool" style="display: none;">
+		<div id="wall-file-upload-div"><a href="#" onclick="return false;" id="wall-file-upload" class="icon border attach" title="{{$attach}}"></a></div>
 	</div>
-	<div id="profile-link-wrapper" class="jot-tool" style="display: none;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" >
+	<div id="profile-link-wrapper" class="jot-tool" style="display: none;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);">
 		<a href="#" id="profile-link" class="icon border  link" title="{{$weblink}}" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"></a>
 	</div>
-	<div id="profile-video-wrapper" class="jot-tool" style="display: none;" >
+	<div id="profile-video-wrapper" class="jot-tool" style="display: none;">
 		<a href="#" id="profile-video" class="icon border  video" title="{{$video}}" onclick="jotVideoURL(); return false;"></a>
 	</div>
-	<div id="profile-audio-wrapper" class="jot-tool" style="display: none;" >
+	<div id="profile-audio-wrapper" class="jot-tool" style="display: none;">
 		<a href="#" id="profile-audio" class="icon border  audio" title="{{$audio}}" onclick="jotAudioURL(); return false;"></a>
 	</div>
-	<div id="profile-location-wrapper" class="jot-tool" style="display: none;" >
+	<div id="profile-location-wrapper" class="jot-tool" style="display: none;">
 		<a href="#" id="profile-location" class="icon border  globe" title="{{$setloc}}" onclick="jotGetLocation(); return false;"></a>
 	</div>
-	<div id="profile-nolocation-wrapper" class="jot-tool" style="display: none;" >
+	<div id="profile-nolocation-wrapper" class="jot-tool" style="display: none;">
 		<a href="#" id="profile-nolocation" class="icon border  noglobe" title="{{$noloc}}" onclick="jotClearLocation(); return false;"></a>
 	</div>
 
-	<span onclick="preview_post();" id="jot-preview-link" class="fakelink" style="display: none;" >{{$preview}}</span>
+	<span onclick="preview_post();" id="jot-preview-link" class="fakelink" style="display: none;">{{$preview}}</span>
 
 	<div id="profile-jot-submit-wrapper" style="display:none;padding-left: 400px;">
 		<input type="submit" id="profile-jot-submit" name="submit" value="{{$share}}" />
-		<div id="profile-jot-perms" class="profile-jot-perms" style="display: {{$pvisit}};" >
+		<div id="profile-jot-perms" class="profile-jot-perms" style="display: {{$pvisit}};">
             <a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon {{$lockstate}} sharePerms" title="{{$permset}}"></a>{{$bang}}</div>
 	</div>
 
diff --git a/view/theme/smoothly/templates/nav.tpl b/view/theme/smoothly/templates/nav.tpl
index 5ce1eb3bb..6d8ad1071 100644
--- a/view/theme/smoothly/templates/nav.tpl
+++ b/view/theme/smoothly/templates/nav.tpl
@@ -17,7 +17,7 @@
 		</ul>
 	</div>
 	
-	<div id="user-menu" >
+	<div id="user-menu">
 		<a id="user-menu-label" onclick="openClose('user-menu-popup'); return false" href="{{$nav.home.0}}">{{$sitelocation}}</a>
 		
 		<ul id="user-menu-popup" 
diff --git a/view/theme/smoothly/templates/tools.tpl b/view/theme/smoothly/templates/tools.tpl
index 2ee4a3e41..081c246b4 100644
--- a/view/theme/smoothly/templates/tools.tpl
+++ b/view/theme/smoothly/templates/tools.tpl
@@ -1,7 +1,7 @@
 
 <nav>
 
-	{{if $nav.logout}}<a id="nav-logout-link" class="nav-link {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" >{{$nav.logout.1}}</a> {{/if}}
-	{{if $nav.login}}<a id="nav-login-link" class="nav-login-link {{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}" >{{$nav.login.1}}</a> {{/if}}
+	{{if $nav.logout}}<a id="nav-logout-link" class="nav-link {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}">{{$nav.logout.1}}</a> {{/if}}
+	{{if $nav.login}}<a id="nav-login-link" class="nav-login-link {{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}">{{$nav.login.1}}</a> {{/if}}
 
 </nav>
diff --git a/view/theme/smoothly/templates/widget/follow.tpl b/view/theme/smoothly/templates/widget/follow.tpl
index 4d5248530..664556b36 100644
--- a/view/theme/smoothly/templates/widget/follow.tpl
+++ b/view/theme/smoothly/templates/widget/follow.tpl
@@ -2,7 +2,7 @@
 <div id="follow-sidebar" class="widget">
 	<h3>{{$connect}}</h3>
 	<div id="connect-desc">{{$desc nofilter}}</div>
-	<form action="follow" method="post" >
+	<form action="follow" method="post">
 		<input id="side-follow-url" type="text-sidebar" name="url" size="24" title="{{$hint}}" /><input id="side-follow-submit" type="submit" name="submit" value="{{$follow}}" />
 	</form>
 </div>
diff --git a/view/theme/vier/templates/ch_directory_item.tpl b/view/theme/vier/templates/ch_directory_item.tpl
index 6813e1186..2945051f8 100644
--- a/view/theme/vier/templates/ch_directory_item.tpl
+++ b/view/theme/vier/templates/ch_directory_item.tpl
@@ -1,9 +1,9 @@
 
 
-<div class="directory-item" id="directory-item-{{$id}}" >
-	<div class="directory-photo-wrapper" id="directory-photo-wrapper-{{$id}}" > 
-		<div class="directory-photo" id="directory-photo-{{$id}}" >
-			<a href="{{$profile_link}}" class="directory-profile-link" id="directory-profile-link-{{$id}}" >
+<div class="directory-item" id="directory-item-{{$id}}">
+	<div class="directory-photo-wrapper" id="directory-photo-wrapper-{{$id}}">
+		<div class="directory-photo" id="directory-photo-{{$id}}">
+			<a href="{{$profile_link}}" class="directory-profile-link" id="directory-profile-link-{{$id}}">
 				<img class="directory-photo-img" src="{{$photo}}" alt="{{$alt_text}}" title="{{$alt_text}}" />
 			</a>
 		</div>
diff --git a/view/theme/vier/templates/contact_edit.tpl b/view/theme/vier/templates/contact_edit.tpl
index f89915d5f..23c510502 100644
--- a/view/theme/vier/templates/contact_edit.tpl
+++ b/view/theme/vier/templates/contact_edit.tpl
@@ -1,12 +1,12 @@
 
-<div id="contact-edit-wrapper" >
+<div id="contact-edit-wrapper">
 
 	{{* Insert Tab-Nav *}}
 	{{$tab_str nofilter}}
 
 
-	<div id="contact-edit-nav-wrapper" >
-		<form action="contact/{{$contact_id}}" method="post" >
+	<div id="contact-edit-nav-wrapper">
+		<form action="contact/{{$contact_id}}" method="post">
 			<div id="contact-edit-links">
 				<div id="contact-edit-status-wrapper">
 					<span id="contact-edit-contact-status">{{$contact_status}}</span>
@@ -15,7 +15,7 @@
 					<div id="contact-edit-actions">
 						<a class="btn" id="contact-edit-actions-button">{{$contact_action_button}}</a>
 
-						<ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup" >
+						<ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup">
 							{{if $lblsuggest}}<li role="menuitem"><a  href="#" title="{{$contact_actions.suggest.title}}" onclick="window.location.href='{{$contact_actions.suggest.url}}'; return false;">{{$contact_actions.suggest.label}}</a></li>{{/if}}
 							{{if $poll_enabled}}<li role="menuitem"><a  href="#" title="{{$contact_actions.update.title}}" onclick="window.location.href='{{$contact_actions.update.url}}'; return false;">{{$contact_actions.update.label}}</a></li>{{/if}}
 							{{if $contact_actions.updateprofile}}<li role="menuitem"><a href="{{$contact_actions.updateprofile.url}}" title="{{$contact_actions.updateprofile.title}}">{{$contact_actions.updateprofile.label}}</a></li>{{/if}}
@@ -65,7 +65,7 @@
 			<div id="contact-edit-settings">
 				<input type="hidden" name="contact_id" value="{{$contact_id}}">
 
-					<div id="contact-edit-end" ></div>
+					<div id="contact-edit-end"></div>
 					{{include file="field_checkbox.tpl" field=$notify}}
 					{{if $fetch_further_information}}
 						{{include file="field_select.tpl" field=$fetch_further_information}}
diff --git a/view/theme/vier/templates/contact_template.tpl b/view/theme/vier/templates/contact_template.tpl
index c4ed99caa..e99aab93d 100644
--- a/view/theme/vier/templates/contact_template.tpl
+++ b/view/theme/vier/templates/contact_template.tpl
@@ -1,9 +1,9 @@
 
-<div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}" >
-	<div class="contact-entry-photo-wrapper" >
+<div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}">
+	<div class="contact-entry-photo-wrapper">
 		<div class="contact-entry-photo mframe" id="contact-entry-photo-{{$contact.id}}">
 		<!-- onmouseover="if (typeof t{{$contact.id}} != 'undefined') clearTimeout(t{{$contact.id}}); openMenu('contact-photo-menu-button-{{$contact.id}}')" 
-		onmouseout="t{{$contact.id}}=setTimeout('closeMenu(\'contact-photo-menu-button-{{$contact.id}}\'); closeMenu(\'contact-photo-menu-{{$contact.id}}\');',200)" > -->
+		onmouseout="t{{$contact.id}}=setTimeout('closeMenu(\'contact-photo-menu-button-{{$contact.id}}\'); closeMenu(\'contact-photo-menu-{{$contact.id}}\');',200)"> -->
 
 			<!-- <a href="{{$contact.url}}" title="{{$contact.img_hover}}" /></a> -->
 			<img src="{{$contact.thumb}}" {{$contact.sparkle}} alt="{{$contact.name}}" />
@@ -28,22 +28,22 @@
 		</div>
 			
 	</div>
-	<div class="contact-entry-photo-end" ></div>
+	<div class="contact-entry-photo-end"></div>
 	
 	<div class="contact-entry-desc">
-		<div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >
+		<div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}">
 			{{$contact.name}}
 			{{if $contact.account_type}} <span class="contact-entry-details" id="contact-entry-accounttype-{{$contact.id}}">({{$contact.account_type}})</span>{{/if}}
 		</div>
-		{{if $contact.alt_text}}<div class="contact-entry-details" id="contact-entry-rel-{{$contact.id}}" >{{$contact.alt_text}}</div>{{/if}}
+		{{if $contact.alt_text}}<div class="contact-entry-details" id="contact-entry-rel-{{$contact.id}}">{{$contact.alt_text}}</div>{{/if}}
 		<div class="contact-entry-details">
-		{{if $contact.itemurl}}<span class="contact-entry-details" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</span>{{/if}}
-		{{if $contact.network}}<span class="contact-entry-details" id="contact-entry-network-{{$contact.id}}" > ({{$contact.network}})</span>{{/if}}
+		{{if $contact.itemurl}}<span class="contact-entry-details" id="contact-entry-url-{{$contact.id}}">{{$contact.itemurl}}</span>{{/if}}
+		{{if $contact.network}}<span class="contact-entry-details" id="contact-entry-network-{{$contact.id}}"> ({{$contact.network}})</span>{{/if}}
 		</div>
-		{{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}" >{{$contact.tags}}</div>{{/if}}
-		{{if $contact.details}}<div class="contact-entry-details" id="contact-entry-details-{{$contact.id}}" >{{$contact.details}}</div>{{/if}}
+		{{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}">{{$contact.tags}}</div>{{/if}}
+		{{if $contact.details}}<div class="contact-entry-details" id="contact-entry-details-{{$contact.id}}">{{$contact.details}}</div>{{/if}}
 	</div>
 
 
-	<div class="contact-entry-end" ></div>
+	<div class="contact-entry-end"></div>
 </div>
diff --git a/view/theme/vier/templates/event_form.tpl b/view/theme/vier/templates/event_form.tpl
index e2090e3c6..e93de71c6 100644
--- a/view/theme/vier/templates/event_form.tpl
+++ b/view/theme/vier/templates/event_form.tpl
@@ -6,7 +6,7 @@
 {{$desc nofilter}}
 </p>
 
-<form id="event-edit-form" action="{{$post}}" method="post" >
+<form id="event-edit-form" action="{{$post}}" method="post">
 
 <input type="hidden" name="event_id" value="{{$eid}}" />
 <input type="hidden" name="cid" value="{{$cid}}" />
diff --git a/view/theme/vier/templates/nav.tpl b/view/theme/vier/templates/nav.tpl
index 7982d5efa..32a588f3d 100644
--- a/view/theme/vier/templates/nav.tpl
+++ b/view/theme/vier/templates/nav.tpl
@@ -14,7 +14,7 @@
 		</li>
 		{{if $nav.home}}
 			<li role="menuitem" id="nav-home-link" class="nav-menu {{$sel.home}}">
-				<a accesskey="p" class="{{$nav.home.2}}" href="{{$nav.home.0}}" title="{{$nav.home.3}}" >
+				<a accesskey="p" class="{{$nav.home.2}}" href="{{$nav.home.0}}" title="{{$nav.home.3}}">
 					<span class="desktop-view">{{$nav.home.1}}</span>
 					<i class="icon s22 icon-home mobile-view"><span class="sr-only">{{$nav.home.1}}</span></i>
 					<span id="home-update" class="nav-notification"></span>
@@ -23,7 +23,7 @@
 		{{/if}}
 		{{if $nav.network}}
 			<li role="menuitem" id="nav-network-link" class="nav-menu {{$sel.network}}">
-				<a accesskey="n" class="{{$nav.network.2}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}" >
+				<a accesskey="n" class="{{$nav.network.2}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}">
 					<span class="desktop-view">{{$nav.network.1}}</span>
 					<i class="icon s22 icon-th mobile-view"><span class="sr-only">{{$nav.network.1}}</span></i>
 					<span id="net-update" class="nav-notification"></span>
@@ -32,23 +32,23 @@
 		{{/if}}
 		{{if $nav.events}}
 			<li role="menuitem" id="nav-events-link" class="nav-menu {{$sel.events}}">
-				<a accesskey="e" class="{{$nav.events.2}} desktop-view" href="{{$nav.events.0}}" title="{{$nav.events.3}}" >{{$nav.events.1}}</a>
-				<a class="{{$nav.events.2}} mobile-view" href="{{$nav.events.0}}" title="{{$nav.events.3}}" ><i class="icon s22 icon-calendar"></i></a>
+				<a accesskey="e" class="{{$nav.events.2}} desktop-view" href="{{$nav.events.0}}" title="{{$nav.events.3}}">{{$nav.events.1}}</a>
+				<a class="{{$nav.events.2}} mobile-view" href="{{$nav.events.0}}" title="{{$nav.events.3}}"><i class="icon s22 icon-calendar"></i></a>
 			</li>
 		{{/if}}
 		{{if $nav.community}}
 			<li role="menuitem" id="nav-community-link" class="nav-menu {{$sel.community}}">
-				<a accesskey="c" class="{{$nav.community.2}} desktop-view" href="{{$nav.community.0}}" title="{{$nav.community.3}}" >{{$nav.community.1}}</a>
-				<a class="{{$nav.community.2}} mobile-view" href="{{$nav.community.0}}" title="{{$nav.community.3}}" ><i class="icon s22 icon-bullseye"></i></a>
+				<a accesskey="c" class="{{$nav.community.2}} desktop-view" href="{{$nav.community.0}}" title="{{$nav.community.3}}">{{$nav.community.1}}</a>
+				<a class="{{$nav.community.2}} mobile-view" href="{{$nav.community.0}}" title="{{$nav.community.3}}"><i class="icon s22 icon-bullseye"></i></a>
 			</li>
 		{{/if}}
 
 		<li role="menu" aria-haspopup="true" id="nav-site-linkmenu" class="nav-menu-icon"><a><span class="icon s22 icon-question"><span class="sr-only">{{$nav.help.3}}</span></span></a>
 			<ul id="nav-site-menu" class="menu-popup">
-				{{if $nav.help}} <li role="menuitem"><a class="{{$nav.help.2}}" href="{{$nav.help.0}}" title="{{$nav.help.3}}" >{{$nav.help.1}}</a></li>{{/if}}
-				<li role="menuitem"><a class="{{$nav.about.2}}" href="{{$nav.about.0}}" title="{{$nav.about.3}}" >{{$nav.about.1}}</a></li>
-				{{if $nav.tos}}<a class="{{$nav.tos.2}}" href="{{$nav.tos.0}}" title="{{$nav.tos.3}}" >{{$nav.tos.1}}</a></li>{{/if}}
-				<li role="menuitem"><a class="{{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}" >{{$nav.directory.1}}</a></li>
+				{{if $nav.help}} <li role="menuitem"><a class="{{$nav.help.2}}" href="{{$nav.help.0}}" title="{{$nav.help.3}}">{{$nav.help.1}}</a></li>{{/if}}
+				<li role="menuitem"><a class="{{$nav.about.2}}" href="{{$nav.about.0}}" title="{{$nav.about.3}}">{{$nav.about.1}}</a></li>
+				{{if $nav.tos}}<a class="{{$nav.tos.2}}" href="{{$nav.tos.0}}" title="{{$nav.tos.3}}">{{$nav.tos.1}}</a></li>{{/if}}
+				<li role="menuitem"><a class="{{$nav.directory.2}}" href="{{$nav.directory.0}}" title="{{$nav.directory.3}}">{{$nav.directory.1}}</a></li>
 			</ul>
 		</li>
 
@@ -80,31 +80,31 @@
 			<li role="menu" aria-haspopup="true" id="nav-user-linkmenu" class="nav-menu">
 				<a accesskey="u" title="{{$sitelocation}}"><img src="{{$userinfo.icon}}" alt="{{$userinfo.name}}"><span id="nav-user-linklabel">{{$userinfo.name}}</span><span id="intro-update" class="nav-notification"></span></a>
 				<ul id="nav-user-menu" class="menu-popup">
-					<li role="menuitem"> <a  class="{{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}" >{{$nav.search.1}}</a> </li>
-					{{if $nav.introductions}}<li role="menuitem"><a class="{{$nav.introductions.2}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}" >{{$nav.introductions.1}}</a><span id="intro-update-li" class="nav-notification"></span></li>{{/if}}
-					{{if $nav.contacts}}<li role="menuitem"><a class="{{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}" >{{$nav.contacts.1}}</a></li>{{/if}}
-					{{if $nav.messages}}<li role="menuitem"><a class="{{$nav.messages.2}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}" >{{$nav.messages.1}} <span id="mail-update-li" class="nav-notification"></span></a></li>{{/if}}
+					<li role="menuitem"> <a  class="{{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}">{{$nav.search.1}}</a> </li>
+					{{if $nav.introductions}}<li role="menuitem"><a class="{{$nav.introductions.2}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}">{{$nav.introductions.1}}</a><span id="intro-update-li" class="nav-notification"></span></li>{{/if}}
+					{{if $nav.contacts}}<li role="menuitem"><a class="{{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}">{{$nav.contacts.1}}</a></li>{{/if}}
+					{{if $nav.messages}}<li role="menuitem"><a class="{{$nav.messages.2}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}">{{$nav.messages.1}} <span id="mail-update-li" class="nav-notification"></span></a></li>{{/if}}
 					{{if $nav.delegation}}<li role="menuitem"><a class="{{$nav.delegation.2}}" href="{{$nav.delegation.0}}" title="{{$nav.delegation.3}}">{{$nav.delegation.1}}</a></li>{{/if}}
 					{{if $nav.usermenu.1}}<li role="menuitem"><a class="{{$nav.usermenu.1.2}}" href="{{$nav.usermenu.1.0}}" title="{{$nav.usermenu.1.3}}">{{$nav.usermenu.1.1}}</a></li>{{/if}}
 					{{if $nav.settings}}<li role="menuitem"><a class="{{$nav.settings.2}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}">{{$nav.settings.1}}</a></li>{{/if}}
 					{{if $nav.admin}}
 					<li role="menuitem">
-						<a accesskey="a" class="{{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" >{{$nav.admin.1}}</a>
+						<a accesskey="a" class="{{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}">{{$nav.admin.1}}</a>
 					</li>
 					{{/if}}
-					{{if $nav.logout}}<li role="menuitem"><a class="menu-sep {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" >{{$nav.logout.1}}</a></li>{{/if}}
+					{{if $nav.logout}}<li role="menuitem"><a class="menu-sep {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}">{{$nav.logout.1}}</a></li>{{/if}}
 				</ul>
 			</li>
 		{{/if}}
 
 		{{if $nav.login}}
 			<li role="menuitem" id="nav-login-link" class="nav-menu">
-				<a class="{{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}" >{{$nav.login.1}}</a>
+				<a class="{{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}">{{$nav.login.1}}</a>
 			</li>
 		{{/if}}
 		{{if $nav.logout}}
 			<li role="menuitem" id="nav-logout-link" class="nav-menu">
-				<a class="{{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" >{{$nav.logout.1}}</a>
+				<a class="{{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}">{{$nav.logout.1}}</a>
 			</li>
 		{{/if}}
 
@@ -124,13 +124,13 @@
 
 		{{if $nav.admin}}
 			<li role="menuitem" id="nav-admin-link" class="nav-menu">
-				<a accesskey="a" class="{{$nav.admin.2}} icon-sliders" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" ><span class="sr-only">{{$nav.admin.3}}</span></a>
+				<a accesskey="a" class="{{$nav.admin.2}} icon-sliders" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}"><span class="sr-only">{{$nav.admin.3}}</span></a>
 			</li>
 		{{/if}}
 
 		{{if $nav.apps}}
 			<li role="menu" aria-haspopup="true" id="nav-apps-link" class="nav-menu {{$sel.apps}}">
-				<a class=" {{$nav.apps.2}}" title="{{$nav.apps.3}}" >{{$nav.apps.1}}</a>
+				<a class=" {{$nav.apps.2}}" title="{{$nav.apps.3}}">{{$nav.apps.1}}</a>
 				<ul id="nav-apps-menu" class="menu-popup">
 					{{foreach $apps as $ap}}
 					<li role="menuitem">{{$ap nofilter}}</li>
diff --git a/view/theme/vier/templates/wall_item_tag.tpl b/view/theme/vier/templates/wall_item_tag.tpl
index 76e587f00..01207ab11 100644
--- a/view/theme/vier/templates/wall_item_tag.tpl
+++ b/view/theme/vier/templates/wall_item_tag.tpl
@@ -59,9 +59,9 @@
 
 {{* top thread comment box *}}
 {{if $item.threaded}}{{if $item.comment_html}}{{if $item.thread_level==1}}
-<div class="wall-item-comment-wrapper" >{{$item.comment_html nofilter}}</div>
+<div class="wall-item-comment-wrapper">{{$item.comment_html nofilter}}</div>
 {{/if}}{{/if}}{{/if}}
 
 {{if $item.flatten}}
-<div class="wall-item-comment-wrapper" >{{$item.comment_html nofilter}}</div>
+<div class="wall-item-comment-wrapper">{{$item.comment_html nofilter}}</div>
 {{/if}}
diff --git a/view/theme/vier/templates/wall_thread.tpl b/view/theme/vier/templates/wall_thread.tpl
index f8c54d6ae..2d7f856c1 100644
--- a/view/theme/vier/templates/wall_thread.tpl
+++ b/view/theme/vier/templates/wall_thread.tpl
@@ -73,7 +73,7 @@
 		</div>
 
 		<div itemprop="description" class="wall-item-content">
-			{{if $item.title}}<h2><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name">{{$item.title}}</a></h2>{{/if}}
+			{{if $item.title}}<h2><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name" dir="auto">{{$item.title}}</a></h2>{{/if}}
 			<div class="wall-item-body e-content {{if !$item.title}}p-name{{/if}}" dir="auto">{{$item.body_html nofilter}}</div>
 		</div>
 	</div>
diff --git a/view/theme/vier/templates/widget_forumlist_right.tpl b/view/theme/vier/templates/widget_forumlist_right.tpl
index 088db80b3..23ddaa889 100644
--- a/view/theme/vier/templates/widget_forumlist_right.tpl
+++ b/view/theme/vier/templates/widget_forumlist_right.tpl
@@ -25,7 +25,7 @@ function showHideForumlist() {
 			<a href="{{$forum.external_url}}" title="{{$forum.link_desc}}" class="label sparkle" target="_blank" rel="noopener noreferrer">
 				<img class="forumlist-img" src="{{$forum.micro}}" alt="{{$forum.link_desc}}" />
 			</a>
-			<a class="forum-widget-link {{if $forum.selected}}forum-selected{{/if}}" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}" >{{$forum.name}}</a>
+			<a class="forum-widget-link {{if $forum.selected}}forum-selected{{/if}}" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}">{{$forum.name}}</a>
 		</li>
 		{{/if}}
 	
@@ -35,7 +35,7 @@ function showHideForumlist() {
 			<a href="{{$forum.external_url}}" title="{{$forum.link_desc}}" class="label sparkle" target="_blank" rel="noopener noreferrer">
 				<img class="forumlist-img" src="{{$forum.micro}}" alt="{{$forum.link_desc}}" />
 			</a>
-			<a class="forum-widget-link {{if $forum.selected}}forum-selected{{/if}}" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}" >{{$forum.name}}</a>
+			<a class="forum-widget-link {{if $forum.selected}}forum-selected{{/if}}" id="forum-widget-link-{{$forum.id}}" href="{{$forum.url}}">{{$forum.name}}</a>
 		</li>
 		{{/if}}
 		{{/foreach}}

From 6d0f6d94cbad9149bd5ca8c887b4222216f8cc43 Mon Sep 17 00:00:00 2001
From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Wed, 19 May 2021 18:05:56 -0400
Subject: [PATCH 04/24] Add RTL support for post titles and photo captions

---
 view/templates/photo_album.tpl                | 2 +-
 view/templates/search_item.tpl                | 6 +++---
 view/templates/wall_thread.tpl                | 2 +-
 view/theme/frio/templates/search_item.tpl     | 4 ++--
 view/theme/frio/templates/wall_thread.tpl     | 2 +-
 view/theme/quattro/templates/photo_item.tpl   | 4 ++--
 view/theme/quattro/templates/search_item.tpl  | 6 +++---
 view/theme/quattro/templates/wall_thread.tpl  | 2 +-
 view/theme/smoothly/templates/search_item.tpl | 4 ++--
 view/theme/smoothly/templates/wall_thread.tpl | 2 +-
 view/theme/vier/templates/photo_item.tpl      | 5 ++---
 view/theme/vier/templates/search_item.tpl     | 7 +++----
 view/theme/vier/templates/wall_thread.tpl     | 2 +-
 13 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/view/templates/photo_album.tpl b/view/templates/photo_album.tpl
index 653284701..58c7f30ed 100644
--- a/view/templates/photo_album.tpl
+++ b/view/templates/photo_album.tpl
@@ -15,7 +15,7 @@
 <div class="photo-album-image-wrapper" id="photo-album-image-wrapper-{{$photo.id}}">
 	<a href="{{$photo.link}}" class="photo-album-photo-link" id="photo-album-photo-link-{{$photo.id}}" title="{{$photo.title}}">
 		<img src="{{$photo.src}}" alt="{{if $photo.album.name}}{{$photo.album.name}}{{elseif $photo.desc}}{{$photo.desc}}{{elseif $photo.alt}}{{$photo.alt}}{{else}}{{$photo.unknown}}{{/if}}" title="{{$photo.title}}" class="photo-album-photo lframe resize{{$photo.twist}}" id="photo-album-photo-{{$photo.id}}" />
-		<p class='caption'>{{$photo.desc}}</p>		
+		<p class="caption" dir="auto">{{$photo.desc}}</p>		
 	</a>
 </div>
 <div class="photo-album-image-wrapper-end"></div>
diff --git a/view/templates/search_item.tpl b/view/templates/search_item.tpl
index 43333c7bd..c6938e29e 100644
--- a/view/templates/search_item.tpl
+++ b/view/templates/search_item.tpl
@@ -32,7 +32,7 @@
 				
 		</div>			
 		<div class="wall-item-content" id="wall-item-content-{{$item.id}}">
-			<div class="wall-item-title" id="wall-item-title-{{$item.id}}">{{$item.title}}</div>
+			<div class="wall-item-title" id="wall-item-title-{{$item.id}}" dir="auto">{{$item.title}}</div>
 			<div class="wall-item-title-end"></div>
 			<div class="wall-item-body" id="wall-item-body-{{$item.id}}" dir="auto">{{$item.body_html nofilter}}</div>
 			{{if $item.has_cats}}
@@ -56,9 +56,9 @@
 	<div class="wall-item-wrapper-end"></div>
 
 
-	<div class="wall-item-conv" id="wall-item-conv-{{$item.id}}">
+	<div class="wall-item-conv" id="wall-item-conv-{{$item.id}}" dir="auto">
 	{{if $item.conv}}
-			<a href='{{$item.conv.href}}' id='context-{{$item.id}}' title='{{$item.conv.title}}'>{{$item.conv.title}}</a>
+		<a href="{{$item.conv.href}}" id="context-{{$item.id}}" title="{{$item.conv.title}}">{{$item.conv.title}}</a>
 	{{/if}}
 	</div>
 
diff --git a/view/templates/wall_thread.tpl b/view/templates/wall_thread.tpl
index f468bae5b..c7da59a0d 100644
--- a/view/templates/wall_thread.tpl
+++ b/view/templates/wall_thread.tpl
@@ -56,7 +56,7 @@
 				<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}" title="{{$item.localtime}}"><time class="dt-published" datetime="{{$item.localtime}}">{{$item.ago}}</time><span class="pinned">{{$item.pinned}}</span></div>
 		</div>
 		<div class="wall-item-content" id="wall-item-content-{{$item.id}}">
-			<div class="wall-item-title p-name" id="wall-item-title-{{$item.id}}">{{$item.title}}</div>
+			<div class="wall-item-title p-name" id="wall-item-title-{{$item.id}}" dir="auto">{{$item.title}}</div>
 			<div class="wall-item-title-end"></div>
 			<div class="wall-item-body" id="wall-item-body-{{$item.id}}">
 				<span class="e-content" dir="auto">{{$item.body_html nofilter}}<span>
diff --git a/view/theme/frio/templates/search_item.tpl b/view/theme/frio/templates/search_item.tpl
index 7dfdc11cf..344e73f1d 100644
--- a/view/theme/frio/templates/search_item.tpl
+++ b/view/theme/frio/templates/search_item.tpl
@@ -97,7 +97,7 @@
 			{{* item content *}}
 			<div class="wall-item-content {{$item.type}}" id="wall-item-content-{{$item.id}}">
 				{{if $item.title}}
-				<span class="wall-item-title" id="wall-item-title-{{$item.id}}"><h4 class="media-heading"><a href="{{$item.plink.href}}" class="{{$item.sparkle}}">{{$item.title}}</a></h4><br /></span>
+				<span class="wall-item-title" id="wall-item-title-{{$item.id}}"><h4 class="media-heading" dir="auto"><a href="{{$item.plink.href}}" class="{{$item.sparkle}}">{{$item.title}}</a></h4><br /></span>
 				{{/if}}
 
 				<div class="wall-item-body" id="wall-item-body-{{$item.id}}" dir="auto">{{$item.body_html nofilter}}</div>
@@ -278,7 +278,7 @@
 			</div>
 			{{/if}}
 
-			<div class="wall-item-conv" id="wall-item-conv-{{$item.id}}">
+			<div class="wall-item-conv" id="wall-item-conv-{{$item.id}}" dir="auto">
 			{{if $item.conv}}
 				<a href="{{$item.conv.href}}" id="context-{{$item.id}}" title="{{$item.conv.title}}">{{$item.conv.title}}</a>
 			{{/if}}
diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl
index de46a12ac..e91b1b99f 100644
--- a/view/theme/frio/templates/wall_thread.tpl
+++ b/view/theme/frio/templates/wall_thread.tpl
@@ -243,7 +243,7 @@ as the value of $top_child_total (this is done at the end of this file)
 		{{* item content *}}
 		<div class="wall-item-content {{$item.type}}" id="wall-item-content-{{$item.id}}">
 			{{if $item.title}}
-			<span class="wall-item-title" id="wall-item-title-{{$item.id}}"><h4 class="media-heading"><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name">{{$item.title}}</a></h4><br /></span>
+			<span class="wall-item-title" id="wall-item-title-{{$item.id}}"><h4 class="media-heading" dir="auto"><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name">{{$item.title}}</a></h4><br /></span>
 			{{/if}}
 
 			<div class="wall-item-body e-content {{if !$item.title}}p-name{{/if}}" id="wall-item-body-{{$item.id}}" dir="auto">{{$item.body_html nofilter}}</div>
diff --git a/view/theme/quattro/templates/photo_item.tpl b/view/theme/quattro/templates/photo_item.tpl
index ee64f5eda..97cffbb12 100644
--- a/view/theme/quattro/templates/photo_item.tpl
+++ b/view/theme/quattro/templates/photo_item.tpl
@@ -68,8 +68,8 @@
 		<div class="wall-item-like" id="wall-item-like-{{$id}}">{{$like nofilter}}</div>
 		<div class="wall-item-dislike" id="wall-item-dislike-{{$id}}">{{$dislike nofilter}}</div>
 		{{if $conv}}
-		<div class="wall-item-conv" id="wall-item-conv-{{$id}}">
-			<a href='{{$conv.href}}' id='context-{{$id}}' title='{{$conv.title}}'>{{$conv.title}}</a>
+		<div class="wall-item-conv" id="wall-item-conv-{{$id}}" dir="auto">
+			<a href="{{$conv.href}}" id="context-{{$id}}" title="{{$conv.title}}">{{$conv.title}}</a>
 		</div>
 		{{/if}}
 	</div>
diff --git a/view/theme/quattro/templates/search_item.tpl b/view/theme/quattro/templates/search_item.tpl
index 928c36e14..903138874 100644
--- a/view/theme/quattro/templates/search_item.tpl
+++ b/view/theme/quattro/templates/search_item.tpl
@@ -26,7 +26,7 @@
 			<div class="wall-item-location">{{$item.location_html nofilter}}</div>
 		</div>
 		<div class="wall-item-content">
-			{{if $item.title}}<h2><a href="{{$item.plink.href}}">{{$item.title}}</a></h2>{{/if}}
+			{{if $item.title}}<h2 dir="auto"><a href="{{$item.plink.href}}">{{$item.title}}</a></h2>{{/if}}
 			<div class="wall-item-body" dir="auto">{{$item.body_html nofilter}}</div>
 		</div>
 	</div>
@@ -89,8 +89,8 @@
 		<div class="wall-item-like" id="wall-item-like-{{$item.id}}">{{$item.like_html nofilter}}</div>
 		<div class="wall-item-dislike" id="wall-item-dislike-{{$item.id}}">{{$item.dislike_html nofilter}}</div>
 		{{if $item.conv}}
-		<div class="wall-item-conv" id="wall-item-conv-{{$item.id}}">
-			<a href='{{$item.conv.href}}' id='context-{{$item.id}}' title='{{$item.conv.title}}'>{{$item.conv.title}}</a>
+		<div class="wall-item-conv" id="wall-item-conv-{{$item.id}}" dir="auto">
+			<a href="{{$item.conv.href}}" id="context-{{$item.id}}" title="{{$item.conv.title}}">{{$item.conv.title}}</a>
 		</div>
 		{{/if}}
 	</div>
diff --git a/view/theme/quattro/templates/wall_thread.tpl b/view/theme/quattro/templates/wall_thread.tpl
index 8d3faf431..3eab3f569 100644
--- a/view/theme/quattro/templates/wall_thread.tpl
+++ b/view/theme/quattro/templates/wall_thread.tpl
@@ -53,7 +53,7 @@
 			<div class="wall-item-location">{{$item.location_html nofilter}}</div>
 		</div>
 		<div class="wall-item-content">
-			{{if $item.title}}<h2><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name">{{$item.title}}</a></h2>{{/if}}
+			{{if $item.title}}<h2 dir="auto"><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name">{{$item.title}}</a></h2>{{/if}}
 			<div class="wall-item-body e-content {{if !$item.title}}p-name{{/if}}" dir="auto">{{$item.body_html nofilter}}</div>
 		</div>
 	</div>
diff --git a/view/theme/smoothly/templates/search_item.tpl b/view/theme/smoothly/templates/search_item.tpl
index be174b969..7675c2db1 100644
--- a/view/theme/smoothly/templates/search_item.tpl
+++ b/view/theme/smoothly/templates/search_item.tpl
@@ -46,9 +46,9 @@
 	<div class="wall-item-wrapper-end"></div>
 
 
-	<div class="wall-item-conv" id="wall-item-conv-{{$item.id}}">
+	<div class="wall-item-conv" id="wall-item-conv-{{$item.id}}" dir="auto">
 	{{if $item.conv}}
-			<a href='{{$item.conv.href}}' id='context-{{$item.id}}' title='{{$item.conv.title}}'>{{$item.conv.title}}</a>
+		<a href="{{$item.conv.href}}" id="context-{{$item.id}}" title="{{$item.conv.title}}">{{$item.conv.title}}</a>
 	{{/if}}
 	</div>
 	<div class="wall-item-wrapper-end"></div>
diff --git a/view/theme/smoothly/templates/wall_thread.tpl b/view/theme/smoothly/templates/wall_thread.tpl
index 595e065ed..37bff2154 100644
--- a/view/theme/smoothly/templates/wall_thread.tpl
+++ b/view/theme/smoothly/templates/wall_thread.tpl
@@ -60,7 +60,7 @@
 		<div>
 		<hr class="line-dots">
 		</div>
-			<div class="wall-item-title p-name" id="wall-item-title-{{$item.id}}">{{$item.title}}</div>
+			<div class="wall-item-title p-name" id="wall-item-title-{{$item.id}}" dir="auto">{{$item.title}}</div>
 			<div class="wall-item-title-end"></div>
 			<div class="wall-item-body" id="wall-item-body-{{$item.id}}">
 				<span class="e-content" dir="auto">{{$item.body_html nofilter}}</span>
diff --git a/view/theme/vier/templates/photo_item.tpl b/view/theme/vier/templates/photo_item.tpl
index 069bd2229..307ef138f 100644
--- a/view/theme/vier/templates/photo_item.tpl
+++ b/view/theme/vier/templates/photo_item.tpl
@@ -30,9 +30,8 @@
 		</div>
 	</div>
 	<div class="wall-item-bottom">
-		<div class="">
-			<!-- {{if $plink}}<a title="{{$plink.title}}" href="{{$plink.href}}"><i class="icon-link icon-large"></i></a>{{/if}} -->
-			{{if $conv}}<a href='{{$conv.href}}' id='context-{{$id}}' title='{{$conv.title}}'><i class="icon-link icon-large"></i></a>{{/if}}
+		<div dir="auto">
+			{{if $conv}}<a href="{{$conv.href}}" id="context-{{$id}}" title="{{$conv.title}}"><i class="icon-link icon-large"></i></a>{{/if}}
 		</div>
 		<div class="wall-item-actions">
 
diff --git a/view/theme/vier/templates/search_item.tpl b/view/theme/vier/templates/search_item.tpl
index 60e26c729..44fb6804d 100644
--- a/view/theme/vier/templates/search_item.tpl
+++ b/view/theme/vier/templates/search_item.tpl
@@ -31,7 +31,7 @@
 			</span>
 		</div>
 		<div class="wall-item-content">
-			{{if $item.title}}<h2><a href="{{$item.plink.href}}">{{$item.title}}</a></h2>{{/if}}
+			{{if $item.title}}<h2 dir="auto"><a href="{{$item.plink.href}}">{{$item.title}}</a></h2>{{/if}}
 			<div class="wall-item-body" dir="auto">{{$item.body_html nofilter}}</div>
 		</div>
 	</div>
@@ -47,9 +47,8 @@
 		</div>
 	</div>
 	<div class="wall-item-bottom">
-		<div class="">
-			<!-- {{if $item.plink}}<a title="{{$item.plink.title}}" href="{{$item.plink.href}}"><i class="icon-link icon-large"></i></a>{{/if}} -->
-			{{if $item.conv}}<a href='{{$item.conv.href}}' id='context-{{$item.id}}' title='{{$item.conv.title}}'><i class="icon-link icon-large"></i></a>{{/if}}
+		<div dir="auto">
+			{{if $item.conv}}<a href="{{$item.conv.href}}" id="context-{{$item.id}}" title="{{$item.conv.title}}"><i class="icon-link icon-large"></i></a>{{/if}}
 		</div>
 		<div class="wall-item-actions">
 
diff --git a/view/theme/vier/templates/wall_thread.tpl b/view/theme/vier/templates/wall_thread.tpl
index 2d7f856c1..1d13b9e52 100644
--- a/view/theme/vier/templates/wall_thread.tpl
+++ b/view/theme/vier/templates/wall_thread.tpl
@@ -73,7 +73,7 @@
 		</div>
 
 		<div itemprop="description" class="wall-item-content">
-			{{if $item.title}}<h2><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name" dir="auto">{{$item.title}}</a></h2>{{/if}}
+			{{if $item.title}}<h2 dir="auto"><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name" dir="auto">{{$item.title}}</a></h2>{{/if}}
 			<div class="wall-item-body e-content {{if !$item.title}}p-name{{/if}}" dir="auto">{{$item.body_html nofilter}}</div>
 		</div>
 	</div>

From 93f3c511dcba417990c130b90e3d4afa6e45c3c5 Mon Sep 17 00:00:00 2001
From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Thu, 20 May 2021 07:43:12 -0400
Subject: [PATCH 05/24] Fix wrong display of mentions in RTL context

---
 src/Content/Text/BBCode.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php
index 32cd818ca..8c1476fa3 100644
--- a/src/Content/Text/BBCode.php
+++ b/src/Content/Text/BBCode.php
@@ -50,7 +50,7 @@ use Friendica\Util\XML;
 class BBCode
 {
 	// Update this value to the current date whenever changes are made to BBCode::convert
-	const VERSION = '2021-05-01';
+	const VERSION = '2021-05-21';
 
 	const INTERNAL = 0;
 	const EXTERNAL = 1;
@@ -1721,7 +1721,7 @@ class BBCode
 						$text);
 				} elseif (!$simple_html) {
 					$text = preg_replace("/([@!])\[url\=(.*?)\](.*?)\[\/url\]/ism",
-						'$1<a href="$2" class="userinfo mention" title="$3"><bdi>$3</bdi></a>',
+						'<bdi>$1<a href="$2" class="userinfo mention" title="$3">$3</a></bdi>',
 						$text);
 				}
 

From 0e368c4ba4362c5b39bebe81dfa0b45fec623b5d Mon Sep 17 00:00:00 2001
From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Thu, 20 May 2021 08:20:06 -0400
Subject: [PATCH 06/24] Fix display of RTL tags

---
 src/Model/Tag.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Model/Tag.php b/src/Model/Tag.php
index 796cc13f8..1bc700c3f 100644
--- a/src/Model/Tag.php
+++ b/src/Model/Tag.php
@@ -425,8 +425,8 @@ class Tag
 						$item['body'] = str_replace($orig_tag, $tag['url'], $item['body']);
 					}
 
-					$return['hashtags'][] = $prefix . '<a href="' . $tag['url'] . '" target="_blank" rel="noopener noreferrer">' . htmlspecialchars($tag['name']) . '</a>';
-					$return['tags'][] = $prefix . '<a href="' . $tag['url'] . '" target="_blank" rel="noopener noreferrer">' . htmlspecialchars($tag['name']) . '</a>';
+					$return['hashtags'][] = '<bdi>' . $prefix . '<a href="' . $tag['url'] . '" target="_blank" rel="noopener noreferrer">' . htmlspecialchars($tag['name']) . '</a></bdi>';
+					$return['tags'][] = '<bdi>' . $prefix . '<a href="' . $tag['url'] . '" target="_blank" rel="noopener noreferrer">' . htmlspecialchars($tag['name']) . '</a></bdi>';
 					break;
 				case self::MENTION:
 				case self::EXCLUSIVE_MENTION:
@@ -435,8 +435,8 @@ class Tag
 					} else {
 						$tag['url'] = Contact::magicLink($tag['url']);
 					}
-					$return['mentions'][] = $prefix . '<a href="' . $tag['url'] . '" target="_blank" rel="noopener noreferrer">' . htmlspecialchars($tag['name']) . '</a>';
-					$return['tags'][] = $prefix . '<a href="' . $tag['url'] . '" target="_blank" rel="noopener noreferrer">' . htmlspecialchars($tag['name']) . '</a>';
+					$return['mentions'][] = '<bdi>' . $prefix . '<a href="' . $tag['url'] . '" target="_blank" rel="noopener noreferrer">' . htmlspecialchars($tag['name']) . '</a></bdi>';
+					$return['tags'][] = '<bdi>' . $prefix . '<a href="' . $tag['url'] . '" target="_blank" rel="noopener noreferrer">' . htmlspecialchars($tag['name']) . '</a></bdi>';
 					break;
 				case self::IMPLICIT_MENTION:
 					$return['implicit_mentions'][] = $prefix . $tag['name'];

From 2cc4bd24903546528200e069c01c6a06e186842f Mon Sep 17 00:00:00 2001
From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Thu, 20 May 2021 08:37:45 -0400
Subject: [PATCH 07/24] Add RTL support to many input fields

- Compose page
- Post jot
- Comment form
- Event form
---
 view/templates/comment_item.tpl                    | 2 +-
 view/templates/field_input.tpl                     | 2 +-
 view/templates/field_select.tpl                    | 8 ++++----
 view/templates/field_textarea.tpl                  | 2 +-
 view/templates/field_themeselect.tpl               | 2 +-
 view/templates/item/compose.tpl                    | 6 +++---
 view/templates/jot.tpl                             | 6 +++---
 view/theme/duepuntozero/templates/comment_item.tpl | 2 +-
 view/theme/frio/templates/comment_item.tpl         | 2 +-
 view/theme/frio/templates/event_form.tpl           | 4 ++--
 view/theme/frio/templates/jot.tpl                  | 6 +++---
 view/theme/frio/templates/prv_message.tpl          | 2 +-
 view/theme/quattro/templates/comment_item.tpl      | 3 ++-
 view/theme/quattro/templates/jot.tpl               | 6 +++---
 view/theme/smoothly/templates/jot.tpl              | 6 +++---
 view/theme/vier/templates/comment_item.tpl         | 2 +-
 view/theme/vier/templates/event_form.tpl           | 4 ++--
 17 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/view/templates/comment_item.tpl b/view/templates/comment_item.tpl
index 02d34c47e..fe8d28a2f 100644
--- a/view/templates/comment_item.tpl
+++ b/view/templates/comment_item.tpl
@@ -15,7 +15,7 @@
 					<a class="comment-edit-photo-link" href="{{$mylink}}" title="{{$mytitle}}"><img class="my-comment-photo" src="{{$myphoto}}" alt="{{$mytitle}}" title="{{$mytitle}}" /></a>
 				</div>
 				<div class="comment-edit-photo-end"></div>
-				<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});" onBlur="commentClose(this,{{$id}});">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
+				<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});" onBlur="commentClose(this,{{$id}});" dir="auto">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
 				{{if $qcomment}}
 					<select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
 					<option value=""></option>
diff --git a/view/templates/field_input.tpl b/view/templates/field_input.tpl
index ec2de2a4a..3455891b9 100644
--- a/view/templates/field_input.tpl
+++ b/view/templates/field_input.tpl
@@ -1,7 +1,7 @@
 	
 	<div class="field input" id="wrapper_{{$field.0}}">
 		<label for="id_{{$field.0}}">{{$field.1}}{{if $field.4}} <span class="required" title="{{$field.4}}">*</span>{{/if}}</label>
-		<input type="{{$field.6|default:'text'}}" name="{{$field.0}}" id="id_{{$field.0}}" value="{{$field.2}}"{{if $field.4}} required{{/if}}{{if $field.5 eq "autofocus"}} autofocus{{elseif $field.5}} {{$field.5 nofilter}}{{/if}} aria-describedby="{{$field.0}}_tip">
+		<input type="{{$field.6|default:'text'}}" name="{{$field.0}}" id="id_{{$field.0}}" value="{{$field.2}}"{{if $field.4}} required{{/if}}{{if $field.5 eq "autofocus"}} autofocus{{elseif $field.5}} {{$field.5 nofilter}}{{/if}} aria-describedby="{{$field.0}}_tip" dir="auto">
 	{{if $field.3}}
 		<span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
 	{{/if}}
diff --git a/view/templates/field_select.tpl b/view/templates/field_select.tpl
index c174078e2..16a796a44 100644
--- a/view/templates/field_select.tpl
+++ b/view/templates/field_select.tpl
@@ -1,9 +1,9 @@
 
-	<div class='field select'>
-		<label for='id_{{$field.0}}'>{{$field.1}}</label>
-		<select name='{{$field.0}}' id='id_{{$field.0}}' aria-describedby='{{$field.0}}_tip'>
+	<div class="field select">
+		<label for="id_{{$field.0}}">{{$field.1}}</label>
+		<select name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip">
 	{{foreach $field.4 as $opt=>$val}}
-			<option value="{{$opt}}" {{if $opt==$field.2}}selected="selected"{{/if}}>{{$val}}</option>
+			<option value="{{$opt}}" dir="auto"{{if $opt==$field.2}} selected="selected"{{/if}}>{{$val}}</option>
 	{{/foreach}}
 		</select>
 	{{if $field.3}}
diff --git a/view/templates/field_textarea.tpl b/view/templates/field_textarea.tpl
index 5f93ca911..edd48d1d0 100644
--- a/view/templates/field_textarea.tpl
+++ b/view/templates/field_textarea.tpl
@@ -1,7 +1,7 @@
 
 	<div class="field textarea">
 		<label for="id_{{$field.0}}">{{$field.1}}{{if $field.4}} <span class="required" title="{{$field.4}}">*</span>{{/if}}</label>
-		<textarea name="{{$field.0}}" id="id_{{$field.0}}"{{if $field.4}} required{{/if}} aria-describedby="{{$field.0}}_tip">{{$field.2}}</textarea>
+		<textarea name="{{$field.0}}" id="id_{{$field.0}}"{{if $field.4}} required{{/if}} aria-describedby="{{$field.0}}_tip" dir="auto">{{$field.2}}</textarea>
 	{{if $field.3}}
 		<span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
 	{{/if}}
diff --git a/view/templates/field_themeselect.tpl b/view/templates/field_themeselect.tpl
index 922797eb2..60676e5d1 100644
--- a/view/templates/field_themeselect.tpl
+++ b/view/templates/field_themeselect.tpl
@@ -6,7 +6,7 @@
 		<label for="id_{{$field.0}}">{{$field.1}}</label>
 		<select name="{{$field.0}}" id="id_{{$field.0}}" {{if $field.5}}onchange="previewTheme(this);"{{/if}} aria-describedby="{{$field.0}}_tip">
 	{{foreach $field.4 as $opt=>$val}}
-			<option value="{{$opt}}" {{if $opt==$field.2}}selected="selected"{{/if}}>{{$val}}</option>
+			<option value="{{$opt}}" dir="auto"{{if $opt==$field.2}} selected="selected"{{/if}}>{{$val}}</option>
 	{{/foreach}}
 		</select>
 	{{if $field.3}}
diff --git a/view/templates/item/compose.tpl b/view/templates/item/compose.tpl
index 8b7414fd6..df48a1323 100644
--- a/view/templates/item/compose.tpl
+++ b/view/templates/item/compose.tpl
@@ -8,11 +8,11 @@
 			<input type="hidden" name="wall" value="{{$wall}}" />
 
 			<div id="jot-title-wrap">
-				<input type="text" name="title" id="jot-title" class="jothidden jotforms form-control" placeholder="{{$placeholdertitle}}" title="{{$placeholdertitle}}" value="{{$title}}" tabindex="1"/>
+				<input type="text" name="title" id="jot-title" class="jothidden jotforms form-control" placeholder="{{$placeholdertitle}}" title="{{$placeholdertitle}}" value="{{$title}}" tabindex="1" dir="auto" />
 			</div>
 		    {{if $placeholdercategory}}
 				<div id="jot-category-wrap">
-					<input name="category" id="jot-category" class="jothidden jotforms form-control" type="text" placeholder="{{$placeholdercategory}}" title="{{$placeholdercategory}}" value="{{$category}}" tabindex="2"/>
+					<input name="category" id="jot-category" class="jothidden jotforms form-control" type="text" placeholder="{{$placeholdercategory}}" title="{{$placeholdercategory}}" value="{{$category}}" tabindex="2" dir="auto" />
 				</div>
 		    {{/if}}
 
@@ -44,7 +44,7 @@
 				</span>
 			</p>
 			<p>
-				<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text form-control text-autosize" name="body" placeholder="{{$default}}" rows="7" tabindex="3">{{$body}}</textarea>
+				<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text form-control text-autosize" name="body" placeholder="{{$default}}" rows="7" tabindex="3" dir="auto" dir="auto">{{$body}}</textarea>
 			</p>
 
 			<p class="comment-edit-submit-wrapper">
diff --git a/view/templates/jot.tpl b/view/templates/jot.tpl
index 167e47da5..73d341aae 100644
--- a/view/templates/jot.tpl
+++ b/view/templates/jot.tpl
@@ -18,13 +18,13 @@
 		{{if $notes_cid}}
 		<input type="hidden" name="contact_allow[]" value="<{{$notes_cid}}>" />
 		{{/if}}
-		<div id="jot-title-wrap"><input name="title" id="jot-title" type="text" placeholder="{{$placeholdertitle}}" value="{{$title}}" class="jothidden" style="display:none"></div>
+		<div id="jot-title-wrap"><input name="title" id="jot-title" type="text" placeholder="{{$placeholdertitle}}" value="{{$title}}" class="jothidden" style="display:none" dir="auto"></div>
 		{{if $placeholdercategory}}
-		<div id="jot-category-wrap"><input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" value="{{$category}}" class="jothidden" style="display:none" /></div>
+		<div id="jot-category-wrap"><input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" value="{{$category}}" class="jothidden" style="display:none" dir="auto"></div>
 		{{/if}}
 		<div id="jot-text-wrap">
 		<img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
-		<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}">{{if $content}}{{$content nofilter}}{{/if}}</textarea>
+		<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}" dir="auto">{{if $content}}{{$content nofilter}}{{/if}}</textarea>
 		</div>
 
 <div id="profile-jot-submit-wrapper" class="jothidden">
diff --git a/view/theme/duepuntozero/templates/comment_item.tpl b/view/theme/duepuntozero/templates/comment_item.tpl
index 1d416fdf1..3afbac126 100644
--- a/view/theme/duepuntozero/templates/comment_item.tpl
+++ b/view/theme/duepuntozero/templates/comment_item.tpl
@@ -42,7 +42,7 @@
 						data-role="insert-formatting" data-bbcode="video" data-id="{{$id}}"></a></li>
 				</ul>
 				<div class="comment-edit-bb-end"></div>
-				<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen(this, {{$id}});" onBlur="commentClose(this,{{$id}});cmtBbClose(this,{{$id}});">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
+				<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen(this, {{$id}});" onBlur="commentClose(this,{{$id}});cmtBbClose(this,{{$id}});" dir="auto">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
 				{{if $qcomment}}
 					<select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
 					<option value=""></option>
diff --git a/view/theme/frio/templates/comment_item.tpl b/view/theme/frio/templates/comment_item.tpl
index aab6aee94..bece95e78 100644
--- a/view/theme/frio/templates/comment_item.tpl
+++ b/view/theme/frio/templates/comment_item.tpl
@@ -39,7 +39,7 @@
 			</span>
 		</p>
 		<p>
-			<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty form-control text-autosize" name="body" placeholder="{{$comment}}" rows="3" data-default="{{$default}}">{{$default}}</textarea>
+			<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty form-control text-autosize" name="body" placeholder="{{$comment}}" rows="3" data-default="{{$default}}" dir="auto">{{$default}}</textarea>
 		</p>
 {{if $qcomment}}
 		<p>
diff --git a/view/theme/frio/templates/event_form.tpl b/view/theme/frio/templates/event_form.tpl
index 54dad0047..e1befe6a4 100644
--- a/view/theme/frio/templates/event_form.tpl
+++ b/view/theme/frio/templates/event_form.tpl
@@ -75,7 +75,7 @@
 			{{* The textarea for the event description *}}
 			<div class="form-group">
 				<div id="event-desc-text"><b>{{$d_text}}</b></div>
-				<textarea id="comment-edit-text-desc" class="form-control text-autosize" name="desc">{{$d_orig}}</textarea>
+				<textarea id="comment-edit-text-desc" class="form-control text-autosize" name="desc" dir="auto">{{$d_orig}}</textarea>
 				<ul id="event-desc-text-edit-bb" class="comment-edit-bb comment-icon-list nav nav-pills hidden-xs pull-left">
 					{{* commented out because it isn't implemented yet
 					<li>
@@ -122,7 +122,7 @@
 			{{* The textarea for the event location *}}
 			<div class="form-group">
 				<div id="event-location-text"><b>{{$l_text}}</b></div>
-				<textarea id="comment-edit-text-loc" class="form-control text-autosize" name="location">{{$l_orig}}</textarea>
+				<textarea id="comment-edit-text-loc" class="form-control text-autosize" name="location" dir="auto">{{$l_orig}}</textarea>
 				<ul id="comment-tools-loc" class="comment-edit-bb comment-icon-list nav nav-pills hidden-xs pull-left">
 					{{* commented out because it isn't implemented yet
 					<li>
diff --git a/view/theme/frio/templates/jot.tpl b/view/theme/frio/templates/jot.tpl
index 4ecf6a7c3..a7f63f2db 100644
--- a/view/theme/frio/templates/jot.tpl
+++ b/view/theme/frio/templates/jot.tpl
@@ -93,14 +93,14 @@
 					{{if $notes_cid}}
 					<input type="hidden" name="contact_allow[]" value="<{{$notes_cid}}>" />
 					{{/if}}
-					<div id="jot-title-wrap"><input name="title" id="jot-title" class="jothidden jotforms form-control" type="text" placeholder="{{$placeholdertitle}}" title="{{$placeholdertitle}}" value="{{$title}}" style="display:block;" /></div>
+					<div id="jot-title-wrap"><input name="title" id="jot-title" class="jothidden jotforms form-control" type="text" placeholder="{{$placeholdertitle}}" title="{{$placeholdertitle}}" value="{{$title}}" style="display:block;" dir="auto" /></div>
 					{{if $placeholdercategory}}
-					<div id="jot-category-wrap"><input name="category" id="jot-category" class="jothidden jotforms form-control" type="text" placeholder="{{$placeholdercategory}}" title="{{$placeholdercategory}}" value="{{$category}}" /></div>
+					<div id="jot-category-wrap"><input name="category" id="jot-category" class="jothidden jotforms form-control" type="text" placeholder="{{$placeholdercategory}}" title="{{$placeholdercategory}}" value="{{$category}}" dir="auto" /></div>
 					{{/if}}
 
 					{{* The jot text field in which the post text is inserted *}}
 					<div id="jot-text-wrap">
-						<textarea rows="2" cols="64" class="profile-jot-text form-control text-autosize" id="profile-jot-text" name="body" placeholder="{{$share}}" onFocus="jotTextOpenUI(this);" onBlur="jotTextCloseUI(this);" style="min-width:100%; max-width:100%;">{{if $content}}{{$content nofilter}}{{/if}}</textarea>
+						<textarea rows="2" cols="64" class="profile-jot-text form-control text-autosize" id="profile-jot-text" name="body" placeholder="{{$share}}" onFocus="jotTextOpenUI(this);" onBlur="jotTextCloseUI(this);" style="min-width:100%; max-width:100%;" dir="auto">{{if $content}}{{$content nofilter}}{{/if}}</textarea>
 					</div>
 
 					<ul id="profile-jot-submit-wrapper" class="jothidden nav nav-pills">
diff --git a/view/theme/frio/templates/prv_message.tpl b/view/theme/frio/templates/prv_message.tpl
index 741116bb1..ce61ffbe8 100644
--- a/view/theme/frio/templates/prv_message.tpl
+++ b/view/theme/frio/templates/prv_message.tpl
@@ -19,7 +19,7 @@
 	{{* The message input field which contains the message text *}}
 	<div id="prvmail-message-label" class="form-group">
 		<label for="comment-edit-text-input">{{$yourmessage}}</label>
-		<textarea rows="8" cols="72" class="prvmail-text form-control text-autosize" id="comment-edit-text-input" name="body" tabindex="12">{{$text}}</textarea>
+		<textarea rows="8" cols="72" class="prvmail-text form-control text-autosize" id="comment-edit-text-input" name="body" tabindex="12" dir="auto">{{$text}}</textarea>
 	</div>
 
 	<ul id="prvmail-text-edit-bb" class="comment-edit-bb comment-icon-list nav nav-pills hidden-xs pull-left">
diff --git a/view/theme/quattro/templates/comment_item.tpl b/view/theme/quattro/templates/comment_item.tpl
index cb6f4ad2f..c83a05be6 100644
--- a/view/theme/quattro/templates/comment_item.tpl
+++ b/view/theme/quattro/templates/comment_item.tpl
@@ -40,7 +40,8 @@
 					class="comment-edit-text-empty"
 					name="body"
 					placeholder="{{$comment}}"
-					onFocus="commentOpen(this,{{$id}}) && cmtBbOpen({{$id}});">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
+					onFocus="commentOpen(this,{{$id}}) && cmtBbOpen({{$id}});"
+					dir="auto">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
 				{{if $qcomment}}
 					<select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
 					<option value=""></option>
diff --git a/view/theme/quattro/templates/jot.tpl b/view/theme/quattro/templates/jot.tpl
index 0c2324408..2edd821b8 100644
--- a/view/theme/quattro/templates/jot.tpl
+++ b/view/theme/quattro/templates/jot.tpl
@@ -1,9 +1,9 @@
 <form id="profile-jot-form" action="{{$action}}" method="post">
 	<div id="jot">
 		<div id="profile-jot-desc" class="jothidden">&nbsp;</div>
-		<input name="title" id="jot-title" type="text" placeholder="{{$placeholdertitle}}" title="{{$placeholdertitle}}" value="{{$title}}" class="jothidden" style="display:none" />
+		<input name="title" id="jot-title" type="text" placeholder="{{$placeholdertitle}}" title="{{$placeholdertitle}}" value="{{$title}}" class="jothidden" style="display:none" dir="auto" />
 		{{if $placeholdercategory}}
-		<input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" title="{{$placeholdercategory}}" value="{{$category}}" class="jothidden" style="display:none" />
+		<input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" title="{{$placeholdercategory}}" value="{{$category}}" class="jothidden" style="display:none" dir="auto" />
 		{{/if}}
 		<div id="character-counter" class="grey jothidden"></div>
 		<input type="hidden" name="wall" value="{{$wall}}" />
@@ -19,7 +19,7 @@
 		<input type="hidden" name="contact_allow[]" value="<{{$notes_cid}}>" />
 		{{/if}}
 
-		<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}">{{if $content}}{{$content nofilter}}{{/if}}</textarea>
+		<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}" dir="auto">{{if $content}}{{$content nofilter}}{{/if}}</textarea>
 
 		<ul id="jot-tools" class="jothidden" style="display:none">
 			<li><a href="#" onclick="return false;" id="wall-image-upload" title="{{$upload}}">{{$shortupload}}</a></a></li>
diff --git a/view/theme/smoothly/templates/jot.tpl b/view/theme/smoothly/templates/jot.tpl
index 61d6b5b01..f2e4f2f0d 100644
--- a/view/theme/smoothly/templates/jot.tpl
+++ b/view/theme/smoothly/templates/jot.tpl
@@ -16,16 +16,16 @@
 		<input type="hidden" name="preview" id="jot-preview" value="0" />
 		<input type="hidden" name="post_id_random" value="{{$rand_num}}" />
 		<div id="jot-title-wrap">
-			<input name="title" id="jot-title" type="text" placeholder="{{$placeholdertitle}}" value="{{$title}}" class="jothidden" style="display:none">
+			<input name="title" id="jot-title" type="text" placeholder="{{$placeholdertitle}}" value="{{$title}}" class="jothidden" style="display:none" dir="auto">
 		</div>
 		{{if $placeholdercategory}}
 		<div id="jot-category-wrap">
-			<input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" value="{{$category}}" class="jothidden" style="display:none" />
+			<input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" value="{{$category}}" class="jothidden" style="display:none" dir="auto" />
 		</div>
 		{{/if}}
 		<div id="jot-text-wrap">
 			<img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" /><br>
-			<textarea rows="5" cols="80" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}">
+			<textarea rows="5" cols="80" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}" dir="auto">
 			{{if $content}}{{$content nofilter}}{{/if}}
 			</textarea>
 		</div>
diff --git a/view/theme/vier/templates/comment_item.tpl b/view/theme/vier/templates/comment_item.tpl
index ef48ac7ef..8caf0d54c 100644
--- a/view/theme/vier/templates/comment_item.tpl
+++ b/view/theme/vier/templates/comment_item.tpl
@@ -15,7 +15,7 @@
 					<a class="comment-edit-photo-link" href="{{$mylink}}" title="{{$mytitle}}"><img class="my-comment-photo" src="{{$myphoto}}" alt="{{$mytitle}}" title="{{$mytitle}}" /></a>
 				</div>
 				<div class="comment-edit-photo-end"></div>
-				<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
+				<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});" dir="auto">{{if $threaded != false}}{{$default}}{{/if}}</textarea>
 				{{if $qcomment}}
 					<select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
 					<option value=""></option>
diff --git a/view/theme/vier/templates/event_form.tpl b/view/theme/vier/templates/event_form.tpl
index e93de71c6..a5604d929 100644
--- a/view/theme/vier/templates/event_form.tpl
+++ b/view/theme/vier/templates/event_form.tpl
@@ -25,7 +25,7 @@
 
 
 <div id="event-desc-text">{{$d_text}}</div>
-<textarea id="comment-edit-text-desc" rows="8" cols="64" name="desc" autocomplete="off">{{$d_orig}}</textarea>
+<textarea id="comment-edit-text-desc" rows="8" cols="64" name="desc" autocomplete="off" dir="auto">{{$d_orig}}</textarea>
 <div id="event-desc-text-edit-bb" class="comment-edit-bb">
 	<a title="{{$edimg}}" data-role="insert-formatting" data-bbcode="img" data-id="desc"><i class="icon-picture"></i></a>
 	<a title="{{$edurl}}" data-role="insert-formatting" data-bbcode="url" data-id="desc"><i class="icon-link"></i></a>
@@ -38,7 +38,7 @@
 </div>
 
 <div id="event-location-text">{{$l_text}}</div>
-<textarea id="comment-edit-text-location" rows="4" cols="64" name="location">{{$l_orig}}</textarea>
+<textarea id="comment-edit-text-location" rows="4" cols="64" name="location" dir="auto">{{$l_orig}}</textarea>
 <div id="event-location-text-edit-bb" class="comment-edit-bb">
 	<a title="{{$edimg}}" data-role="insert-formatting" data-bbcode="img" data-id="location"><i class="icon-picture"></i></a>
 	<a title="{{$edurl}}" data-role="insert-formatting" data-bbcode="url" data-id="location"><i class="icon-link"></i></a>

From d66f1e30ae04f37ba4e27124dec4b936d66baa85 Mon Sep 17 00:00:00 2001
From: very-ape <84299128+very-ape@users.noreply.github.com>
Date: Thu, 20 May 2021 11:05:48 -0700
Subject: [PATCH 08/24] Apply suggestions from code review

Also clean up some code, make it less needlessly verbose.

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
---
 src/Model/User.php | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/Model/User.php b/src/Model/User.php
index 8a9f0a930..a0a40069f 100644
--- a/src/Model/User.php
+++ b/src/Model/User.php
@@ -523,19 +523,18 @@ class User
 		try {
 			$user = self::getAuthenticationInfo($user_info);
 		} catch (Exception $e) {
-			// Addons can create users, and creating a numeric username would create
-			// abiguity with user IDs, possibly opening up an attack vector.
-			// So let's be very careful about that.
-			if (is_numeric($user_info) || is_numeric($user_info['nickname'] ?? '')) {
-				throw $e;
-			}
-
 			$username = (is_string($user_info) ? $user_info : $user_info['nickname'] ?? '');
 
-			if (!$username) {
+			// Addons can create users, and since this 'catch' branch should only
+			// execute if getAuthenticationInfo can't find an existing user, that's
+			// exactly what will happen here. Creating a numeric username would create
+			// abiguity with user IDs, possibly opening up an attack vector.
+			// So let's be very careful about that.
+			if (empty($username) || is_numeric($user_info) || is_numeric($user_info['nickname'] ?? '')) {
 				throw $e;
 			}
-			return self::getIdFromAuthenticateHooks($user_info, $password);
+
+			return self::getIdFromAuthenticateHooks($username, $password);
 		}
 
 		if ($third_party && DI::pConfig()->get($user['uid'], '2fa', 'verified')) {
@@ -582,7 +581,8 @@ class User
 	 * @return int User Id if authentication is successful
 	 * @throws HTTPException\ForbiddenException
 	 */
-	public static function getIdFromAuthenticateHooks($username, $password) {
+	public static function getIdFromAuthenticateHooks($username, $password)
+	{
 		$addon_auth = [
 			'username'      => $username,
 			'password'      => $password,

From e2d93b57da1b83bdde21f21aa478a9e319f230c4 Mon Sep 17 00:00:00 2001
From: very-ape <84299128+very-ape@users.noreply.github.com>
Date: Thu, 20 May 2021 11:54:30 -0700
Subject: [PATCH 09/24] Update src/Model/User.php

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
---
 src/Model/User.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Model/User.php b/src/Model/User.php
index a0a40069f..38a22f70f 100644
--- a/src/Model/User.php
+++ b/src/Model/User.php
@@ -530,7 +530,7 @@ class User
 			// exactly what will happen here. Creating a numeric username would create
 			// abiguity with user IDs, possibly opening up an attack vector.
 			// So let's be very careful about that.
-			if (empty($username) || is_numeric($user_info) || is_numeric($user_info['nickname'] ?? '')) {
+			if (empty($username) || is_numeric($username)) {
 				throw $e;
 			}
 

From fe52719d374fc0dc7155835c930de338095b258e Mon Sep 17 00:00:00 2001
From: very-ape <git@verya.pe>
Date: Thu, 20 May 2021 13:47:12 -0700
Subject: [PATCH 10/24] Fix Message button.

---
 src/Model/Profile.php | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/Model/Profile.php b/src/Model/Profile.php
index 3e35d60c2..ff0897749 100644
--- a/src/Model/Profile.php
+++ b/src/Model/Profile.php
@@ -145,7 +145,7 @@ class Profile
 	 */
 	public static function load(App $a, $nickname, array $profiledata = [], $show_connect = true)
 	{
-		$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_removed' => false]);
+		$user = DBA::selectFirst('user', [], ['nickname' => $nickname, 'account_removed' => false]);
 
 		if (!DBA::isResult($user) && empty($profiledata)) {
 			Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
@@ -166,7 +166,16 @@ class Profile
 			}
 		}
 
-		$profile = !empty($user['uid']) ? User::getOwnerDataById($user['uid'], false) : [];
+		if (empty($user['uid'])) {
+			$profile = [];
+		} else {
+			$profile = array_merge(
+				$user,
+				Profile::getByUID($user['uid']),
+				Contact::getById(Contact::getIdForURL(Strings::normaliseLink(DI::baseurl() . '/profile/' . $nickname), local_user()))
+			);
+			$profile['cid'] = $profile['id'];
+		}
 
 		if (empty($profile) && empty($profiledata)) {
 			Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
@@ -334,7 +343,7 @@ class Profile
 
 			if (Contact::canReceivePrivateMessages($profile)) {
 				if ($visitor_is_followed || $visitor_is_following) {
-					$wallmessage_link = $visitor_base_path . '/message/new/' . base64_encode($profile['addr'] ?? '');
+					$wallmessage_link = $visitor_base_path . '/message/new/' . $profile['cid'];
 				} elseif ($visitor_is_authenticated && !empty($profile['unkmail'])) {
 					$wallmessage_link = 'wallmessage/' . $profile['nickname'];
 				}

From 8bf80c92bdb7aee58671504aab9018c3adb70a29 Mon Sep 17 00:00:00 2001
From: Tobias Diekershoff <tobias.diekershoff@gmx.net>
Date: Fri, 21 May 2021 18:38:54 +0200
Subject: [PATCH 11/24] version 2021.06-rc

---
 VERSION  | 2 +-
 boot.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/VERSION b/VERSION
index e9cd37efe..79ec0dc3a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2021.06-dev
+2021.06-rc
diff --git a/boot.php b/boot.php
index bbb66c2f9..aa3739f01 100644
--- a/boot.php
+++ b/boot.php
@@ -38,7 +38,7 @@ use Friendica\Util\DateTimeFormat;
 
 define('FRIENDICA_PLATFORM',     'Friendica');
 define('FRIENDICA_CODENAME',     'Siberian Iris');
-define('FRIENDICA_VERSION',      '2021.06-dev');
+define('FRIENDICA_VERSION',      '2021.06-rc');
 define('DFRN_PROTOCOL_VERSION',  '2.23');
 define('NEW_TABLE_STRUCTURE_VERSION', 1288);
 

From 93926e99b89524a9f4ce7e52a7a583960e178505 Mon Sep 17 00:00:00 2001
From: very-ape <git@verya.pe>
Date: Fri, 21 May 2021 10:15:32 -0700
Subject: [PATCH 12/24] Use getByNickname as suggested in code review.

---
 src/Model/Profile.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Model/Profile.php b/src/Model/Profile.php
index ff0897749..745492994 100644
--- a/src/Model/Profile.php
+++ b/src/Model/Profile.php
@@ -145,7 +145,7 @@ class Profile
 	 */
 	public static function load(App $a, $nickname, array $profiledata = [], $show_connect = true)
 	{
-		$user = DBA::selectFirst('user', [], ['nickname' => $nickname, 'account_removed' => false]);
+		$user = User::getByNickname($nickname);
 
 		if (!DBA::isResult($user) && empty($profiledata)) {
 			Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);

From 52c62f8d1d6096f36b3be3c5d623d98fa4e0666d Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Fri, 21 May 2021 17:49:25 +0000
Subject: [PATCH 13/24] New section for dummy endpoints

---
 doc/API-Mastodon.md | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md
index a734bd544..5610f926f 100644
--- a/doc/API-Mastodon.md
+++ b/doc/API-Mastodon.md
@@ -119,17 +119,29 @@ These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/en
 
 ## Currently unimplemented endpoints
 
-These emdpoints are planned to be implemented
+These emdpoints are planned to be implemented somewhere in the future.
 
 - [`PATCH /api/v1/accounts/update_credentials`](https://docs.joinmastodon.org/methods/accounts/)
 - [`GET /api/v1/instance/activity`](https://docs.joinmastodon.org/methods/instance#weekly-activity)
 
+## Dummy endpoints
+
+These endpoints are returning empty data to avoid error messages with (for example) mobile clients.
+They belong to a functionality that doesn't exist in Friendica yet.
+
+- [`GET /api/v1/accounts/:id/identity_proofs`](https://docs.joinmastodon.org/methods/accounts/)
+- [`GET /api/v1/announcements`](https://docs.joinmastodon.org/methods/announcements/)
+- [`GET /api/v1/endorsements`](https://docs.joinmastodon.org/methods/accounts/endorsements/)
+- [`GET /api/v1/filters`](https://docs.joinmastodon.org/methods/accounts/filters/)
+- [`GET /api/v1/markers`](https://docs.joinmastodon.org/methods/timelines/markers/)
+- [`GET /api/v1/scheduled_statuses`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)
+
 ## Non supportable endpoints
 
-These endpoints won't be implemented, since they refer to functionality that doesn't exist in Friendica
+These endpoints won't be implemented at the moment.
+They belong to a functionality that doesn't exist in Friendica yet.
 
 - [`POST /api/v1/accounts`](https://docs.joinmastodon.org/methods/accounts/)
-- [`GET /api/v1/accounts/:id/identity_proofs`](https://docs.joinmastodon.org/methods/accounts/)
 - [`POST /api/v1/accounts/:id/pin`](https://docs.joinmastodon.org/methods/accounts/)
 - [`POST /api/v1/accounts/:id/unpin`](https://docs.joinmastodon.org/methods/accounts/)
 - [`GET /api/v1/admin/accounts`](https://docs.joinmastodon.org/methods/admin/)
@@ -138,29 +150,24 @@ These endpoints won't be implemented, since they refer to functionality that doe
 - [`GET /api/v1/admin/reports`](https://docs.joinmastodon.org/methods/admin/)
 - [`GET /api/v1/admin/reports/:id`](https://docs.joinmastodon.org/methods/admin/)
 - [`POST /api/v1/admin/reports/:id/{action}`](https://docs.joinmastodon.org/methods/admin/)
-- [`GET /api/v1/announcements`](https://docs.joinmastodon.org/methods/announcements/)
 - [`POST /api/v1/announcements/:id/dismiss`](https://docs.joinmastodon.org/methods/announcements/)
 - [`PUT /api/v1/announcements/:id/reactions/{name}`](https://docs.joinmastodon.org/methods/announcements/)
 - [`DELETE /api/v1/announcements/:id/reactions/{name}`](https://docs.joinmastodon.org/methods/announcements/)
 - [`GET /api/v1/domain_blocks`](https://docs.joinmastodon.org/methods/accounts/domain_blocks/)
 - [`POST /api/v1/domain_blocks`](https://docs.joinmastodon.org/methods/accounts/domain_blocks/)
 - [`DELETE /api/v1/domain_blocks`](https://docs.joinmastodon.org/methods/accounts/domain_blocks/)
-- [`GET /api/v1/endorsements`](https://docs.joinmastodon.org/methods/accounts/endorsements/)
 - [`GET /api/v1/featured_tags`](https://docs.joinmastodon.org/methods/accounts/featured_tags/)
 - [`POST /api/v1/featured_tags`](https://docs.joinmastodon.org/methods/accounts/featured_tags/)
 - [`DELETE /api/v1/featured_tags/:id`](https://docs.joinmastodon.org/methods/accounts/featured_tags/)
 - [`GET /api/v1/featured_tags/suggestions`](https://docs.joinmastodon.org/methods/accounts/featured_tags/)
-- [`GET /api/v1/filters`](https://docs.joinmastodon.org/methods/accounts/filters/)
 - [`GET /api/v1/filters/:id`](https://docs.joinmastodon.org/methods/accounts/filters/)
 - [`POST /api/v1/filters/:id`](https://docs.joinmastodon.org/methods/accounts/filters/)
 - [`PUT /api/v1/filters/:id`](https://docs.joinmastodon.org/methods/accounts/filters/)
 - [`DELETE /api/v1/filters/:id`](https://docs.joinmastodon.org/methods/accounts/filters/)
-- [`GET /api/v1/markers`](https://docs.joinmastodon.org/methods/timelines/markers/)
 - [`POST /api/v1/markers`](https://docs.joinmastodon.org/methods/timelines/markers/)
 - [`GET /api/v1/polls/:id`](https://docs.joinmastodon.org/methods/statuses/polls/)
 - [`POST /api/v1/polls/:id/votes`](https://docs.joinmastodon.org/methods/statuses/polls/)
 - [`POST /api/v1/reports`](https://docs.joinmastodon.org/methods/accounts/reports/)
-- [`GET /api/v1/scheduled_statuses`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)
 - [`GET /api/v1/scheduled_statuses/:id`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)
 - [`PUT /api/v1/scheduled_statuses/:id`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)
 - [`DELETE /api/v1/scheduled_statuses/:id`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)

From 081652e09a3613bc3545b93f0f5df3e7e107327e Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Fri, 21 May 2021 18:00:03 +0000
Subject: [PATCH 14/24] Wrong class path

---
 .../Api/Mastodon/{Conversation.php => Conversations.php}    | 2 +-
 src/Module/Api/Mastodon/Conversations/Read.php              | 2 +-
 static/routes.config.php                                    | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
 rename src/Module/Api/Mastodon/{Conversation.php => Conversations.php} (98%)

diff --git a/src/Module/Api/Mastodon/Conversation.php b/src/Module/Api/Mastodon/Conversations.php
similarity index 98%
rename from src/Module/Api/Mastodon/Conversation.php
rename to src/Module/Api/Mastodon/Conversations.php
index e87818ac2..3b4496a01 100644
--- a/src/Module/Api/Mastodon/Conversation.php
+++ b/src/Module/Api/Mastodon/Conversations.php
@@ -29,7 +29,7 @@ use Friendica\Module\BaseApi;
 /**
  * @see https://docs.joinmastodon.org/methods/timelines/conversations/
  */
-class Conversation extends BaseApi
+class Conversations extends BaseApi
 {
 	public static function delete(array $parameters = [])
 	{
diff --git a/src/Module/Api/Mastodon/Conversations/Read.php b/src/Module/Api/Mastodon/Conversations/Read.php
index d1c349eaa..955ca5c96 100644
--- a/src/Module/Api/Mastodon/Conversations/Read.php
+++ b/src/Module/Api/Mastodon/Conversations/Read.php
@@ -19,7 +19,7 @@
  *
  */
 
-namespace Friendica\Module\Api\Mastodon\Conversation;
+namespace Friendica\Module\Api\Mastodon\Conversations;
 
 use Friendica\Core\System;
 use Friendica\Database\DBA;
diff --git a/static/routes.config.php b/static/routes.config.php
index 80b1aadeb..4569038a4 100644
--- a/static/routes.config.php
+++ b/static/routes.config.php
@@ -90,9 +90,9 @@ return [
 			'/apps/verify_credentials'           => [Module\Api\Mastodon\Apps\VerifyCredentials::class,   [R::GET         ]],
 			'/blocks'                            => [Module\Api\Mastodon\Blocks::class,                   [R::GET         ]],
 			'/bookmarks'                         => [Module\Api\Mastodon\Bookmarks::class,                [R::GET         ]],
-			'/conversations'                     => [Module\Api\Mastodon\Conversation::class,             [R::GET         ]],
-			'/conversations/{id:\d+}'            => [Module\Api\Mastodon\Conversation::class,             [R::DELETE      ]],
-			'/conversations/{id:\d+}/read'       => [Module\Api\Mastodon\Conversation\Read::class,        [R::POST        ]],
+			'/conversations'                     => [Module\Api\Mastodon\Conversations::class,            [R::GET         ]],
+			'/conversations/{id:\d+}'            => [Module\Api\Mastodon\Conversations::class,            [R::DELETE      ]],
+			'/conversations/{id:\d+}/read'       => [Module\Api\Mastodon\Conversations\Read::class,       [R::POST        ]],
 			'/custom_emojis'                     => [Module\Api\Mastodon\CustomEmojis::class,             [R::GET         ]],
 			'/domain_blocks'                     => [Module\Api\Mastodon\Unimplemented::class,            [R::GET, R::POST, R::DELETE]], // not supported
 			'/directory'                         => [Module\Api\Mastodon\Directory::class,                [R::GET         ]],

From 9330fe1440945f11fc8e0fce9b1c5c867b1aa996 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Fri, 21 May 2021 18:18:39 +0000
Subject: [PATCH 15/24] Updated messages.po

---
 view/lang/C/messages.po | 148 ++++++++++++++++++++--------------------
 1 file changed, 74 insertions(+), 74 deletions(-)

diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po
index 2234a8c16..ac5bf2bf9 100644
--- a/view/lang/C/messages.po
+++ b/view/lang/C/messages.po
@@ -6,9 +6,9 @@
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: 2021.06-dev\n"
+"Project-Id-Version: 2021.06-rc\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-05-16 07:41+0000\n"
+"POT-Creation-Date: 2021-05-21 18:18+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -39,8 +39,8 @@ msgstr ""
 
 #: include/api.php:4528 mod/photos.php:107 mod/photos.php:211
 #: mod/photos.php:639 mod/photos.php:1043 mod/photos.php:1060
-#: mod/photos.php:1609 src/Model/User.php:1045 src/Model/User.php:1053
-#: src/Model/User.php:1061 src/Module/Settings/Profile/Photo/Crop.php:97
+#: mod/photos.php:1609 src/Model/User.php:1100 src/Model/User.php:1108
+#: src/Model/User.php:1116 src/Module/Settings/Profile/Photo/Crop.php:97
 #: src/Module/Settings/Profile/Photo/Crop.php:113
 #: src/Module/Settings/Profile/Photo/Crop.php:129
 #: src/Module/Settings/Profile/Photo/Crop.php:178
@@ -54,7 +54,7 @@ msgstr ""
 msgid "%1$s poked %2$s"
 msgstr ""
 
-#: include/conversation.php:227 src/Model/Item.php:2523
+#: include/conversation.php:227 src/Model/Item.php:2534
 msgid "event"
 msgstr ""
 
@@ -62,7 +62,7 @@ msgstr ""
 msgid "status"
 msgstr ""
 
-#: include/conversation.php:235 mod/tagger.php:90 src/Model/Item.php:2525
+#: include/conversation.php:235 mod/tagger.php:90 src/Model/Item.php:2536
 msgid "photo"
 msgstr ""
 
@@ -951,7 +951,7 @@ msgstr ""
 msgid "list"
 msgstr ""
 
-#: mod/cal.php:297 src/Console/User.php:182 src/Model/User.php:607
+#: mod/cal.php:297 src/Console/User.php:182 src/Model/User.php:662
 #: src/Module/Admin/Users/Active.php:73 src/Module/Admin/Users/Blocked.php:74
 #: src/Module/Admin/Users/Index.php:80 src/Module/Admin/Users/Pending.php:71
 #: src/Module/Api/Twitter/ContactEndpoint.php:73
@@ -2966,7 +2966,7 @@ msgstr ""
 msgid "File upload failed."
 msgstr ""
 
-#: mod/wall_upload.php:233
+#: mod/wall_upload.php:233 src/Model/Photo.php:953
 msgid "Wall Photos"
 msgstr ""
 
@@ -3636,39 +3636,39 @@ msgstr ""
 msgid "last"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:942 src/Content/Text/BBCode.php:1605
-#: src/Content/Text/BBCode.php:1606
+#: src/Content/Text/BBCode.php:942 src/Content/Text/BBCode.php:1607
+#: src/Content/Text/BBCode.php:1608
 msgid "Image/photo"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1064
+#: src/Content/Text/BBCode.php:1066
 #, php-format
 msgid ""
 "<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1089 src/Model/Item.php:3024
-#: src/Model/Item.php:3030 src/Model/Item.php:3031
+#: src/Content/Text/BBCode.php:1091 src/Model/Item.php:3035
+#: src/Model/Item.php:3041 src/Model/Item.php:3042
 msgid "Link to source"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1523 src/Content/Text/HTML.php:951
+#: src/Content/Text/BBCode.php:1525 src/Content/Text/HTML.php:951
 msgid "Click to open/close"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1554
+#: src/Content/Text/BBCode.php:1556
 msgid "$1 wrote:"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1608 src/Content/Text/BBCode.php:1609
+#: src/Content/Text/BBCode.php:1610 src/Content/Text/BBCode.php:1611
 msgid "Encrypted content"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1822
+#: src/Content/Text/BBCode.php:1824
 msgid "Invalid source protocol"
 msgstr ""
 
-#: src/Content/Text/BBCode.php:1837
+#: src/Content/Text/BBCode.php:1839
 msgid "Invalid link protocol"
 msgstr ""
 
@@ -4542,25 +4542,25 @@ msgstr ""
 msgid "%s: updating %s table."
 msgstr ""
 
-#: src/Factory/Api/Mastodon/Error.php:32
+#: src/Factory/Api/Mastodon/Error.php:38
 msgid "Record not found"
 msgstr ""
 
-#: src/Factory/Api/Mastodon/Error.php:41
+#: src/Factory/Api/Mastodon/Error.php:48
 msgid "Unprocessable Entity"
 msgstr ""
 
-#: src/Factory/Api/Mastodon/Error.php:50
+#: src/Factory/Api/Mastodon/Error.php:58
 #: src/Module/Special/HTTPException.php:50
 msgid "Unauthorized"
 msgstr ""
 
-#: src/Factory/Api/Mastodon/Error.php:59
+#: src/Factory/Api/Mastodon/Error.php:68
 msgid ""
 "Token is not authorized with a valid user or is missing a required scope"
 msgstr ""
 
-#: src/Factory/Api/Mastodon/Error.php:68
+#: src/Factory/Api/Mastodon/Error.php:78
 #: src/Module/Special/HTTPException.php:53
 msgid "Internal Server Error"
 msgstr ""
@@ -4815,33 +4815,33 @@ msgstr ""
 msgid "Edit groups"
 msgstr ""
 
-#: src/Model/Item.php:1582
+#: src/Model/Item.php:1600
 #, php-format
 msgid "Detected languages in this post:\\n%s"
 msgstr ""
 
-#: src/Model/Item.php:2527
+#: src/Model/Item.php:2538
 msgid "activity"
 msgstr ""
 
-#: src/Model/Item.php:2529
+#: src/Model/Item.php:2540
 msgid "comment"
 msgstr ""
 
-#: src/Model/Item.php:2532
+#: src/Model/Item.php:2543
 msgid "post"
 msgstr ""
 
-#: src/Model/Item.php:2646
+#: src/Model/Item.php:2657
 #, php-format
 msgid "Content warning: %s"
 msgstr ""
 
-#: src/Model/Item.php:2989
+#: src/Model/Item.php:3000
 msgid "bytes"
 msgstr ""
 
-#: src/Model/Item.php:3018 src/Model/Item.php:3019
+#: src/Model/Item.php:3029 src/Model/Item.php:3030
 msgid "View on separate page"
 msgstr ""
 
@@ -4959,138 +4959,138 @@ msgstr ""
 msgid "Enter a valid existing folder"
 msgstr ""
 
-#: src/Model/User.php:186 src/Model/User.php:931
+#: src/Model/User.php:186 src/Model/User.php:986
 msgid "SERIOUS ERROR: Generation of security keys failed."
 msgstr ""
 
-#: src/Model/User.php:549
+#: src/Model/User.php:571 src/Model/User.php:604
 msgid "Login failed"
 msgstr ""
 
-#: src/Model/User.php:581
+#: src/Model/User.php:636
 msgid "Not enough information to authenticate"
 msgstr ""
 
-#: src/Model/User.php:676
+#: src/Model/User.php:731
 msgid "Password can't be empty"
 msgstr ""
 
-#: src/Model/User.php:695
+#: src/Model/User.php:750
 msgid "Empty passwords are not allowed."
 msgstr ""
 
-#: src/Model/User.php:699
+#: src/Model/User.php:754
 msgid ""
 "The new password has been exposed in a public data dump, please choose "
 "another."
 msgstr ""
 
-#: src/Model/User.php:705
+#: src/Model/User.php:760
 msgid ""
 "The password can't contain accentuated letters, white spaces or colons (:)"
 msgstr ""
 
-#: src/Model/User.php:811
+#: src/Model/User.php:866
 msgid "Passwords do not match. Password unchanged."
 msgstr ""
 
-#: src/Model/User.php:818
+#: src/Model/User.php:873
 msgid "An invitation is required."
 msgstr ""
 
-#: src/Model/User.php:822
+#: src/Model/User.php:877
 msgid "Invitation could not be verified."
 msgstr ""
 
-#: src/Model/User.php:830
+#: src/Model/User.php:885
 msgid "Invalid OpenID url"
 msgstr ""
 
-#: src/Model/User.php:843 src/Security/Authentication.php:224
+#: src/Model/User.php:898 src/Security/Authentication.php:224
 msgid ""
 "We encountered a problem while logging in with the OpenID you provided. "
 "Please check the correct spelling of the ID."
 msgstr ""
 
-#: src/Model/User.php:843 src/Security/Authentication.php:224
+#: src/Model/User.php:898 src/Security/Authentication.php:224
 msgid "The error message was:"
 msgstr ""
 
-#: src/Model/User.php:849
+#: src/Model/User.php:904
 msgid "Please enter the required information."
 msgstr ""
 
-#: src/Model/User.php:863
+#: src/Model/User.php:918
 #, php-format
 msgid ""
 "system.username_min_length (%s) and system.username_max_length (%s) are "
 "excluding each other, swapping values."
 msgstr ""
 
-#: src/Model/User.php:870
+#: src/Model/User.php:925
 #, php-format
 msgid "Username should be at least %s character."
 msgid_plural "Username should be at least %s characters."
 msgstr[0] ""
 msgstr[1] ""
 
-#: src/Model/User.php:874
+#: src/Model/User.php:929
 #, php-format
 msgid "Username should be at most %s character."
 msgid_plural "Username should be at most %s characters."
 msgstr[0] ""
 msgstr[1] ""
 
-#: src/Model/User.php:882
+#: src/Model/User.php:937
 msgid "That doesn't appear to be your full (First Last) name."
 msgstr ""
 
-#: src/Model/User.php:887
+#: src/Model/User.php:942
 msgid "Your email domain is not among those allowed on this site."
 msgstr ""
 
-#: src/Model/User.php:891
+#: src/Model/User.php:946
 msgid "Not a valid email address."
 msgstr ""
 
-#: src/Model/User.php:894
+#: src/Model/User.php:949
 msgid "The nickname was blocked from registration by the nodes admin."
 msgstr ""
 
-#: src/Model/User.php:898 src/Model/User.php:906
+#: src/Model/User.php:953 src/Model/User.php:961
 msgid "Cannot use that email."
 msgstr ""
 
-#: src/Model/User.php:913
+#: src/Model/User.php:968
 msgid "Your nickname can only contain a-z, 0-9 and _."
 msgstr ""
 
-#: src/Model/User.php:921 src/Model/User.php:978
+#: src/Model/User.php:976 src/Model/User.php:1033
 msgid "Nickname is already registered. Please choose another."
 msgstr ""
 
-#: src/Model/User.php:965 src/Model/User.php:969
+#: src/Model/User.php:1020 src/Model/User.php:1024
 msgid "An error occurred during registration. Please try again."
 msgstr ""
 
-#: src/Model/User.php:992
+#: src/Model/User.php:1047
 msgid "An error occurred creating your default profile. Please try again."
 msgstr ""
 
-#: src/Model/User.php:999
+#: src/Model/User.php:1054
 msgid "An error occurred creating your self contact. Please try again."
 msgstr ""
 
-#: src/Model/User.php:1004
+#: src/Model/User.php:1059
 msgid "Friends"
 msgstr ""
 
-#: src/Model/User.php:1008
+#: src/Model/User.php:1063
 msgid ""
 "An error occurred creating your default contact group. Please try again."
 msgstr ""
 
-#: src/Model/User.php:1199
+#: src/Model/User.php:1254
 #, php-format
 msgid ""
 "\n"
@@ -5098,7 +5098,7 @@ msgid ""
 "\t\t\tthe administrator of %2$s has set up an account for you."
 msgstr ""
 
-#: src/Model/User.php:1202
+#: src/Model/User.php:1257
 #, php-format
 msgid ""
 "\n"
@@ -5135,12 +5135,12 @@ msgid ""
 "\t\tThank you and welcome to %4$s."
 msgstr ""
 
-#: src/Model/User.php:1235 src/Model/User.php:1342
+#: src/Model/User.php:1290 src/Model/User.php:1397
 #, php-format
 msgid "Registration details for %s"
 msgstr ""
 
-#: src/Model/User.php:1255
+#: src/Model/User.php:1310
 #, php-format
 msgid ""
 "\n"
@@ -5156,12 +5156,12 @@ msgid ""
 "\t\t"
 msgstr ""
 
-#: src/Model/User.php:1274
+#: src/Model/User.php:1329
 #, php-format
 msgid "Registration at %s"
 msgstr ""
 
-#: src/Model/User.php:1298
+#: src/Model/User.php:1353
 #, php-format
 msgid ""
 "\n"
@@ -5170,7 +5170,7 @@ msgid ""
 "\t\t\t"
 msgstr ""
 
-#: src/Model/User.php:1306
+#: src/Model/User.php:1361
 #, php-format
 msgid ""
 "\n"
@@ -7201,7 +7201,7 @@ msgstr ""
 msgid "Deny"
 msgstr ""
 
-#: src/Module/Api/Mastodon/Apps.php:47 src/Module/Api/Mastodon/Apps.php:58
+#: src/Module/Api/Mastodon/Apps.php:58
 msgid "Missing parameters"
 msgstr ""
 
@@ -8882,15 +8882,15 @@ msgstr ""
 msgid "Show all"
 msgstr ""
 
-#: src/Module/OAuth/Authorize.php:49
+#: src/Module/OAuth/Authorize.php:51
 msgid "Unsupported or missing response type"
 msgstr ""
 
-#: src/Module/OAuth/Authorize.php:54 src/Module/OAuth/Token.php:55
+#: src/Module/OAuth/Authorize.php:56 src/Module/OAuth/Token.php:57
 msgid "Incomplete request data"
 msgstr ""
 
-#: src/Module/OAuth/Token.php:79
+#: src/Module/OAuth/Token.php:81
 msgid "Unsupported or missing grant type"
 msgstr ""
 
@@ -10585,20 +10585,20 @@ msgstr ""
 msgid "Contact information and Social Networks"
 msgstr ""
 
-#: src/Security/Authentication.php:210 src/Security/Authentication.php:262
+#: src/Security/Authentication.php:210
 msgid "Login failed."
 msgstr ""
 
-#: src/Security/Authentication.php:273
+#: src/Security/Authentication.php:251
 msgid "Login failed. Please check your credentials."
 msgstr ""
 
-#: src/Security/Authentication.php:392
+#: src/Security/Authentication.php:370
 #, php-format
 msgid "Welcome %s"
 msgstr ""
 
-#: src/Security/Authentication.php:393
+#: src/Security/Authentication.php:371
 msgid "Please upload a profile photo."
 msgstr ""
 

From 97a9ec4e401155f0041326bd471566e4fe12e5fb Mon Sep 17 00:00:00 2001
From: very-ape <git@verya.pe>
Date: Fri, 21 May 2021 11:38:50 -0700
Subject: [PATCH 16/24] Bug fix: last commit results in logged-in user's
 contacts being displayed on contact profile sidebar.

---
 src/Model/Profile.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/Model/Profile.php b/src/Model/Profile.php
index 745492994..1476d67a5 100644
--- a/src/Model/Profile.php
+++ b/src/Model/Profile.php
@@ -169,12 +169,13 @@ class Profile
 		if (empty($user['uid'])) {
 			$profile = [];
 		} else {
+			$contact_id = Contact::getIdForURL(Strings::normaliseLink(DI::baseurl() . '/profile/' . $nickname), local_user());
 			$profile = array_merge(
 				$user,
+				Contact::getById($contact_id),
 				Profile::getByUID($user['uid']),
-				Contact::getById(Contact::getIdForURL(Strings::normaliseLink(DI::baseurl() . '/profile/' . $nickname), local_user()))
 			);
-			$profile['cid'] = $profile['id'];
+			$profile['cid'] = $contact_id;
 		}
 
 		if (empty($profile) && empty($profiledata)) {

From 46301b79511af58f17921d8533a80265c31227f6 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Fri, 21 May 2021 20:45:01 +0000
Subject: [PATCH 17/24] Changed description

---
 doc/API-Mastodon.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md
index 5610f926f..37f62e060 100644
--- a/doc/API-Mastodon.md
+++ b/doc/API-Mastodon.md
@@ -126,8 +126,8 @@ These emdpoints are planned to be implemented somewhere in the future.
 
 ## Dummy endpoints
 
-These endpoints are returning empty data to avoid error messages with (for example) mobile clients.
-They belong to a functionality that doesn't exist in Friendica yet.
+These endpoints are returning empty data to avoid error messages when using third party clients.
+They refer to features that don't exist in Friendica yet.
 
 - [`GET /api/v1/accounts/:id/identity_proofs`](https://docs.joinmastodon.org/methods/accounts/)
 - [`GET /api/v1/announcements`](https://docs.joinmastodon.org/methods/announcements/)
@@ -139,7 +139,7 @@ They belong to a functionality that doesn't exist in Friendica yet.
 ## Non supportable endpoints
 
 These endpoints won't be implemented at the moment.
-They belong to a functionality that doesn't exist in Friendica yet.
+They refer to features that don't exist in Friendica yet.
 
 - [`POST /api/v1/accounts`](https://docs.joinmastodon.org/methods/accounts/)
 - [`POST /api/v1/accounts/:id/pin`](https://docs.joinmastodon.org/methods/accounts/)

From 857e14636fdb74b13fd7c3d8120436dc0078e4fe Mon Sep 17 00:00:00 2001
From: very-ape <git@verya.pe>
Date: Fri, 21 May 2021 15:58:35 -0700
Subject: [PATCH 18/24] Bug fix: Keep the introductions notification badge from
 claiming its own line!

---
 view/theme/vier/templates/nav.tpl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/view/theme/vier/templates/nav.tpl b/view/theme/vier/templates/nav.tpl
index 32a588f3d..b2da2b0d7 100644
--- a/view/theme/vier/templates/nav.tpl
+++ b/view/theme/vier/templates/nav.tpl
@@ -81,7 +81,7 @@
 				<a accesskey="u" title="{{$sitelocation}}"><img src="{{$userinfo.icon}}" alt="{{$userinfo.name}}"><span id="nav-user-linklabel">{{$userinfo.name}}</span><span id="intro-update" class="nav-notification"></span></a>
 				<ul id="nav-user-menu" class="menu-popup">
 					<li role="menuitem"> <a  class="{{$nav.search.2}}" href="{{$nav.search.0}}" title="{{$nav.search.3}}">{{$nav.search.1}}</a> </li>
-					{{if $nav.introductions}}<li role="menuitem"><a class="{{$nav.introductions.2}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}">{{$nav.introductions.1}}</a><span id="intro-update-li" class="nav-notification"></span></li>{{/if}}
+					{{if $nav.introductions}}<li role="menuitem"><a class="{{$nav.introductions.2}}" href="{{$nav.introductions.0}}" title="{{$nav.introductions.3}}">{{$nav.introductions.1}}<span id="intro-update-li" class="nav-notification"></span></a></li>{{/if}}
 					{{if $nav.contacts}}<li role="menuitem"><a class="{{$nav.contacts.2}}" href="{{$nav.contacts.0}}" title="{{$nav.contacts.3}}">{{$nav.contacts.1}}</a></li>{{/if}}
 					{{if $nav.messages}}<li role="menuitem"><a class="{{$nav.messages.2}}" href="{{$nav.messages.0}}" title="{{$nav.messages.3}}">{{$nav.messages.1}} <span id="mail-update-li" class="nav-notification"></span></a></li>{{/if}}
 					{{if $nav.delegation}}<li role="menuitem"><a class="{{$nav.delegation.2}}" href="{{$nav.delegation.0}}" title="{{$nav.delegation.3}}">{{$nav.delegation.1}}</a></li>{{/if}}

From 9d4b29d9c041e7bd4f20f37e912adc1f7d48b8ae Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sat, 22 May 2021 05:34:10 +0000
Subject: [PATCH 19/24] Fix for empty profile pages

---
 src/Model/Profile.php | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/Model/Profile.php b/src/Model/Profile.php
index 1476d67a5..c1d85bfe0 100644
--- a/src/Model/Profile.php
+++ b/src/Model/Profile.php
@@ -166,17 +166,7 @@ class Profile
 			}
 		}
 
-		if (empty($user['uid'])) {
-			$profile = [];
-		} else {
-			$contact_id = Contact::getIdForURL(Strings::normaliseLink(DI::baseurl() . '/profile/' . $nickname), local_user());
-			$profile = array_merge(
-				$user,
-				Contact::getById($contact_id),
-				Profile::getByUID($user['uid']),
-			);
-			$profile['cid'] = $contact_id;
-		}
+		$profile = !empty($user['uid']) ? User::getOwnerDataById($user['uid'], false) : [];
 
 		if (empty($profile) && empty($profiledata)) {
 			Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
@@ -344,7 +334,7 @@ class Profile
 
 			if (Contact::canReceivePrivateMessages($profile)) {
 				if ($visitor_is_followed || $visitor_is_following) {
-					$wallmessage_link = $visitor_base_path . '/message/new/' . $profile['cid'];
+					$wallmessage_link = $visitor_base_path . '/message/new/' . base64_encode($profile['addr'] ?? '');
 				} elseif ($visitor_is_authenticated && !empty($profile['unkmail'])) {
 					$wallmessage_link = 'wallmessage/' . $profile['nickname'];
 				}

From 0c21588ab93c488e26615b2c50b88c261f9a762b Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sat, 22 May 2021 08:25:30 +0000
Subject: [PATCH 20/24] Don't delete local tombstone contacts

---
 src/Model/Contact.php      | 5 +++++
 src/Util/HTTPSignature.php | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/Model/Contact.php b/src/Model/Contact.php
index 89325e093..4af1d9bb6 100644
--- a/src/Model/Contact.php
+++ b/src/Model/Contact.php
@@ -1941,6 +1941,11 @@ class Contact
 			return false;
 		}
 
+		if (Contact::isLocal($ret['url'])) {
+			Logger::info('Local contacts are not updated here.');
+			return true;
+		}
+
 		if (!empty($ret['account-type']) && $ret['account-type'] == User::ACCOUNT_TYPE_DELETED) {
 			Logger::info('Deleted account', ['id' => $id, 'url' => $ret['url'], 'ret' => $ret]);
 			self::remove($id);
diff --git a/src/Util/HTTPSignature.php b/src/Util/HTTPSignature.php
index 5fb4ab733..584ac356f 100644
--- a/src/Util/HTTPSignature.php
+++ b/src/Util/HTTPSignature.php
@@ -558,8 +558,10 @@ class HTTPSignature
 		if (!empty($key['url']) && !empty($key['type']) && ($key['type'] == 'Tombstone')) {
 			Logger::info('Actor is a tombstone', ['key' => $key]);
 
-			// We now delete everything that we possibly knew from this actor
-			Contact::deleteContactByUrl($key['url']);
+			if (!Contact::isLocal($key['url'])) {
+				// We now delete everything that we possibly knew from this actor
+				Contact::deleteContactByUrl($key['url']);
+			}
 			return null;
 		}
 

From 6fe916a390e903d4840e7276a13058db19996297 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sat, 22 May 2021 13:37:04 +0000
Subject: [PATCH 21/24] API: improved mail handling

---
 database.sql                                 | 19 +++++++++++--
 src/Content/Text/BBCode.php                  |  4 ++-
 src/Factory/Api/Mastodon/Status.php          |  4 ++-
 src/Model/Mail.php                           | 14 ++++++++++
 src/Module/Api/Mastodon/Timelines/Direct.php | 10 +++----
 src/Protocol/ActivityPub/Transmitter.php     | 17 ++++--------
 src/Worker/ExpirePosts.php                   |  5 +++-
 src/Worker/RemoveContact.php                 |  1 +
 static/dbstructure.config.php                | 11 +++++++-
 update.php                                   | 29 ++++++++++++++++++++
 10 files changed, 91 insertions(+), 23 deletions(-)

diff --git a/database.sql b/database.sql
index d080b4158..3e6d398cf 100644
--- a/database.sql
+++ b/database.sql
@@ -1,6 +1,6 @@
 -- ------------------------------------------
--- Friendica 2021.06-dev (Siberian Iris)
--- DB_UPDATE_VERSION 1418
+-- Friendica 2021.06-rc (Siberian Iris)
+-- DB_UPDATE_VERSION 1419
 -- ------------------------------------------
 
 
@@ -751,6 +751,7 @@ CREATE TABLE IF NOT EXISTS `mail` (
 	`from-photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'contact photo link of the sender',
 	`from-url` varchar(255) NOT NULL DEFAULT '' COMMENT 'profile linke of the sender',
 	`contact-id` varchar(255) COMMENT 'contact.id',
+	`author-id` int unsigned COMMENT 'Link to the contact table with uid=0 of the author of the mail',
 	`convid` int unsigned COMMENT 'conv.id',
 	`title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
 	`body` mediumtext COMMENT '',
@@ -759,7 +760,11 @@ CREATE TABLE IF NOT EXISTS `mail` (
 	`replied` boolean NOT NULL DEFAULT '0' COMMENT '',
 	`unknown` boolean NOT NULL DEFAULT '0' COMMENT 'if sender not in the contact table this is 1',
 	`uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
+	`uri-id` int unsigned COMMENT 'Item-uri id of the related mail',
 	`parent-uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
+	`parent-uri-id` int unsigned COMMENT 'Item-uri id of the parent of the related mail',
+	`thr-parent` varchar(255) COMMENT '',
+	`thr-parent-id` int unsigned COMMENT 'Id of the item-uri table that contains the thread parent uri',
 	`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'creation time of the private message',
 	 PRIMARY KEY(`id`),
 	 INDEX `uid_seen` (`uid`,`seen`),
@@ -767,7 +772,15 @@ CREATE TABLE IF NOT EXISTS `mail` (
 	 INDEX `uri` (`uri`(64)),
 	 INDEX `parent-uri` (`parent-uri`(64)),
 	 INDEX `contactid` (`contact-id`(32)),
-	FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
+	 INDEX `author-id` (`author-id`),
+	 INDEX `uri-id` (`uri-id`),
+	 INDEX `parent-uri-id` (`parent-uri-id`),
+	 INDEX `thr-parent-id` (`thr-parent-id`),
+	FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
+	FOREIGN KEY (`author-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT,
+	FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
+	FOREIGN KEY (`parent-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
+	FOREIGN KEY (`thr-parent-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='private messages';
 
 --
diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php
index 8c1476fa3..03ccd889a 100644
--- a/src/Content/Text/BBCode.php
+++ b/src/Content/Text/BBCode.php
@@ -1039,7 +1039,9 @@ class BBCode
 
 		switch ($simplehtml) {
 			case self::API:
-				$text = ($is_quote_share? '<br>' : '') . '<p>' . html_entity_decode('&#x2672; ', ENT_QUOTES, 'UTF-8') . ' ' . $author_contact['addr'] . ': </p>' . "\n" . $content;
+				$text = ($is_quote_share? '<br>' : '') .
+				'<p><b><a href="' . $attributes['link'] . '">' . html_entity_decode('&#x2672; ', ENT_QUOTES, 'UTF-8') . ' ' . $author_contact['addr'] . "</a>:</b> </p>\n" .
+				'<blockquote class="shared_content">' . $content . '</blockquote>';
 				break;
 			case self::DIASPORA:
 				if (stripos(Strings::normaliseLink($attributes['link']), 'http://twitter.com/') === 0) {
diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php
index 3f16b3c38..41f64daa1 100644
--- a/src/Factory/Api/Mastodon/Status.php
+++ b/src/Factory/Api/Mastodon/Status.php
@@ -136,7 +136,9 @@ class Status extends BaseFactory
 
 		$account = DI::mstdnAccount()->createFromContactId($item['author-id']);
 
-		$counts = new \Friendica\Object\Api\Mastodon\Status\Counts(0, 0, 0);
+		$replies = DBA::count('mail', ['thr-parent-id' => $item['uri-id'], 'reply' => true]);
+
+		$counts = new \Friendica\Object\Api\Mastodon\Status\Counts($replies, 0, 0);
 
 		$userAttributes = new \Friendica\Object\Api\Mastodon\Status\UserAttributes(false, false, false, false, false);
 
diff --git a/src/Model/Mail.php b/src/Model/Mail.php
index e7ed2c845..aa9058660 100644
--- a/src/Model/Mail.php
+++ b/src/Model/Mail.php
@@ -71,6 +71,20 @@ class Mail
 			return false;
 		}
 
+		$msg['author-id']     = Contact::getIdForURL($msg['from-url'], 0, false);
+		$msg['uri-id']        = ItemURI::insert(['uri' => $msg['uri'], 'guid' => $msg['guid']]);
+		$msg['parent-uri-id'] = ItemURI::getIdByURI($msg['parent-uri']);
+
+		if ($msg['reply']) {
+			$reply = DBA::selectFirst('mail', ['uri', 'uri-id'], ['parent-uri' => $mail['parent-uri'], 'reply' => false]);
+
+			$msg['thr-parent']    = $reply['uri'];
+			$msg['thr-parent-id'] = $reply['uri-id'];
+		} else {
+			$msg['thr-parent']    = $msg['uri'];
+			$msg['thr-parent-id'] = $msg['uri-id'];
+		}
+
 		DBA::insert('mail', $msg);
 
 		$msg['id'] = DBA::lastInsertId();
diff --git a/src/Module/Api/Mastodon/Timelines/Direct.php b/src/Module/Api/Mastodon/Timelines/Direct.php
index 104f88d1c..050bcbf47 100644
--- a/src/Module/Api/Mastodon/Timelines/Direct.php
+++ b/src/Module/Api/Mastodon/Timelines/Direct.php
@@ -48,22 +48,22 @@ class Direct extends BaseApi
 			'limit'    => 20, // Maximum number of results to return. Defaults to 20.
 		]);
 
-		$params = ['order' => ['id' => true], 'limit' => $request['limit']];
+		$params = ['order' => ['uri-id' => true], 'limit' => $request['limit']];
 
 		$condition = ['uid' => $uid];
 
 		if (!empty($request['max_id'])) {
-			$condition = DBA::mergeConditions($condition, ["`id` < ?", $request['max_id']]);
+			$condition = DBA::mergeConditions($condition, ["`uri-id` < ?", $request['max_id']]);
 		}
 
 		if (!empty($request['since_id'])) {
-			$condition = DBA::mergeConditions($condition, ["`id` > ?", $request['since_id']]);
+			$condition = DBA::mergeConditions($condition, ["`uri-id` > ?", $request['since_id']]);
 		}
 
 		if (!empty($request['min_id'])) {
-			$condition = DBA::mergeConditions($condition, ["`id` > ?", $request['min_id']]);
+			$condition = DBA::mergeConditions($condition, ["`uri-id` > ?", $request['min_id']]);
 
-			$params['order'] = ['id'];
+			$params['order'] = ['uri-id'];
 		}
 
 		$mails = DBA::select('mail', ['id'], $condition, $params);
diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php
index 20c1e49b8..4e009d61d 100644
--- a/src/Protocol/ActivityPub/Transmitter.php
+++ b/src/Protocol/ActivityPub/Transmitter.php
@@ -868,24 +868,19 @@ class Transmitter
 			return [];
 		}
 
-		$mail['uri-id'] = ItemURI::insert(['uri' => $mail['uri'], 'guid' => $mail['guid']]);
-
-		$reply = DBA::selectFirst('mail', ['uri', 'from-url', 'guid'], ['parent-uri' => $mail['parent-uri'], 'reply' => false]);
+		$reply = DBA::selectFirst('mail', ['uri', 'uri-id', 'from-url'], ['parent-uri' => $mail['parent-uri'], 'reply' => false]);
 
 		// Making the post more compatible for Mastodon by:
 		// - Making it a note and not an article (no title)
 		// - Moving the title into the "summary" field that is used as a "content warning"
 
-		if ($use_title) {
-			$mail['body']         = $mail['body'];
-			$mail['title']        = $mail['title'];
-		} else {
+		if (!$use_title) {
 			$mail['body']         = '[abstract]' . $mail['title'] . "[/abstract]\n" . $mail['body'];
 			$mail['title']        = '';
 		}
 
 		$mail['author-link']      = $mail['owner-link'] = $mail['from-url'];
-		$mail['author-id']        = Contact::getIdForURL($mail['author-link'], 0, false); 
+		$mail['owner-id']         = $mail['author-id'];
 		$mail['allow_cid']        = '<'.$mail['contact-id'].'>';
 		$mail['allow_gid']        = '';
 		$mail['deny_cid']         = '';
@@ -893,9 +888,9 @@ class Transmitter
 		$mail['private']          = Item::PRIVATE;
 		$mail['deleted']          = false;
 		$mail['edited']           = $mail['created'];
-		$mail['plink']            = $mail['uri'];
-		$mail['thr-parent']       = $reply['uri'];
-		$mail['thr-parent-id']    = ItemURI::insert(['uri' => $reply['uri'], 'guid' => $reply['guid']]);
+		$mail['plink']            = DI::baseUrl() . '/message/' . $mail['id'];
+		$mail['parent-uri']       = $reply['uri'];
+		$mail['parent-uri-id']    = $reply['uri-id'];
 		$mail['parent-author-id'] = Contact::getIdForURL($reply['from-url'], 0, false);
 		$mail['gravity']          = ($mail['reply'] ? GRAVITY_COMMENT: GRAVITY_PARENT);
 		$mail['event-type']       = '';
diff --git a/src/Worker/ExpirePosts.php b/src/Worker/ExpirePosts.php
index 2c3f6f68a..3f1075db5 100644
--- a/src/Worker/ExpirePosts.php
+++ b/src/Worker/ExpirePosts.php
@@ -181,7 +181,10 @@ class ExpirePosts
 			AND NOT EXISTS(SELECT `uri-id` FROM `post-user` WHERE `uri-id` = `item-uri`.`id`)
 			AND NOT EXISTS(SELECT `parent-uri-id` FROM `post-user` WHERE `parent-uri-id` = `item-uri`.`id`)
 			AND NOT EXISTS(SELECT `thr-parent-id` FROM `post-user` WHERE `thr-parent-id` = `item-uri`.`id`)
-			AND NOT EXISTS(SELECT `external-id` FROM `post-user` WHERE `external-id` = `item-uri`.`id`)", $item['uri-id']]);
+			AND NOT EXISTS(SELECT `external-id` FROM `post-user` WHERE `external-id` = `item-uri`.`id`)
+			AND NOT EXISTS(SELECT `uri-id` FROM `mail` WHERE `uri-id` = `item-uri`.`id`)
+			AND NOT EXISTS(SELECT `parent-uri-id` FROM `mail` WHERE `parent-uri-id` = `item-uri`.`id`)
+			AND NOT EXISTS(SELECT `thr-parent-id` FROM `mail` WHERE `thr-parent-id` = `item-uri`.`id`)", $item['uri-id']]);
 
 		Logger::notice('Start deleting orphaned URI-ID', ['last-id' => $item['uri-id']]);
 		$affected_count = 0;
diff --git a/src/Worker/RemoveContact.php b/src/Worker/RemoveContact.php
index 13cbbec8b..f64d4d02d 100644
--- a/src/Worker/RemoveContact.php
+++ b/src/Worker/RemoveContact.php
@@ -55,6 +55,7 @@ class RemoveContact {
 		}
 
 		DBA::delete('mail', ['contact-id' => $id]);
+		DBA::delete('mail', ['author-id' => $id]);
 
 		Post\ThreadUser::delete(['author-id' => $id]);
 		Post\ThreadUser::delete(['owner-id' => $id]);
diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php
index 835cb3ff3..14b7814c0 100644
--- a/static/dbstructure.config.php
+++ b/static/dbstructure.config.php
@@ -55,7 +55,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-	define('DB_UPDATE_VERSION', 1418);
+	define('DB_UPDATE_VERSION', 1419);
 }
 
 return [
@@ -818,6 +818,7 @@ return [
 			"from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
 			"from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
 			"contact-id" => ["type" => "varchar(255)", "relation" => ["contact" => "id"], "comment" => "contact.id"],
+			"author-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of the mail"],
 			"convid" => ["type" => "int unsigned", "relation" => ["conv" => "id"], "comment" => "conv.id"],
 			"title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
 			"body" => ["type" => "mediumtext", "comment" => ""],
@@ -826,7 +827,11 @@ return [
 			"replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
 			"unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
 			"uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+			"uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related mail"],
 			"parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+			"parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related mail"],
+			"thr-parent" => ["type" => "varchar(255)", "comment" => ""],
+			"thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
 			"created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
 		],
 		"indexes" => [
@@ -836,6 +841,10 @@ return [
 			"uri" => ["uri(64)"],
 			"parent-uri" => ["parent-uri(64)"],
 			"contactid" => ["contact-id(32)"],
+			"author-id" => ["author-id"],
+			"uri-id" => ["uri-id"],
+			"parent-uri-id" => ["parent-uri-id"],
+			"thr-parent-id" => ["thr-parent-id"],
 		]
 	],
 	"mailacct" => [
diff --git a/update.php b/update.php
index a34a5dbb0..0a97b4e10 100644
--- a/update.php
+++ b/update.php
@@ -49,6 +49,7 @@ use Friendica\Database\DBStructure;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Item;
+use Friendica\Model\ItemURI;
 use Friendica\Model\Notification;
 use Friendica\Model\Photo;
 use Friendica\Model\Post;
@@ -912,3 +913,31 @@ function update_1413()
 		return Update::FAILED;
 	}
 }
+
+function update_1419()
+{
+	$mails = DBA::select('mail', ['id', 'from-url', 'uri', 'parent-uri', 'guid'], [], ['order' => ['id']]);
+	while ($mail = DBA::fetch($mails)) {
+		$fields = [];
+		$fields['author-id'] = Contact::getIdForURL($mail['from-url'], 0, false);
+		if (empty($fields['author-id'])) {
+			continue;
+		}
+
+		$fields['uri-id']        = ItemURI::insert(['uri' => $mail['uri'], 'guid' => $mail['guid']]);
+		$fields['parent-uri-id'] = ItemURI::getIdByURI($mail['parent-uri']);
+
+		$reply = DBA::selectFirst('mail', ['uri', 'uri-id', 'guid'], ['parent-uri' => $mail['parent-uri'], 'reply' => false]);
+		if (!empty($reply)) {
+			$fields['thr-parent'] = $reply['uri'];
+			if (!empty($reply['uri-id'])) {
+				$fields['thr-parent-id'] = $reply['uri-id'];
+			} else {
+				$fields['thr-parent-id'] = ItemURI::insert(['uri' => $reply['uri'], 'guid' => $reply['guid']]);
+			}
+		}
+
+		DBA::update('mail', $fields, ['id' => $mail['id']]);
+	}
+	return Update::SUCCESS;
+}

From a5c8c4d8b7dc776b3308c831280e646137a89a40 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sat, 22 May 2021 15:41:25 +0000
Subject: [PATCH 22/24] Fixes notice

---
 src/Module/OAuth/Authorize.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Module/OAuth/Authorize.php b/src/Module/OAuth/Authorize.php
index d5dc68932..a46c4c7ac 100644
--- a/src/Module/OAuth/Authorize.php
+++ b/src/Module/OAuth/Authorize.php
@@ -63,9 +63,9 @@ class Authorize extends BaseApi
 
 		// @todo Compare the application scope and requested scope
 
-		$request = $_REQUEST;
-		unset($request['pagename']);
-		$redirect = 'oauth/authorize?' . http_build_query($request);
+		$redirect_request = $_REQUEST;
+		unset($redirect_request['pagename']);
+		$redirect = 'oauth/authorize?' . http_build_query($redirect_request);
 
 		$uid = local_user();
 		if (empty($uid)) {

From ede808f4494aa9244276c0a696b9780e793c10f0 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sat, 22 May 2021 15:50:05 +0000
Subject: [PATCH 23/24] Fixes "Undefined index: upubkey" by replacing the
 profile load mechanism

---
 src/Module/NoScrape.php | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/Module/NoScrape.php b/src/Module/NoScrape.php
index 8f799aa96..a76b3a951 100644
--- a/src/Module/NoScrape.php
+++ b/src/Module/NoScrape.php
@@ -50,20 +50,20 @@ class NoScrape extends BaseModule
 			System::jsonError(403, 'Authentication required');
 		}
 
-		Profile::load($a, $which);
+		$profile = Profile::getByNickname($which, local_user());
 
-		if (empty($a->profile['uid'])) {
+		if (empty($profile['uid'])) {
 			System::jsonError(404, 'Profile not found');
 		}
 
 		$json_info = [
-			'addr'         => $a->profile['addr'],
+			'addr'         => $profile['addr'],
 			'nick'         => $which,
-			'guid'         => $a->profile['guid'],
-			'key'          => $a->profile['upubkey'],
+			'guid'         => $profile['guid'],
+			'key'          => $profile['upubkey'],
 			'homepage'     => DI::baseUrl() . "/profile/{$which}",
-			'comm'         => ($a->profile['account-type'] == User::ACCOUNT_TYPE_COMMUNITY),
-			'account-type' => $a->profile['account-type'],
+			'comm'         => ($profile['account-type'] == User::ACCOUNT_TYPE_COMMUNITY),
+			'account-type' => $profile['account-type'],
 		];
 
 		$dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
@@ -71,30 +71,30 @@ class NoScrape extends BaseModule
 			$json_info["dfrn-{$dfrn}"] = DI::baseUrl() . "/dfrn_{$dfrn}/{$which}";
 		}
 
-		if (!$a->profile['net-publish']) {
+		if (!$profile['net-publish']) {
 			$json_info['hide'] = true;
 			System::jsonExit($json_info);
 		}
 
-		$keywords = $a->profile['pub_keywords'] ?? '';
+		$keywords = $profile['pub_keywords'] ?? '';
 		$keywords = str_replace(['#', ',', ' ', ',,'], ['', ' ', ',', ','], $keywords);
 		$keywords = explode(',', $keywords);
 
-		$contactPhoto = DBA::selectFirst('contact', ['photo'], ['self' => true, 'uid' => $a->profile['uid']]);
+		$contactPhoto = DBA::selectFirst('contact', ['photo'], ['self' => true, 'uid' => $profile['uid']]);
 
-		$json_info['fn']       = $a->profile['name'];
+		$json_info['fn']       = $profile['name'];
 		$json_info['photo']    = $contactPhoto["photo"];
 		$json_info['tags']     = $keywords;
-		$json_info['language'] = $a->profile['language'];
+		$json_info['language'] = $profile['language'];
 
-		if (!empty($a->profile['last-item'])) {
-			$json_info['updated'] = date("c", strtotime($a->profile['last-item']));
+		if (!empty($profile['last-item'])) {
+			$json_info['updated'] = date("c", strtotime($profile['last-item']));
 		}
 
-		if (!($a->profile['hide-friends'] ?? false)) {
+		if (!($profile['hide-friends'] ?? false)) {
 			$json_info['contacts'] = DBA::count('contact',
 				[
-					'uid'     => $a->profile['uid'],
+					'uid'     => $profile['uid'],
 					'self'    => 0,
 					'blocked' => 0,
 					'pending' => 0,
@@ -106,13 +106,13 @@ class NoScrape extends BaseModule
 
 		// We display the last activity (post or login), reduced to year and week number
 		$last_active = 0;
-		$condition   = ['uid' => $a->profile['uid'], 'self' => true];
+		$condition   = ['uid' => $profile['uid'], 'self' => true];
 		$contact     = DBA::selectFirst('contact', ['last-item'], $condition);
 		if (DBA::isResult($contact)) {
 			$last_active = strtotime($contact['last-item']);
 		}
 
-		$condition = ['uid' => $a->profile['uid']];
+		$condition = ['uid' => $profile['uid']];
 		$user      = DBA::selectFirst('user', ['login_date'], $condition);
 		if (DBA::isResult($user)) {
 			if ($last_active < strtotime($user['login_date'])) {
@@ -124,8 +124,8 @@ class NoScrape extends BaseModule
 		//These are optional fields.
 		$profile_fields = ['about', 'locality', 'region', 'postal-code', 'country-name'];
 		foreach ($profile_fields as $field) {
-			if (!empty($a->profile[$field])) {
-				$json_info["$field"] = $a->profile[$field];
+			if (!empty($profile[$field])) {
+				$json_info["$field"] = $profile[$field];
 			}
 		}
 

From 77092157fea7866e8fa769cf07e6862daf00969d Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sat, 22 May 2021 16:11:10 +0000
Subject: [PATCH 24/24] Don't create automated summaries

---
 src/Protocol/ActivityPub/Transmitter.php | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php
index 4e009d61d..83e3d35a9 100644
--- a/src/Protocol/ActivityPub/Transmitter.php
+++ b/src/Protocol/ActivityPub/Transmitter.php
@@ -1525,12 +1525,21 @@ class Transmitter
 
 		if ($type == 'Note') {
 			$body = $item['raw-body'] ?? self::removePictures($body);
-		} elseif (($type == 'Article') && empty($data['summary'])) {
-			$regexp = "/[@!]\[url\=([^\[\]]*)\].*?\[\/url\]/ism";
-			$summary = preg_replace_callback($regexp, ['self', 'mentionAddrCallback'], $body);
-			$data['summary'] = BBCode::toPlaintext(Plaintext::shorten(self::removePictures($summary), 1000));
 		}
 
+		/**
+		 * @todo Improve the automated summary
+		 * This part is currently deactivated. The automated summary seems to be more
+		 * confusing than helping. But possibly we will find a better way.
+		 * So the code is left here for now as a reminder
+		 * 
+		 * } elseif (($type == 'Article') && empty($data['summary'])) {
+		 * 		$regexp = "/[@!]\[url\=([^\[\]]*)\].*?\[\/url\]/ism";
+		 * 		$summary = preg_replace_callback($regexp, ['self', 'mentionAddrCallback'], $body);
+		 * 		$data['summary'] = BBCode::toPlaintext(Plaintext::shorten(self::removePictures($summary), 1000));
+		 * }
+		 */
+
 		if (empty($item['uid']) || !Feature::isEnabled($item['uid'], 'explicit_mentions')) {
 			$body = self::prependMentions($body, $item['uri-id'], $item['author-link']);
 		}