X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=b8b0dc05935c0a9980a95565d08395beba9480a8;hb=494288ab9f9370bdf4f7b4ab9990b64f05adbd9d;hp=7fe97a8759a119dbe216596cbc55be99a22fb578;hpb=323938144706584775794937abcb23179ee1a20b;p=friendica.git diff --git a/boot.php b/boot.php index 7fe97a8759..b8b0dc0593 100644 --- a/boot.php +++ b/boot.php @@ -4,9 +4,9 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.990' ); +define ( 'FRIENDIKA_VERSION', '2.2.1007' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); -define ( 'DB_UPDATE_VERSION', 1056 ); +define ( 'DB_UPDATE_VERSION', 1063 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -150,6 +150,7 @@ define ( 'ACTIVITY_OBJ_PERSON', NAMESPACE_ACTIVITY_SCHEMA . 'person' ); define ( 'ACTIVITY_OBJ_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'photo' ); define ( 'ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo' ); define ( 'ACTIVITY_OBJ_ALBUM', NAMESPACE_ACTIVITY_SCHEMA . 'photo-album' ); +define ( 'ACTIVITY_OBJ_EVENT', NAMESPACE_ACTIVITY_SCHEMA . 'event' ); /** * item weight for query ordering @@ -481,17 +482,26 @@ function check_config(&$a) { $stored = intval($build); $current = intval(DB_UPDATE_VERSION); if(($stored < $current) && file_exists('update.php')) { + // We're reporting a different version than what is currently installed. // Run any existing update scripts to bring the database up to current. require_once('update.php'); - for($x = $stored; $x < $current; $x ++) { - if(function_exists('update_' . $x)) { - $func = 'update_' . $x; - $func($a); + + // make sure that boot.php and update.php are the same release, we might be + // updating right this very second and the correct version of the update.php + // file may not be here yet. This can happen on a very busy site. + + if(DB_UPDATE_VERSION == UPDATE_VERSION) { + + for($x = $stored; $x < $current; $x ++) { + if(function_exists('update_' . $x)) { + $func = 'update_' . $x; + $func($a); + } } + set_config('system','build', DB_UPDATE_VERSION); } - set_config('system','build', DB_UPDATE_VERSION); } } @@ -682,7 +692,7 @@ function fetch_url($url,$binary = false, &$redirects = 0) { $s = substr($s,strlen($header)+4); $header = substr($s,0,strpos($s,"\r\n\r\n")); } - if($http_code == 301 || $http_code == 302 || $http_code == 303) { + if($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307) { $matches = array(); preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches); $url = trim(array_pop($matches)); @@ -1983,15 +1993,15 @@ function get_tags($s) { $s = preg_replace('/\[code\](.*?)\[\/code\]/sm','',$s); if(preg_match_all('/([@#][^ \x0D\x0A,:?]+)([ \x0D\x0A,:?]|$)/',$s,$match)) { - foreach($match[1] as $match) { - if(strstr($match,"]")) { + foreach($match[1] as $mtch) { + if(strstr($mtch,"]")) { // we might be inside a bbcode color tag - leave it alone continue; } - if(substr($match,-1,1) === '.') - $ret[] = substr($match,0,-1); + if(substr($mtch,-1,1) === '.') + $ret[] = substr($mtch,0,-1); else - $ret[] = $match; + $ret[] = $mtch; } } @@ -2106,10 +2116,10 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { if(! function_exists('search')) { -function search($s) { +function search($s,$id='search-box',$url='/search') { $a = get_app(); - $o = '