From 1c58363696f3837d5deb882d6090bf1df2da4b0f Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 20 Dec 2018 23:59:15 -0500 Subject: [PATCH 1/5] Remove unused/empty template variables in register --- mod/register.php | 10 ---------- view/templates/register.tpl | 27 +++++++++----------------- view/theme/frio/templates/register.tpl | 6 +----- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/mod/register.php b/mod/register.php index b85f0ed43..03d4cb02f 100644 --- a/mod/register.php +++ b/mod/register.php @@ -213,20 +213,15 @@ function register_content(App $a) $noid = Config::get('system', 'no_openid'); if ($noid) { - $oidhtml = ''; $fillwith = ''; $fillext = ''; $oidlabel = ''; } else { - $oidhtml = ''; $fillwith = L10n::t("You may \x28optionally\x29 fill in this form via OpenID by supplying your OpenID and clicking 'Register'."); $fillext = L10n::t('If you are not familiar with OpenID, please leave that field blank and fill in the rest of the items.'); $oidlabel = L10n::t("Your OpenID \x28optional\x29: "); } - // I set this and got even more fake names than before... - $realpeople = ''; // L10n::t('Members of this network prefer to communicate with real people who use their real names.'); - if (Config::get('system', 'publish_all')) { $profile_publish = ''; } else { @@ -244,8 +239,6 @@ function register_content(App $a) $r = q("SELECT COUNT(*) AS `contacts` FROM `contact`"); $passwords = !$r[0]["contacts"]; - $license = ''; - $tpl = Renderer::getMarkupTemplate("register.tpl"); $arr = ['template' => $tpl]; @@ -257,14 +250,12 @@ function register_content(App $a) $tos = new Tos(); $o = Renderer::replaceMacros($tpl, [ - '$oidhtml' => $oidhtml, '$invitations' => Config::get('system', 'invitation_only'), '$permonly' => intval(Config::get('config', 'register_policy')) === REGISTER_APPROVE, '$permonlybox' => ['permonlybox', L10n::t('Note for the admin'), '', L10n::t('Leave a message for the admin, why you want to join this node')], '$invite_desc' => L10n::t('Membership on this site is by invitation only.'), '$invite_label' => L10n::t('Your invitation code: '), '$invite_id' => $invite_id, - '$realpeople' => $realpeople, '$regtitle' => L10n::t('Registration'), '$registertext' => BBCode::convert(Config::get('config', 'register_text', '')), '$fillwith' => $fillwith, @@ -284,7 +275,6 @@ function register_content(App $a) '$username' => $username, '$email' => $email, '$nickname' => $nickname, - '$license' => $license, '$sitename' => $a->getHostName(), '$importh' => L10n::t('Import'), '$importt' => L10n::t('Import your profile to this friendica instance'), diff --git a/view/templates/register.tpl b/view/templates/register.tpl index 30b242983..2b23934b7 100644 --- a/view/templates/register.tpl +++ b/view/templates/register.tpl @@ -5,34 +5,29 @@ - {{if $registertext != ""}}
{{$registertext}}
{{/if}} + {{if $registertext != ""}}
{{$registertext nofilter}}
{{/if}} {{if $explicit_content}}

{{$explicit_content_note}}

{{/if}} -

{{$realpeople}}

-

{{$fillwith}}

{{$fillext}}

{{if $oidlabel}}
- +
{{/if}} {{if $invitations}} -

{{$invite_desc}}

- {{/if}} -
@@ -63,29 +58,25 @@ {{include file="field_textarea.tpl" field=$permonlybox}} {{/if}} - {{$publish}} + {{$publish nofilter}} - {{if $showtoslink}} +{{if $showtoslink}}

{{$tostext}}

- {{/if}} - {{if $showprivstatement}} +{{/if}} +{{if $showprivstatement}}

{{$privstatement.0}}

{{for $i=1 to 3}} -

{{$privstatement[$i]}}

+

{{$privstatement[$i] nofilter}}

{{/for}} - {{/if}} +{{/if}}
-

{{$importh}}

+

{{$importh}}

- -{{$license}} - - diff --git a/view/theme/frio/templates/register.tpl b/view/theme/frio/templates/register.tpl index 2167c418d..d46a59e87 100644 --- a/view/theme/frio/templates/register.tpl +++ b/view/theme/frio/templates/register.tpl @@ -1,4 +1,3 @@ -
@@ -8,11 +7,10 @@

{{$regtitle}}

- {{if $registertext != ""}}
{{$registertext}}
{{/if}} + {{if $registertext != ""}}
{{$registertext nofilter}}
{{/if}} {{if $explicit_content}}

{{$explicit_content_note}}

{{/if}} - {{if $oidlabel}}
@@ -82,6 +80,4 @@ {{$importt}}
- - {{$license}}
From 989bfb53b1b86690864d8a71d3eb578bcb340ab0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 21 Dec 2018 00:05:31 -0500 Subject: [PATCH 2/5] Fix install escaping --- view/templates/install_checks.tpl | 4 ++-- view/templates/install_db.tpl | 25 ++++++++++--------------- view/templates/install_finished.tpl | 9 +++------ view/templates/install_settings.tpl | 2 +- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/view/templates/install_checks.tpl b/view/templates/install_checks.tpl index cdb562f3a..151b78dec 100644 --- a/view/templates/install_checks.tpl +++ b/view/templates/install_checks.tpl @@ -4,7 +4,7 @@
{{foreach $checks as $check}} - {{if $check.help}}
{{$check.title}} +
{{$check.title nofilter}} {{if $check.status}} Ok {{else}} @@ -17,7 +17,7 @@ {{if $check.required}}(required){{/if}}
-
{{$check.help}}
+
{{$check.help nofilter}}
{{if $check.error_msg}}
{{$check.error_msg.head}}
{{$check.error_msg.url}}
{{$check.error_msg.msg}}
diff --git a/view/templates/install_db.tpl b/view/templates/install_db.tpl index 67250abf0..a4fa43024 100644 --- a/view/templates/install_db.tpl +++ b/view/templates/install_db.tpl @@ -1,13 +1,10 @@ - -

{{$title}}

{{$pass}}

-

-{{$info_01}}
-{{$info_02}}
-{{$info_03}} + {{$info_01}}
+ {{$info_02}}
+ {{$info_03}}

@@ -21,16 +18,14 @@ - - + + -{{include file="field_input.tpl" field=$dbhost}} -{{include file="field_input.tpl" field=$dbuser}} -{{include file="field_password.tpl" field=$dbpass}} -{{include file="field_input.tpl" field=$dbdata}} + {{include file="field_input.tpl" field=$dbhost}} + {{include file="field_input.tpl" field=$dbuser}} + {{include file="field_password.tpl" field=$dbpass}} + {{include file="field_input.tpl" field=$dbdata}} - - + - diff --git a/view/templates/install_finished.tpl b/view/templates/install_finished.tpl index 5c8d765e3..8e643b7a1 100644 --- a/view/templates/install_finished.tpl +++ b/view/templates/install_finished.tpl @@ -1,13 +1,10 @@ - -

{{$title}}

{{$pass}}

- {{foreach $checks as $check}} Requirement not satisfied -{{$check.title}} - +{{$check.title nofilter}} + {{/foreach}} -{{$text}} +{{$text nofilter}} diff --git a/view/templates/install_settings.tpl b/view/templates/install_settings.tpl index fca11a042..a7e4886ae 100644 --- a/view/templates/install_settings.tpl +++ b/view/templates/install_settings.tpl @@ -14,7 +14,7 @@ {{include file="field_input.tpl" field=$adminmail}} -{{$timezone}} +{{$timezone nofilter}} {{include file="field_select.tpl" field=$language}} From c8b6778cde3c0b503adc10889f579b289fb7440b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 21 Dec 2018 00:05:41 -0500 Subject: [PATCH 3/5] Fix home escaping --- view/templates/home.tpl | 4 ++-- view/theme/frio/templates/home.tpl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/view/templates/home.tpl b/view/templates/home.tpl index 7d9597beb..eb3f402fc 100644 --- a/view/templates/home.tpl +++ b/view/templates/home.tpl @@ -7,8 +7,8 @@ {{if $customhome != false }} {{include file="$customhome"}} {{else}} - {{$defaultheader}} + {{$defaultheader nofilter}} {{/if}} - {{$login}} + {{$login nofilter}} {{/if}} diff --git a/view/theme/frio/templates/home.tpl b/view/theme/frio/templates/home.tpl index ac1cc37be..8552f2583 100644 --- a/view/theme/frio/templates/home.tpl +++ b/view/theme/frio/templates/home.tpl @@ -15,11 +15,11 @@ {{if $customhome != false }} {{include file="$customhome"}} {{else}} - {{$defaultheader}} + {{$defaultheader nofilter}} {{/if}} {{/if}} \ No newline at end of file From 6b481aaac6f6e18a5611d286e06d3c113bc083cf Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 21 Dec 2018 00:06:22 -0500 Subject: [PATCH 4/5] Fix advanced profile fields escaping --- view/templates/profile_advanced.tpl | 22 +++++++++--------- .../theme/frio/templates/profile_advanced.tpl | 23 +++++++++---------- .../theme/vier/templates/profile_advanced.tpl | 22 +++++++++--------- 3 files changed, 33 insertions(+), 34 deletions(-) diff --git a/view/templates/profile_advanced.tpl b/view/templates/profile_advanced.tpl index 3bc69dce4..83685d86e 100644 --- a/view/templates/profile_advanced.tpl +++ b/view/templates/profile_advanced.tpl @@ -93,28 +93,28 @@ {{if $profile.interest}}
{{$profile.interest.0}}
-
{{$profile.interest.1}}
+
{{$profile.interest.1 nofilter}}
{{/if}} {{if $profile.likes}}
{{$profile.likes.0}}
-
{{$profile.likes.1}}
+
{{$profile.likes.1 nofilter}}
{{/if}} {{if $profile.dislikes}}
{{$profile.dislikes.0}}
-
{{$profile.dislikes.1}}
+
{{$profile.dislikes.1 nofilter}}
{{/if}} {{if $profile.contact}}
{{$profile.contact.0}}
-
{{$profile.contact.1}}
+
{{$profile.contact.1 nofilter}}
{{/if}} @@ -122,7 +122,7 @@ {{if $profile.music}}
{{$profile.music.0}}
-
{{$profile.music.1}}
+
{{$profile.music.1 nofilter}}
{{/if}} @@ -130,7 +130,7 @@ {{if $profile.book}}
{{$profile.book.0}}
-
{{$profile.book.1}}
+
{{$profile.book.1 nofilter}}
{{/if}} @@ -138,7 +138,7 @@ {{if $profile.tv}}
{{$profile.tv.0}}
-
{{$profile.tv.1}}
+
{{$profile.tv.1 nofilter}}
{{/if}} @@ -146,7 +146,7 @@ {{if $profile.film}}
{{$profile.film.0}}
-
{{$profile.film.1}}
+
{{$profile.film.1 nofilter}}
{{/if}} @@ -154,7 +154,7 @@ {{if $profile.romance}}
{{$profile.romance.0}}
-
{{$profile.romance.1}}
+
{{$profile.romance.1 nofilter}}
{{/if}} @@ -162,14 +162,14 @@ {{if $profile.work}}
{{$profile.work.0}}
-
{{$profile.work.1}}
+
{{$profile.work.1 nofilter}}
{{/if}} {{if $profile.education}}
{{$profile.education.0}}
-
{{$profile.education.1}}
+
{{$profile.education.1 nofilter}}
{{/if}} diff --git a/view/theme/frio/templates/profile_advanced.tpl b/view/theme/frio/templates/profile_advanced.tpl index 253110831..a35955c17 100644 --- a/view/theme/frio/templates/profile_advanced.tpl +++ b/view/theme/frio/templates/profile_advanced.tpl @@ -133,7 +133,7 @@

{{$profile.interest.0}}
-
{{$profile.interest.1}}
+
{{$profile.interest.1 nofilter}}
{{/if}} @@ -141,7 +141,7 @@

{{$profile.likes.0}}
-
{{$profile.likes.1}}
+
{{$profile.likes.1 nofilter}}
{{/if}} @@ -149,7 +149,7 @@

{{$profile.dislikes.0}}
-
{{$profile.dislikes.1}}
+
{{$profile.dislikes.1 nofilter}}
{{/if}} @@ -157,16 +157,15 @@

{{$profile.contact.0}}
-
{{$profile.contact.1}}
+
{{$profile.contact.1 nofilter}}
{{/if}} - {{if $profile.music}}

{{$profile.music.0}}
-
{{$profile.music.1}}
+
{{$profile.music.1 nofilter}}
{{/if}} @@ -175,7 +174,7 @@

{{$profile.book.0}}
-
{{$profile.book.1}}
+
{{$profile.book.1 nofilter}}
{{/if}} @@ -184,7 +183,7 @@

{{$profile.tv.0}}
-
{{$profile.tv.1}}
+
{{$profile.tv.1 nofilter}}
{{/if}} @@ -193,7 +192,7 @@

{{$profile.film.0}}
-
{{$profile.film.1}}
+
{{$profile.film.1 nofilter}}
{{/if}} @@ -202,7 +201,7 @@

{{$profile.romance.0}}
-
{{$profile.romance.1}}
+
{{$profile.romance.1 nofilter}}
{{/if}} @@ -211,7 +210,7 @@

{{$profile.work.0}}
-
{{$profile.work.1}}
+
{{$profile.work.1 nofilter}}
{{/if}} @@ -219,7 +218,7 @@

{{$profile.education.0}}
-
{{$profile.education.1}}
+
{{$profile.education.1 nofilter}}
{{/if}} diff --git a/view/theme/vier/templates/profile_advanced.tpl b/view/theme/vier/templates/profile_advanced.tpl index 28d42efe8..20c4e84b1 100644 --- a/view/theme/vier/templates/profile_advanced.tpl +++ b/view/theme/vier/templates/profile_advanced.tpl @@ -98,28 +98,28 @@ {{if $profile.interest}}
{{$profile.interest.0}}
-
{{$profile.interest.1}}
+
{{$profile.interest.1 nofilter}}
{{/if}} {{if $profile.likes}}
{{$profile.likes.0}}
-
{{$profile.likes.1}}
+
{{$profile.likes.1 nofilter}}
{{/if}} {{if $profile.dislikes}}
{{$profile.dislikes.0}}
-
{{$profile.dislikes.1}}
+
{{$profile.dislikes.1 nofilter}}
{{/if}} {{if $profile.contact}}
{{$profile.contact.0}}
-
{{$profile.contact.1}}
+
{{$profile.contact.1 nofilter}}
{{/if}} @@ -127,7 +127,7 @@ {{if $profile.music}}
{{$profile.music.0}}
-
{{$profile.music.1}}
+
{{$profile.music.1 nofilter}}
{{/if}} @@ -135,7 +135,7 @@ {{if $profile.book}}
{{$profile.book.0}}
-
{{$profile.book.1}}
+
{{$profile.book.1 nofilter}}
{{/if}} @@ -143,7 +143,7 @@ {{if $profile.tv}}
{{$profile.tv.0}}
-
{{$profile.tv.1}}
+
{{$profile.tv.1 nofilter}}
{{/if}} @@ -151,7 +151,7 @@ {{if $profile.film}}
{{$profile.film.0}}
-
{{$profile.film.1}}
+
{{$profile.film.1 nofilter}}
{{/if}} @@ -159,7 +159,7 @@ {{if $profile.romance}}
{{$profile.romance.0}}
-
{{$profile.romance.1}}
+
{{$profile.romance.1 nofilter}}
{{/if}} @@ -167,14 +167,14 @@ {{if $profile.work}}
{{$profile.work.0}}
-
{{$profile.work.1}}
+
{{$profile.work.1 nofilter}}
{{/if}} {{if $profile.education}}
{{$profile.education.0}}
-
{{$profile.education.1}}
+
{{$profile.education.1 nofilter}}
{{/if}} From 2776b1443b759e136e14c69984fb8e2a8a276a33 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 21 Dec 2018 00:06:37 -0500 Subject: [PATCH 5/5] Fix post location escaping --- view/templates/search_item.tpl | 2 +- view/templates/wall_thread.tpl | 2 +- view/theme/frio/templates/search_item.tpl | 4 ++-- view/theme/frio/templates/wall_thread.tpl | 6 +++--- view/theme/quattro/templates/search_item.tpl | 2 +- view/theme/quattro/templates/wall_item_tag.tpl | 2 +- view/theme/quattro/templates/wall_thread.tpl | 2 +- view/theme/smoothly/templates/search_item.tpl | 2 +- view/theme/smoothly/templates/wall_thread.tpl | 2 +- view/theme/vier/templates/search_item.tpl | 2 +- view/theme/vier/templates/wall_item_tag.tpl | 2 +- view/theme/vier/templates/wall_thread.tpl | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/view/templates/search_item.tpl b/view/templates/search_item.tpl index 8560757ef..38aa94749 100644 --- a/view/templates/search_item.tpl +++ b/view/templates/search_item.tpl @@ -19,7 +19,7 @@
{{if $item.lock}}
{{$item.lock}}
{{else}}
{{/if}} -
{{$item.location}}
+
{{$item.location nofilter}}
diff --git a/view/templates/wall_thread.tpl b/view/templates/wall_thread.tpl index 38c0f4359..6ca333c3d 100644 --- a/view/templates/wall_thread.tpl +++ b/view/templates/wall_thread.tpl @@ -40,7 +40,7 @@
{{if $item.lock}}
{{$item.lock}}
{{else}}
{{/if}} -
{{$item.location}}
+
{{$item.location nofilter}}
diff --git a/view/theme/frio/templates/search_item.tpl b/view/theme/frio/templates/search_item.tpl index 454f4e887..b668229e8 100644 --- a/view/theme/frio/templates/search_item.tpl +++ b/view/theme/frio/templates/search_item.tpl @@ -99,7 +99,7 @@ {{if $item.location}}
- ({{$item.location}}) + ({{$item.location nofilter}})
{{/if}}
@@ -112,7 +112,7 @@
{{$item.name}}

- {{$item.ago}} {{if $item.location}} — ({{$item.location}}){{/if}} + {{$item.ago}} {{if $item.location}} — ({{$item.location nofilter}}){{/if}}

diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index 8a3816f8c..af3e27228 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -208,7 +208,7 @@ as the value of $top_child_total (this is done at the end of this file) {{if $item.location}}
- ({{$item.location}}) + ({{$item.location nofilter}})
{{/if}} @@ -220,7 +220,7 @@ as the value of $top_child_total (this is done at the end of this file)
{{$item.name}}

- {{$item.ago}} {{if $item.location}} — ({{$item.location}}){{/if}} + {{$item.ago}} {{if $item.location}} — ({{$item.location nofilter}}){{/if}}

@@ -233,7 +233,7 @@ as the value of $top_child_total (this is done at the end of this file)
{{$item.name}} - {{$item.ago}} {{if $item.location}} — ({{$item.location}}){{/if}} + {{$item.ago}} {{if $item.location}} — ({{$item.location nofilter}}){{/if}}
diff --git a/view/theme/quattro/templates/search_item.tpl b/view/theme/quattro/templates/search_item.tpl index 2857baf2b..43588fc9f 100644 --- a/view/theme/quattro/templates/search_item.tpl +++ b/view/theme/quattro/templates/search_item.tpl @@ -19,7 +19,7 @@ -
{{$item.location}}
+
{{$item.location nofilter}}
{{if $item.title}}

{{$item.title}}

{{/if}} diff --git a/view/theme/quattro/templates/wall_item_tag.tpl b/view/theme/quattro/templates/wall_item_tag.tpl index 90ceafce5..cb4b89015 100644 --- a/view/theme/quattro/templates/wall_item_tag.tpl +++ b/view/theme/quattro/templates/wall_item_tag.tpl @@ -34,7 +34,7 @@
-
{{$item.location}}
+
{{$item.location nofilter}}
{{$item.ago}} {{$item.body nofilter}} diff --git a/view/theme/quattro/templates/wall_thread.tpl b/view/theme/quattro/templates/wall_thread.tpl index 565ddb573..35363a758 100644 --- a/view/theme/quattro/templates/wall_thread.tpl +++ b/view/theme/quattro/templates/wall_thread.tpl @@ -56,7 +56,7 @@
{{/if}} -
{{$item.location}}
+
{{$item.location nofilter}}
{{if $item.title}}

{{$item.title}}

{{/if}} diff --git a/view/theme/smoothly/templates/search_item.tpl b/view/theme/smoothly/templates/search_item.tpl index 1830922fc..23af1b794 100644 --- a/view/theme/smoothly/templates/search_item.tpl +++ b/view/theme/smoothly/templates/search_item.tpl @@ -15,7 +15,7 @@
-
{{if $item.location}}{{$item.location}} {{/if}}
+
{{if $item.location}}{{$item.location nofilter}} {{/if}}
{{if $item.lock}}
{{$item.lock}}
diff --git a/view/theme/smoothly/templates/wall_thread.tpl b/view/theme/smoothly/templates/wall_thread.tpl index 454b2b396..a7e0f2010 100644 --- a/view/theme/smoothly/templates/wall_thread.tpl +++ b/view/theme/smoothly/templates/wall_thread.tpl @@ -33,7 +33,7 @@
-
{{if $item.location}}{{$item.location}} {{/if}}
+
{{if $item.location}}{{$item.location nofilter}} {{/if}}
{{if $item.lock}} diff --git a/view/theme/vier/templates/search_item.tpl b/view/theme/vier/templates/search_item.tpl index 4d900649e..080d7a528 100644 --- a/view/theme/vier/templates/search_item.tpl +++ b/view/theme/vier/templates/search_item.tpl @@ -51,7 +51,7 @@
-
{{$item.location}} 
+
{{$item.location nofilter}} 
{{if $item.star}} diff --git a/view/theme/vier/templates/wall_item_tag.tpl b/view/theme/vier/templates/wall_item_tag.tpl index a14f45101..49fb26a83 100644 --- a/view/theme/vier/templates/wall_item_tag.tpl +++ b/view/theme/vier/templates/wall_item_tag.tpl @@ -34,7 +34,7 @@
-
{{$item.location}}
+
{{$item.location nofilter}}
{{$item.ago}} {{$item.body nofilter}} diff --git a/view/theme/vier/templates/wall_thread.tpl b/view/theme/vier/templates/wall_thread.tpl index 45ec27ba1..0ab2e478e 100644 --- a/view/theme/vier/templates/wall_thread.tpl +++ b/view/theme/vier/templates/wall_thread.tpl @@ -134,7 +134,7 @@ {{/if}}
-
{{$item.location}} {{$item.postopts}}
+
{{$item.location nofilter}} {{$item.postopts}}