Merge branch 'master' of https://github.com/friendica/friendica
This commit is contained in:
commit
5633e88aad
|
@ -12,7 +12,7 @@ Deny from all
|
|||
# Protect repository directory from browsing
|
||||
RewriteRule "(^|/)\.git" - [F]
|
||||
|
||||
# Rewrite current-style URLs of the form 'index.php?q=x'.
|
||||
# Rewrite current-style URLs of the form 'index.php?pagename=x'.
|
||||
# Also place auth information into REMOTE_USER for sites running
|
||||
# in CGI mode.
|
||||
|
||||
|
@ -28,7 +28,7 @@ Deny from all
|
|||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
|
||||
RewriteRule ^(.*)$ index.php?pagename=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
|
||||
|
||||
</IfModule>
|
||||
|
||||
|
|
18
boot.php
18
boot.php
|
@ -507,13 +507,20 @@ if(! class_exists('App')) {
|
|||
|
||||
set_include_path("include/$this->hostname" . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
|
||||
if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,9) === "pagename=") {
|
||||
$this->query_string = substr($_SERVER['QUERY_STRING'],9);
|
||||
// removing trailing / - maybe a nginx problem
|
||||
if (substr($this->query_string, 0, 1) == "/")
|
||||
$this->query_string = substr($this->query_string, 1);
|
||||
} elseif((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
|
||||
$this->query_string = substr($_SERVER['QUERY_STRING'],2);
|
||||
// removing trailing / - maybe a nginx problem
|
||||
if (substr($this->query_string, 0, 1) == "/")
|
||||
$this->query_string = substr($this->query_string, 1);
|
||||
}
|
||||
if(x($_GET,'q'))
|
||||
if (x($_GET,'pagename'))
|
||||
$this->cmd = trim($_GET['pagename'],'/\\');
|
||||
elseif (x($_GET,'q'))
|
||||
$this->cmd = trim($_GET['q'],'/\\');
|
||||
|
||||
// unix style "homedir"
|
||||
|
@ -865,6 +872,10 @@ if(! class_exists('App')) {
|
|||
$this->performance["markstart"] = microtime(true) - $this->performance["markstart"] - $this->performance["marktime"];
|
||||
}
|
||||
|
||||
function get_useragent() {
|
||||
return(FRIENDICA_PLATFORM." ".FRIENDICA_VERSION."-".DB_UPDATE_VERSION."; ".$this->get_baseurl());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1019,7 +1030,8 @@ if(! function_exists('update_db')) {
|
|||
|
||||
$t = get_config('database','dbupdate_'.DB_UPDATE_VERSION);
|
||||
if($t !== false)
|
||||
break;
|
||||
return;
|
||||
|
||||
set_config('database','dbupdate_'.DB_UPDATE_VERSION, time());
|
||||
|
||||
require_once("include/dbstructure.php");
|
||||
|
|
|
@ -122,7 +122,6 @@
|
|||
|
||||
// preset
|
||||
$type="json";
|
||||
|
||||
foreach ($API as $p=>$info){
|
||||
if (strpos($a->query_string, $p)===0){
|
||||
$called_api= explode("/",$p);
|
||||
|
@ -936,6 +935,35 @@
|
|||
}
|
||||
api_register_func('api/users/show','api_users_show');
|
||||
|
||||
|
||||
function api_users_search(&$a, $type) {
|
||||
$page = (x($_REQUEST,'page')?$_REQUEST['page']-1:0);
|
||||
|
||||
$userlist = array();
|
||||
|
||||
if (isset($_GET["q"])) {
|
||||
$r = q("SELECT id FROM unique_contacts WHERE name='%s'", dbesc($_GET["q"]));
|
||||
if (!count($r))
|
||||
$r = q("SELECT id FROM unique_contacts WHERE nick='%s'", dbesc($_GET["q"]));
|
||||
|
||||
if (count($r)) {
|
||||
foreach ($r AS $user) {
|
||||
$user_info = api_get_user($a, $user["id"]);
|
||||
//echo print_r($user_info, true)."\n";
|
||||
$userdata = api_apply_template("user", $type, array('user' => $user_info));
|
||||
$userlist[] = $userdata["user"];
|
||||
}
|
||||
$userlist = array("users" => $userlist);
|
||||
} else
|
||||
die(api_error($a, $type, t("User not found.")));
|
||||
} else
|
||||
die(api_error($a, $type, t("User not found.")));
|
||||
|
||||
return ($userlist);
|
||||
}
|
||||
|
||||
api_register_func('api/users/search','api_users_search');
|
||||
|
||||
/**
|
||||
*
|
||||
* http://developer.twitter.com/doc/get/statuses/home_timeline
|
||||
|
|
|
@ -674,10 +674,12 @@ function bb_RemovePictureLinks($match) {
|
|||
$text = Cache::get($match[1]);
|
||||
|
||||
if(is_null($text)){
|
||||
$a = get_app();
|
||||
|
||||
$ch = @curl_init($match[1]);
|
||||
@curl_setopt($ch, CURLOPT_NOBODY, true);
|
||||
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
@curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION."-".DB_UPDATE_VERSION.")");
|
||||
@curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
||||
@curl_exec($ch);
|
||||
$curl_info = @curl_getinfo($ch);
|
||||
|
||||
|
@ -722,10 +724,12 @@ function bb_CleanPictureLinksSub($match) {
|
|||
$text = Cache::get($match[1]);
|
||||
|
||||
if(is_null($text)){
|
||||
$a = get_app();
|
||||
|
||||
$ch = @curl_init($match[1]);
|
||||
@curl_setopt($ch, CURLOPT_NOBODY, true);
|
||||
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
@curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION."-".DB_UPDATE_VERSION.")");
|
||||
@curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
||||
@curl_exec($ch);
|
||||
$curl_info = @curl_getinfo($ch);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0, $accept_
|
|||
}
|
||||
|
||||
@curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
|
||||
@curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION."-".DB_UPDATE_VERSION.")");
|
||||
@curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
||||
|
||||
|
||||
if(intval($timeout)) {
|
||||
|
@ -134,7 +134,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0)
|
|||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
|
||||
curl_setopt($ch, CURLOPT_POST,1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION."-".DB_UPDATE_VERSION.")");
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
||||
|
||||
if(intval($timeout)) {
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
|
||||
|
@ -1114,6 +1114,8 @@ function xml2array($contents, $namespaces = true, $get_attributes=1, $priority =
|
|||
|
||||
function original_url($url, $depth=1, $fetchbody = false) {
|
||||
|
||||
$a = get_app();
|
||||
|
||||
// Remove Analytics Data from Google and other tracking platforms
|
||||
$urldata = parse_url($url);
|
||||
if (is_string($urldata["query"])) {
|
||||
|
@ -1163,7 +1165,7 @@ function original_url($url, $depth=1, $fetchbody = false) {
|
|||
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION."-".DB_UPDATE_VERSION.")");
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
||||
|
||||
$header = curl_exec($ch);
|
||||
$curl_info = @curl_getinfo($ch);
|
||||
|
|
|
@ -1179,8 +1179,10 @@ function admin_page_themes(&$a){
|
|||
foreach($files as $file) {
|
||||
$f = basename($file);
|
||||
$is_experimental = intval(file_exists($file . '/experimental'));
|
||||
$is_supported = 1-(intval(file_exists($file . '/unsupported'))); // Is not used yet
|
||||
$is_supported = 1-(intval(file_exists($file . '/unsupported')));
|
||||
$is_allowed = intval(in_array($f,$allowed_themes));
|
||||
|
||||
if ($is_allowed OR $is_supported OR get_config("system", "show_unsupported_themes"))
|
||||
$themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,8 @@ function completeurl($url, $scheme) {
|
|||
|
||||
function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $count = 1) {
|
||||
|
||||
$a = get_app();
|
||||
|
||||
$siteinfo = array();
|
||||
|
||||
if ($count > 10) {
|
||||
|
@ -71,7 +73,7 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co
|
|||
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION."-".DB_UPDATE_VERSION.")");
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
|
||||
|
||||
$header = curl_exec($ch);
|
||||
$curl_info = @curl_getinfo($ch);
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 364 B |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 80 KiB |
Binary file not shown.
Before Width: | Height: | Size: 320 B |
|
@ -1,48 +0,0 @@
|
|||
@import url('../duepuntozero/style.css');
|
||||
|
||||
.vcard .fn {
|
||||
color: orange !important;
|
||||
}
|
||||
|
||||
.vcard .title {
|
||||
color: #00BB00 !important;
|
||||
}
|
||||
|
||||
.wall-item-content-wrapper {
|
||||
border: 1px solid red;
|
||||
background: #FFDDFF;
|
||||
}
|
||||
|
||||
.wall-item-content-wrapper.comment {
|
||||
background: #FFCCAA;
|
||||
}
|
||||
|
||||
.comment-edit-wrapper {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
body { background-image: url('head.jpg'); }
|
||||
section { background: #EEFFFF; }
|
||||
|
||||
a, a:visited { color: #0000FF; text-decoration: none; }
|
||||
a:hover {text-decoration: underline; }
|
||||
|
||||
|
||||
aside( background-image: url('border.jpg'); }
|
||||
.tabs { background-image: url('head.jpg'); }
|
||||
div.wall-item-content-wrapper.shiny { background-image: url('shiny.png'); }
|
||||
|
||||
|
||||
.nav-commlink, .nav-login-link {
|
||||
background-color: #aed3b2;
|
||||
|
||||
}
|
||||
|
||||
.fakelink, .fakelink:visited {
|
||||
color: #0000FF;
|
||||
}
|
||||
|
||||
.wall-item-name-link {
|
||||
color: #0000FF;
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
<?php
|
||||
|
||||
function easterbunny_init(&$a) {
|
||||
$a->theme_info = array(
|
||||
'extends' => 'duepuntozero',
|
||||
);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<div class="wall-item-decor">
|
||||
<span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>
|
||||
{{if $item.star}}<span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>{{/if}}
|
||||
{{if $item.lock}}<span class="icon s22 lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
|
||||
<img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" />
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
{{if $item.thread_level!=1}}<div class="children">{{/if}}
|
||||
|
||||
<div class="wall-item-decor">
|
||||
<span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>
|
||||
{{if $item.star}}<span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>{{/if}}
|
||||
{{if $item.lock}}<span class="icon s22 lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
|
||||
<img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" />
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
|
||||
<div class="wall-item-decor">
|
||||
<span class="icon star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>
|
||||
{{if $item.star}}<span class="icon star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>{{/if}}
|
||||
{{if $item.lock}}<span class="icon lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
|
||||
<img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" />
|
||||
</div>
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
{{if $item.thread_level!=1}}<div class="children">{{/if}}
|
||||
|
||||
<div class="wall-item-decor">
|
||||
<!-- <span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span> -->
|
||||
<!-- {{if $item.lock}}<span class="icon s22 lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}} -->
|
||||
<img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" />
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user