]> git.mxchange.org Git - friendica.git/commitdiff
cleanup
authorFriendika <info@friendika.com>
Wed, 17 Aug 2011 03:05:02 +0000 (20:05 -0700)
committerFriendika <info@friendika.com>
Wed, 17 Aug 2011 03:05:02 +0000 (20:05 -0700)
boot.php
include/network.php
include/notifier.php
include/oembed.php
include/text.php
mod/display.php
mod/network.php
mod/profile.php
mod/register.php
mod/search.php
view/register.tpl

index 7186ce7c688adee4ee1e42e81aaf1774918826c2..39bb6a9dac875e4f77f3e36bb6cdd738e169a2ec 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -7,13 +7,13 @@ require_once('include/text.php');
 require_once("include/pgettext.php");
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1073' );
+define ( 'FRIENDIKA_VERSION',      '2.2.1074' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1079      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
-define ( 'DOWN_ARROW',             '&#x21e9;'       );
+
 
 /**
  *
index ddfc349778f03aa73ea0ef0ea54f7681f4a70e6e..9871b9edcdd3df59b3f7eb9ed9d4b8fc3c4d9d29 100644 (file)
@@ -5,7 +5,7 @@
 // results. 
 
 if(! function_exists('fetch_url')) {
-function fetch_url($url,$binary = false, &$redirects = 0) {
+function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0) {
 
        $a = get_app();
 
@@ -17,9 +17,13 @@ function fetch_url($url,$binary = false, &$redirects = 0) {
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
        curl_setopt($ch, CURLOPT_USERAGENT, "Friendika");
 
-       $curl_time = intval(get_config('system','curl_timeout'));
-       curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
-
+       if(intval($timeout)) {
+               curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
+       }
+       else {
+               $curl_time = intval(get_config('system','curl_timeout'));
+               curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
+       }
        // by default we will allow self-signed certs
        // but you can override this
 
@@ -66,7 +70,7 @@ function fetch_url($url,$binary = false, &$redirects = 0) {
         $url_parsed = @parse_url($url);
         if (isset($url_parsed)) {
             $redirects++;
-            return fetch_url($url,$binary,$redirects);
+            return fetch_url($url,$binary,$redirects,$timeout);
         }
     }
 
@@ -83,7 +87,7 @@ function fetch_url($url,$binary = false, &$redirects = 0) {
 // post request to $url. $params is an array of post variables.
 
 if(! function_exists('post_url')) {
-function post_url($url,$params, $headers = null, &$redirects = 0) {
+function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0) {
        $a = get_app();
        $ch = curl_init($url);
        if(($redirects > 8) || (! $ch)) 
@@ -95,8 +99,13 @@ function post_url($url,$params, $headers = null, &$redirects = 0) {
        curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
        curl_setopt($ch, CURLOPT_USERAGENT, "Friendika");
 
-       $curl_time = intval(get_config('system','curl_timeout'));
-       curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
+       if(intval($timeout)) {
+               curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
+       }
+       else {
+               $curl_time = intval(get_config('system','curl_timeout'));
+               curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
+       }
 
        if(defined('LIGHTTPD')) {
                if(!is_array($headers)) {
@@ -150,7 +159,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0) {
         $url_parsed = @parse_url($url);
         if (isset($url_parsed)) {
             $redirects++;
-            return post_url($url,$binary,$headers,$redirects);
+            return post_url($url,$params,$headers,$redirects,$timeout);
         }
     }
        $a->set_curl_code($http_code);
@@ -497,8 +506,9 @@ function fetch_lrdd_template($host) {
 if(! function_exists('fetch_xrd_links')) {
 function fetch_xrd_links($url) {
 
-
-       $xml = fetch_url($url);
+       $xrd_timeout = intval(get_config('system','xrd_timeout'));
+       $redirects = 0;
+       $xml = fetch_url($url,false,$redirects,(($xrd_timeout) ? $xrd_timeout : 30));
 
        logger('fetch_xrd_links: ' . $xml, LOGGER_DATA);
 
index 332cd19e36bee51117391b4f75f50d40d25c8c9c..b8aa07dc753287e82f65b51a1bbc283082be4b01 100644 (file)
@@ -557,7 +557,7 @@ function notifier_run($argv, $argc){
                 *
                 */
 
-               $max_allowed = ((get_config('system','maxpubdeliver') === false) ? 150 : intval(get_config('system','maxpubdeliver')));
+               $max_allowed = ((get_config('system','maxpubdeliver') === false) ? 999 : intval(get_config('system','maxpubdeliver')));
                                
                /**
                 *
@@ -567,7 +567,7 @@ function notifier_run($argv, $argc){
                 */
 
                $r = q("SELECT `id`, `name` FROM `contact` 
-                       WHERE `network` = 'dfrn' AND `uid` = %d AND `blocked` = 0 AND `pending` = 0
+                       WHERE `network` = NETWORK_DFRN AND `uid` = %d AND `blocked` = 0 AND `pending` = 0
                        AND `rel` != %d ",
                        intval($owner['uid']),
                        intval(CONTACT_IS_SHARING)
index b325a766e3142cf32265b3e1b9949e94bb7efabc..06f71a3b32f75e1d0868bf54fa7ebf9526765f7d 100644 (file)
@@ -17,7 +17,8 @@ function oembed_fetch_url($embedurl){
                $txt = "";
                
                // try oembed autodiscovery
-               $html_text = fetch_url($embedurl);
+               $redirects = 0;
+               $html_text = fetch_url($embedurl, false, $redirects, 15);
                if(! $html_text)
                        return;
                $dom = @DOMDocument::loadHTML($html_text);
index aeb20bb0f9f2db96bcdc313f459443872a24ef70..803bf0e510f5ae37c8a82dbde2e46480166cfa12 100644 (file)
@@ -948,3 +948,7 @@ function base64url_decode($s) {
 
        return base64_decode(strtr($s,'-_','+/'));
 }
+
+function cc_license() {
+return '<div class="cc-license">' . t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.') . '</div>';
+}
index 159ff57edfb8cef90d21b8c717860c86fe9458b3..52a84e755e1dd0802b5d8e578c6447c0185fe921 100644 (file)
@@ -114,7 +114,7 @@ function display_content(&$a) {
 
        }
 
-       $o .= '<div class="cc-license">' . t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.') . '</div>';
+       $o .= cc_license();
 
        return $o;
 }
index 7bdd3f3f1022d9d72e23218e53be440646554c8a..05b74b50a4252782c7a9c410ea97cdfae4c46bea 100644 (file)
@@ -297,9 +297,8 @@ function network_content(&$a, $update = 0) {
        $o .= conversation($a,$r,$mode,$update);
 
        if(! $update) {
-
                $o .= paginate($a);
-               $o .= '<div class="cc-license">' . t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.') . '</div>';
+               $o .= cc_license();
        }
 
        return $o;
index 71912458f1a976575247f95e041212e7def71c59..a4c6ea710726b8a1437300e02fae13b00ce073b4 100644 (file)
@@ -236,9 +236,8 @@ function profile_content(&$a, $update = 0) {
        $o .= conversation($a,$r,'profile',$update);
 
        if(! $update) {
-               
                $o .= paginate($a);
-               $o .= '<div class="cc-license">' . t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.') . '</div>';
+               $o .= cc_license();
        }
 
        return $o;
index fbd21a567f7e513f805810cdf9e4e56e6e7edb56..5fceebd4bd87c006e2e5afeb60f7cfdb5c3d1379 100644 (file)
@@ -501,7 +501,7 @@ function register_content(&$a) {
        }
 
 
-       $license = t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.');
+       $license = cc_license();
 
 
        $o = get_markup_template("register.tpl");
index 9b465c0e52b6315d479b20fdeffd6ae50c047603..88ff9bbb73d57db751f067f263cedb6fe317a6f9 100644 (file)
@@ -91,6 +91,7 @@ function search_content(&$a) {
        $o .= conversation($a,$r,'search',false);
 
        $o .= paginate($a);
+       $o .= cc_license();
 
        return $o;
 }
index 16e8ba76753c02c291374613018dee1d0419c6f4..8ce1d20acbae31def0f1364f1fbe3fd01ddc2561 100644 (file)
@@ -57,5 +57,6 @@
        <div id="register-submit-end" ></div>
 </form>
 
-<div class="cc-license">$license</div>
+$license
+