]> git.mxchange.org Git - friendica.git/commitdiff
Remove the baseurl where possible to avoid mixed content
authorMichael Vogel <icarus@dabo.de>
Tue, 16 Feb 2016 23:01:24 +0000 (00:01 +0100)
committerMichael Vogel <icarus@dabo.de>
Tue, 16 Feb 2016 23:01:24 +0000 (00:01 +0100)
boot.php
include/ForumManager.php
include/nav.php
mod/network.php
object/Item.php
view/templates/head.tpl
view/theme/vier/theme.php

index d9d7c62dc77dfed2dba7eebcb80e3360b51869c6..0217750136b194235e9e462e8d35b7f05c0f8e84 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -920,6 +920,10 @@ class App {
        }
 
        function get_cached_avatar_image($avatar_image){
+               // Just remove the base url. This avoid mixed content
+               $avatar_image = normalise_link($avatar_image);
+               $base = normalise_link($this->get_baseurl());
+               $avatar_image = str_replace($base."/", "", $avatar_image);
                return $avatar_image;
 
                // The following code is deactivated. It doesn't seem to make any sense and it slows down the system.
index 49417d1831564c0fbc0ce5e635213c0bc883449b..73eb511de60b2374d687ea58088c6f2e041a5117 100644 (file)
@@ -89,18 +89,18 @@ class ForumManager {
                if(count($contacts)) {
 
                        $id = 0;
-
+$a = get_app();
                        foreach($contacts as $contact) {
 
                                $selected = (($cid == $contact['id']) ? ' forum-selected' : '');
 
                                $entry = array(
-                                       'url' => z_root() . '/network?f=&cid=' . $contact['id'],
-                                       'external_url' => z_root() . '/redir/' . $contact['id'],
+                                       'url' => 'network?f=&cid=' . $contact['id'],
+                                       'external_url' => 'redir/' . $contact['id'],
                                        'name' => $contact['name'],
                                        'cid' => $contact['id'],
                                        'selected'      => $selected,
-                                       'micro' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO),
+                                       'micro' => $a->get_cached_avatar_image(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
                                        'id' => ++$id,
                                );
                                $entries[] = $entry;
@@ -187,4 +187,4 @@ class ForumManager {
                return $r;
        }
 
-}
\ No newline at end of file
+}
index 6512d35609f25e031674a1a673434b748211cb23..fb7225af920c2341e11ec2a859e3de75a4fee52d 100644 (file)
@@ -107,7 +107,7 @@ function nav_info(&$a) {
        if(($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user()))
                $nav['register'] = array('register',t('Register'), "", t('Create an account'));
 
-       $help_url = $a->get_baseurl($ssl_state) . '/help';
+       $help_url = 'help';
 
        if(! get_config('system','hide_help'))
                $nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'));
index 0010a3d8246b9fb2d681c06e394df02638834d45..a9f369a894182fac5831c85d63438b3b04baa121 100644 (file)
@@ -149,10 +149,10 @@ function network_init(&$a) {
 
        $a->page['aside'] .= (feature_enabled(local_user(),'groups') ? group_side('network/0','network','standard',$group_id) : '');
        $a->page['aside'] .= (feature_enabled(local_user(),'forumlist_widget') ? ForumManager::widget(local_user(),$cid) : '');
-       $a->page['aside'] .= posted_date_widget($a->get_baseurl() . '/network',local_user(),false);
-       $a->page['aside'] .= networks_widget($a->get_baseurl(true) . '/network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
+       $a->page['aside'] .= posted_date_widget('network',local_user(),false);
+       $a->page['aside'] .= networks_widget('network',(x($_GET, 'nets') ? $_GET['nets'] : ''));
        $a->page['aside'] .= saved_searches($search);
-       $a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
+       $a->page['aside'] .= fileas_widget('network',(x($_GET, 'file') ? $_GET['file'] : ''));
 
 }
 
@@ -363,7 +363,7 @@ function network_content(&$a, $update = 0) {
        $tabs = array(
                array(
                        'label' => t('Commented Order'),
-                       'url'   => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
+                       'url'   => str_replace('/new', '', $cmd) . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
                        'sel'   => $all_active,
                        'title' => t('Sort by Comment Date'),
                        'id'    => 'commented-order-tab',
@@ -371,7 +371,7 @@ function network_content(&$a, $update = 0) {
                ),
                array(
                        'label' => t('Posted Order'),
-                       'url'   => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
+                       'url'   => str_replace('/new', '', $cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
                        'sel'   => $postord_active,
                        'title' => t('Sort by Post Date'),
                        'id'    => 'posted-order-tab',
@@ -382,7 +382,7 @@ function network_content(&$a, $update = 0) {
        if(feature_enabled(local_user(),'personal_tab')) {
                $tabs[] = array(
                        'label' => t('Personal'),
-                       'url'   => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1',
+                       'url'   => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1',
                        'sel'   => $conv_active,
                        'title' => t('Posts that mention or involve you'),
                        'id'    => 'personal-tab',
@@ -393,7 +393,7 @@ function network_content(&$a, $update = 0) {
        if(feature_enabled(local_user(),'new_tab')) {
                $tabs[] = array(
                        'label' => t('New'),
-                       'url'   => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ($len_naked_cmd ? '/' : '') . 'new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
+                       'url'   => str_replace('/new', '', $cmd) . ($len_naked_cmd ? '/' : '') . 'new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
                        'sel'   => $new_active,
                        'title' => t('Activity Stream - by date'),
                        'id'    => 'activitiy-by-date-tab',
@@ -404,7 +404,7 @@ function network_content(&$a, $update = 0) {
        if(feature_enabled(local_user(),'link_tab')) {
                $tabs[] = array(
                        'label' => t('Shared Links'),
-                       'url'   => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&bmark=1',
+                       'url'   => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&bmark=1',
                        'sel'   => $bookmarked_active,
                        'title' => t('Interesting Links'),
                        'id'    => 'shared-links-tab',
@@ -415,7 +415,7 @@ function network_content(&$a, $update = 0) {
        if(feature_enabled(local_user(),'star_posts')) {
                $tabs[] = array(
                        'label' => t('Starred'),
-                       'url'   => $a->get_baseurl(true) . '/' . str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1',
+                       'url'   => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1',
                        'sel'   => $starred_active,
                        'title' => t('Favourite Posts'),
                        'id'    => 'starred-posts-tab',
@@ -547,7 +547,7 @@ function network_content(&$a, $update = 0) {
                        if($update)
                                killme();
                        notice( t('No such group') . EOL );
-                       goaway($a->get_baseurl(true) . '/network/0');
+                       goaway('network/0');
                        // NOTREACHED
                }
 
@@ -611,7 +611,7 @@ function network_content(&$a, $update = 0) {
                }
                else {
                        notice( t('Invalid contact.') . EOL);
-                       goaway($a->get_baseurl(true) . '/network');
+                       goaway('network');
                        // NOTREACHED
                }
        }
index 04c1a707e3a6e3eb6fef18ac4006dbe3252200c2..7b542c472453bc4df80c477081241060c0bb2b29 100644 (file)
@@ -705,7 +705,7 @@ class Item extends BaseObject {
                                '$profile_uid' =>  $conv->get_profile_owner(),
                                '$mylink' => $a->contact['url'],
                                '$mytitle' => t('This is you'),
-                               '$myphoto' => $a->contact['thumb'],
+                               '$myphoto' => $a->get_cached_avatar_image($a->contact['thumb']),
                                '$comment' => t('Comment'),
                                '$submit' => t('Submit'),
                                '$edbold' => t('Bold'),
index 17c459c4d8a17bd90053ba2361e60963a8d545fa..fdf9a7716e0572c35bfc68c3cee7ff532ec4dd54 100644 (file)
@@ -2,17 +2,17 @@
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <base href="{{$baseurl}}/" />
 <meta name="generator" content="{{$generator}}" />
-<link rel="stylesheet" href="{{$baseurl}}/view/global.css" type="text/css" media="all" />
-<link rel="stylesheet" href="{{$baseurl}}/library/colorbox/colorbox.css" type="text/css" media="screen" />
-<link rel="stylesheet" href="{{$baseurl}}/library/jgrowl/jquery.jgrowl.css" type="text/css" media="screen" />
-<link rel="stylesheet" href="{{$baseurl}}/library/datetimepicker/jquery.datetimepicker.css" type="text/css" media="screen" />
-<link rel="stylesheet" href="{{$baseurl}}/library/perfect-scrollbar/perfect-scrollbar.min.css" type="text/css" media="screen" />
+<link rel="stylesheet" href="view/global.css" type="text/css" media="all" />
+<link rel="stylesheet" href="library/colorbox/colorbox.css" type="text/css" media="screen" />
+<link rel="stylesheet" href="library/jgrowl/jquery.jgrowl.css" type="text/css" media="screen" />
+<link rel="stylesheet" href="library/datetimepicker/jquery.datetimepicker.css" type="text/css" media="screen" />
+<link rel="stylesheet" href="library/perfect-scrollbar/perfect-scrollbar.min.css" type="text/css" media="screen" />
 
 <link rel="stylesheet" type="text/css" href="{{$stylesheet}}" media="all" />
 
 <!--
-<link rel="shortcut icon" href="{{$baseurl}}/images/friendica-32.png" />
-<link rel="apple-touch-icon" href="{{$baseurl}}/images/friendica-128.png"/>
+<link rel="shortcut icon" href="images/friendica-32.png" />
+<link rel="apple-touch-icon" href="images/friendica-128.png"/>
 -->
 <link rel="shortcut icon" href="{{$shortcut_icon}}" />
 <link rel="apple-touch-icon" href="{{$touch_icon}}"/>
 <!--[if IE]>
 <script type="text/javascript" src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
 <![endif]-->
-<script type="text/javascript" src="{{$baseurl}}/js/modernizr.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/js/jquery.js" ></script>
-<!-- <script type="text/javascript" src="{{$baseurl}}/js/jquery-migrate.js" ></script>-->
-<script type="text/javascript" src="{{$baseurl}}/js/jquery-migrate.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/js/jquery.textinputs.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/js/fk.autocomplete.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/library/colorbox/jquery.colorbox-min.js"></script>
-<script type="text/javascript" src="{{$baseurl}}/library/jgrowl/jquery.jgrowl_minimized.js"></script>
-<script type="text/javascript" src="{{$baseurl}}/library/datetimepicker/jquery.datetimepicker.js"></script>
-<script type="text/javascript" src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/library/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/js/acl.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/js/webtoolkit.base64.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/js/main.js" ></script>
+<script type="text/javascript" src="js/modernizr.js" ></script>
+<script type="text/javascript" src="js/jquery.js" ></script>
+<!-- <script type="text/javascript" src="js/jquery-migrate.js" ></script>-->
+<script type="text/javascript" src="js/jquery-migrate.js" ></script>
+<script type="text/javascript" src="js/jquery.textinputs.js" ></script>
+<script type="text/javascript" src="js/fk.autocomplete.js" ></script>
+<script type="text/javascript" src="library/colorbox/jquery.colorbox-min.js"></script>
+<script type="text/javascript" src="library/jgrowl/jquery.jgrowl_minimized.js"></script>
+<script type="text/javascript" src="library/datetimepicker/jquery.datetimepicker.js"></script>
+<script type="text/javascript" src="library/tinymce/jscripts/tiny_mce/tiny_mce_src.js" ></script>
+<script type="text/javascript" src="library/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script>
+<script type="text/javascript" src="js/acl.js" ></script>
+<script type="text/javascript" src="js/webtoolkit.base64.js" ></script>
+<script type="text/javascript" src="js/main.js" ></script>
 <script>
 
        var updateInterval = {{$update_interval}};
index c2669f5a931ae8030d88ba603d596b243ec894b9..25954350f978f25d9c2ae4df8ea3674832e8db03 100644 (file)
@@ -19,8 +19,6 @@ function vier_init(&$a) {
 
        set_template_engine($a, 'smarty3');
 
-       $baseurl = $a->get_baseurl();
-
        $a->theme_info = array();
 
        if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()) {
@@ -160,7 +158,7 @@ function vier_community_info() {
                                $entry = replace_macros($tpl,array(
                                        '$id' => $rr['id'],
                                        //'$profile_link' => zrl($rr['url']),
-                                       '$profile_link' => $a->get_baseurl().'/follow/?url='.urlencode($rr['url']),
+                                       '$profile_link' => 'follow/?url='.urlencode($rr['url']),
                                        '$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO),
                                        '$alt_text' => $rr['name'],
                                ));
@@ -186,7 +184,7 @@ function vier_community_info() {
                        $aside['$lastusers_items'] = array();
 
                        foreach($r as $rr) {
-                               $profile_link = $a->get_baseurl() . '/profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
+                               $profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
                                $entry = replace_macros($tpl,array(
                                        '$id' => $rr['id'],
                                        '$profile_link' => $profile_link,
@@ -207,7 +205,7 @@ function vier_community_info() {
                $nv['suggest'] = Array('suggest', t('Friend Suggestions'), "", "");
                $nv['invite'] = Array('invite', t('Invite Friends'), "", "");
 
-               $nv['search'] = '<form name="simple_bar" method="get" action="'.$a->get_baseurl().'/dirfind">
+               $nv['search'] = '<form name="simple_bar" method="get" action="dirfind">
                                                <span class="sbox_l"></span>
                                                <span class="sbox">
                                                <input type="text" name="search" size="13" maxlength="50">