From: Michael Vogel Date: Sun, 20 Jan 2013 13:07:57 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4e3d0018c69eaaa122f004357c5c68dacef59fc7;hp=-c;p=friendica.git Merge remote-tracking branch 'upstream/master' Conflicts: boot.php include/items.php update.php --- 4e3d0018c69eaaa122f004357c5c68dacef59fc7 diff --combined boot.php index 6864e533d8,015dfb55e8..cd7fa03b59 --- a/boot.php +++ b/boot.php @@@ -12,10 -12,10 +12,9 @@@ require_once('library/Mobile_Detect/Mob require_once('include/features.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); - define ( 'FRIENDICA_VERSION', '3.1.1572' ); + define ( 'FRIENDICA_VERSION', '3.1.1589' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1158 ); - +define ( 'DB_UPDATE_VERSION', 1159 ); - define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@@ -204,11 -204,10 +203,11 @@@ define ( 'NOTIFY_SYSTEM', 0x8000 ) define ( 'TERM_UNKNOWN', 0 ); define ( 'TERM_HASHTAG', 1 ); -define ( 'TERM_MENTION', 2 ); +define ( 'TERM_MENTION', 2 ); define ( 'TERM_CATEGORY', 3 ); define ( 'TERM_PCATEGORY', 4 ); define ( 'TERM_FILE', 5 ); +define ( 'TERM_SAVEDSEARCH', 6 ); define ( 'TERM_OBJ_POST', 1 ); define ( 'TERM_OBJ_PHOTO', 2 ); @@@ -385,8 -384,14 +384,14 @@@ if(! class_exists('App')) 'template_engine' => 'internal', ); - public $smarty3_ldelim = '{{'; - public $smarty3_rdelim = '}}'; + private $ldelim = array( + 'internal' => '', + 'smarty3' => '{{' + ); + private $rdelim = array( + 'internal' => '', + 'smarty3' => '}}' + ); private $scheme; private $hostname; @@@ -617,17 -622,17 +622,17 @@@ */ if(!isset($this->page['htmlhead'])) $this->page['htmlhead'] = ''; - $tpl = get_markup_template('head.tpl'); // If we're using Smarty, then doing replace_macros() will replace // any unrecognized variables with a blank string. Since we delay // replacing $stylesheet until later, we need to replace it now // with another variable name if($this->theme['template_engine'] === 'smarty3') - $stylesheet = $this->smarty3_ldelim . '$stylesheet' . $this->smarty3_rdelim; + $stylesheet = $this->get_template_ldelim('smarty3') . '$stylesheet' . $this->get_template_rdelim('smarty3'); else $stylesheet = '$stylesheet'; + $tpl = get_markup_template('head.tpl'); $this->page['htmlhead'] = replace_macros($tpl,array( '$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!! '$local_user' => local_user(), @@@ -688,6 -693,31 +693,31 @@@ return $this->cached_profile_image[$avatar_image]; } + function get_template_engine() { + return $this->theme['template_engine']; + } + + function set_template_engine($engine = 'internal') { + + $this->theme['template_engine'] = 'internal'; + + switch($engine) { + case 'smarty3': + if(is_writable('view/smarty3/')) + $this->theme['template_engine'] = 'smarty3'; + break; + default: + break; + } + } + + function get_template_ldelim($engine = 'internal') { + return $this->ldelim[$engine]; + } + + function get_template_rdelim($engine = 'internal') { + return $this->rdelim[$engine]; + } } } @@@ -776,16 -806,12 +806,12 @@@ function is_ajax() // Primarily involved with database upgrade, but also sets the // base url for use in cmdline programs which don't have - // $_SERVER variables, and synchronising the state of installed plugins. + // $_SERVER variables if(! function_exists('check_config')) { function check_config(&$a) { - $build = get_config('system','build'); - if(! x($build)) - $build = set_config('system','build',DB_UPDATE_VERSION); - $url = get_config('system','url'); // if the url isn't set or the stored url is radically different @@@ -800,6 -826,10 +826,10 @@@ $url = set_config('system','url',$a->get_baseurl()); + $build = get_config('system','build'); + if(! x($build)) + $build = set_config('system','build',DB_UPDATE_VERSION); + if($build != DB_UPDATE_VERSION) { $stored = intval($build); $current = intval(DB_UPDATE_VERSION); @@@ -848,9 -878,10 +878,10 @@@ '$error' => sprintf( t('Update %s failed. See error logs.'), $x) )); $subject=sprintf(t('Update Error at %s'), $a->get_baseurl()); - + require_once('include/email.php'); + $subject = email_header_encode($subject,'UTF-8'); mail($a->config['admin_email'], $subject, $email_msg, - 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + 'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'Content-transfer-encoding: 8bit' ); //try the logger @@@ -867,6 -898,14 +898,14 @@@ } } + return; + } + } + + + if(! function_exists('check_plugins')) { + function check_plugins(&$a) { + /** * * Synchronise plugins: @@@ -1108,6 -1147,10 +1147,10 @@@ if(! function_exists('get_max_import_si * Profile information is placed in the App structure for later retrieval. * Honours the owner's chosen theme for display. * + * IMPORTANT: Should only be run in the _init() functions of a module. That ensures that + * the theme is chosen before the _init() function of a theme is run, which will usually + * load a lot of theme-specific content + * */ if(! function_exists('profile_load')) { @@@ -1167,7 -1210,7 +1210,7 @@@ if(! $r[0]['is-default']) { $x = q("select `pub_keywords` from `profile` where uid = %d and `is-default` = 1 limit 1", - intval($profile_uid) + intval($r[0]['profile_uid']) ); if($x && count($x)) $r[0]['pub_keywords'] = $x[0]['pub_keywords']; @@@ -1175,7 -1218,7 +1218,7 @@@ $a->profile = $r[0]; - $a->profile['mobile-theme'] = get_pconfig($profile_uid, 'system', 'mobile_theme'); + $a->profile['mobile-theme'] = get_pconfig($a->profile['profile_uid'], 'system', 'mobile_theme'); $a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename']; @@@ -1186,6 -1229,8 +1229,8 @@@ * load/reload current theme info */ + $a->set_template_engine(); // reset the template engine to the default in case the user's theme doesn't specify one + $theme_info_file = "view/theme/".current_theme()."/theme.php"; if (file_exists($theme_info_file)){ require_once($theme_info_file); @@@ -1344,8 -1389,6 +1389,6 @@@ if(! function_exists('profile_sidebar') } - $tpl = get_markup_template('profile_vcard.tpl'); - $p = array(); foreach($profile as $k => $v) { $k = str_replace('-','_',$k); @@@ -1355,6 -1398,7 +1398,7 @@@ if($a->theme['template_engine'] === 'internal') $location = template_escape($location); + $tpl = get_markup_template('profile_vcard.tpl'); $o .= replace_macros($tpl, array( '$profile' => $p, '$connect' => $connect, @@@ -1612,7 -1656,7 +1656,7 @@@ if(! function_exists('current_theme')) // $mobile_detect = new Mobile_Detect(); // $is_mobile = $mobile_detect->isMobile() || $mobile_detect->isTablet(); $is_mobile = $a->is_mobile || $a->is_tablet; - + if($is_mobile) { if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) { $system_theme = ''; @@@ -1947,16 -1991,9 +1991,9 @@@ function clear_cache($basepath = "", $p } function set_template_engine(&$a, $engine = 'internal') { + // This function is no longer necessary, but keep it as a wrapper to the class method + // to avoid breaking themes again unnecessarily - $a->theme['template_engine'] = 'internal'; - - if(is_writable('view/smarty3/')) { - switch($engine) { - case 'smarty3': - $a->theme['template_engine'] = 'smarty3'; - break; - default: - break; - } - } + $a->set_template_engine($engine); } + diff --combined database.sql index 99d60429ae,28a7c931e7..cf060ebf49 --- a/database.sql +++ b/database.sql @@@ -241,6 -241,20 +241,20 @@@ CREATE TABLE IF NOT EXISTS `deliverq` -- -------------------------------------------------------- + -- + -- Table structure for table `dsprphotoq` + -- + + CREATE TABLE `dsprphotoq` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `uid` int(11) NOT NULL, + `msg` mediumtext NOT NULL, + `attempt` tinyint(4) NOT NULL, + PRIMARY KEY (`id`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + -- -------------------------------------------------------- + -- -- Table structure for table `event` -- @@@ -546,7 -560,6 +560,7 @@@ CREATE TABLE IF NOT EXISTS `item` `deleted` tinyint(1) NOT NULL DEFAULT '0', `origin` tinyint(1) NOT NULL DEFAULT '0', `forum_mode` tinyint(1) NOT NULL DEFAULT '0', + `mention` tinyint(1) NOT NULL DEFAULT '0', `last-child` tinyint(1) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `uri` (`uri`), @@@ -576,7 -589,6 +590,7 @@@ KEY `uid_commented` (`uid`, `commented`), KEY `uid_created` (`uid`, `created`), KEY `uid_unseen` (`uid`, `unseen`), + KEY `mention` (`mention`), FULLTEXT KEY `title` (`title`), FULLTEXT KEY `body` (`body`), FULLTEXT KEY `allow_cid` (`allow_cid`), @@@ -1017,22 -1029,18 +1031,22 @@@ CREATE TABLE IF NOT EXISTS `spam` -- CREATE TABLE IF NOT EXISTS `term` ( - `tid` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `oid` INT UNSIGNED NOT NULL , - `otype` TINYINT( 3 ) UNSIGNED NOT NULL , - `type` TINYINT( 3 ) UNSIGNED NOT NULL , - `term` CHAR( 255 ) NOT NULL , - `url` CHAR( 255 ) NOT NULL, + `tid` int(10) unsigned NOT NULL AUTO_INCREMENT, + `aid` int(10) unsigned NOT NULL DEFAULT '0', + `uid` int(10) unsigned NOT NULL DEFAULT '0', + `oid` int(10) unsigned NOT NULL, + `otype` tinyint(3) unsigned NOT NULL, + `type` tinyint(3) unsigned NOT NULL, + `term` char(255) NOT NULL, + `url` char(255) NOT NULL, PRIMARY KEY (`tid`), - KEY `oid` ( `oid` ), - KEY `otype` ( `otype` ), - KEY `type` ( `type` ), - KEY `term` ( `term` ) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; + KEY `oid` (`oid`), + KEY `otype` (`otype`), + KEY `type` (`type`), + KEY `term` (`term`), + KEY `uid` (`uid`), + KEY `aid` (`aid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@@ -1124,17 -1132,3 +1138,17 @@@ CREATE TABLE IF NOT EXISTS `userd` `username` char(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tag` +-- + +CREATE TABLE IF NOT EXISTS `tag` ( + `iid` int(11) NOT NULL, + `tag` char(255) NOT NULL, + `link` char(255) NOT NULL, + PRIMARY KEY (`iid`, `tag`), + KEY `tag` (`tag`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --combined include/bbcode.php index a7cfa079d1,228b75d5ab..613c2b7db0 --- a/include/bbcode.php +++ b/include/bbcode.php @@@ -254,12 -254,22 +254,22 @@@ function bb_ShareAttributes($match) if ($matches[1] != "") $profile = $matches[1]; + $posted = ""; + preg_match("/posted='(.*?)'/ism", $attributes, $matches); + if ($matches[1] != "") + $posted = $matches[1]; + + preg_match('/posted="(.*?)"/ism', $attributes, $matches); + if ($matches[1] != "") + $posted = $matches[1]; + $reldate = (($posted) ? " " . relative_date($posted) : ''); + $headline = '
'; if ($avatar != "") $headline .= ''; - $headline .= sprintf(t('%s wrote the following post:'), $profile, $author, $link); + $headline .= sprintf(t('%s wrote the following post'.$reldate.':'), $profile, $author, $link); $headline .= "
"; @@@ -312,6 -322,9 +322,9 @@@ function bbcode($Text,$preserve_nl = fa $Text = preg_replace("/\s?\[share(.*?)\]\s?(.*?)\s?\[\/share\]\s?/ism","[share$1]$2[/share]",$Text); $Text = preg_replace("/\s?\[quote(.*?)\]\s?(.*?)\s?\[\/quote\]\s?/ism","[quote$1]$2[/quote]",$Text); + $Text = preg_replace("/\n\[code\]/ism", "[code]", $Text); + $Text = preg_replace("/\[\/code\]\n/ism", "[/code]", $Text); + // when the content is meant exporting to other systems then remove the avatar picture since this doesn't really look good on these systems if (!$tryoembed) $Text = preg_replace("/\[share(.*?)avatar\s?=\s?'.*?'\s?(.*?)\]\s?(.*?)\s?\[\/share\]\s?/ism","\n[share$1$2]$3[/share]",$Text); @@@ -327,12 -340,13 +340,13 @@@ $Text = str_replace("\r\n","\n", $Text); // removing multiplicated newlines - $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]"); - $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]"); - do { - $oldtext = $Text; - $Text = str_replace($search, $replace, $Text); - } while ($oldtext != $Text); + // $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]"); + // $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]"); + // do { + // $oldtext = $Text; + // $Text = str_replace($search, $replace, $Text); + // } while ($oldtext != $Text); + $Text = str_replace(array("\r","\n"), array('
','
'), $Text); @@@ -603,8 -617,7 +617,8 @@@ // Clean up the HTML by loading and saving the HTML with the DOM // Only do it when it has to be done - for performance reasons - if (!$tryoembed) { + // Update: Now it is done every time - since bad structured html can break a whole page + //if (!$tryoembed) { $doc = new DOMDocument(); $doc->preserveWhiteSpace = false; @@@ -619,7 -632,7 +633,7 @@@ $Text = str_replace('
','', $Text); $Text = mb_convert_encoding($Text, "UTF-8", 'HTML-ENTITIES'); - } + //} call_hooks('bbcode',$Text); diff --combined include/conversation.php index 7c4e606a72,e659ca04d9..cc66d380b7 --- a/include/conversation.php +++ b/include/conversation.php @@@ -523,26 -523,7 +523,26 @@@ function conversation(&$a, $items, $mod $tags=array(); $hashtags = array(); $mentions = array(); - foreach(explode(',',$item['tag']) as $tag){ + + $taglist = q("SELECT `type`, `term`, `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` IN (%d, %d) ORDER BY `tid`", + intval(TERM_OBJ_POST), intval($item['id']), intval(TERM_HASHTAG), intval(TERM_MENTION)); + + foreach($taglist as $tag) { + + if ($tag["url"] == "") + $tag["url"] = $searchpath.strtolower($tag["term"]); + + if ($tag["type"] == TERM_HASHTAG) { + $hashtags[] = "#".$tag["term"].""; + $prefix = "#"; + } elseif ($tag["type"] == TERM_MENTION) { + $mentions[] = "@".$tag["term"].""; + $prefix = "@"; + } + $tags[] = $prefix."".$tag["term"].""; + } + + /*foreach(explode(',',$item['tag']) as $tag){ $tag = trim($tag); if ($tag!="") { $t = bbcode($tag); @@@ -552,7 -533,7 +552,7 @@@ elseif($t[0] == '@') $mentions[] = $t; } - } + }*/ $sp = false; $profile_link = best_link_url($item,$sp); @@@ -896,26 -877,21 +896,21 @@@ function format_like($cnt,$arr,$type,$i if($cnt == 1) $o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ; else { - //$spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"'; + $spanatts = "class=\"fakelink\" onclick=\"openClose('{$type}list-$id');\""; switch($type) { case 'like': - // $phrase = sprintf( t('%2$d people like this.'), $spanatts, $cnt); - $mood = t('like this'); + $phrase = sprintf( t('%2$d people like this'), $spanatts, $cnt); break; case 'dislike': - // $phrase = sprintf( t('%2$d people don\'t like this.'), $spanatts, $cnt); - $mood = t('don\'t like this'); + $phrase = sprintf( t('%2$d people don\'t like this'), $spanatts, $cnt); break; } - $tpl = get_markup_template("voting_fakelink.tpl"); - $phrase = replace_macros($tpl, array( - '$vote_id' => $type . 'list-' . $id, - '$count' => $cnt, - '$people' => t('people'), - '$vote_mood' => $mood + $phrase .= EOL ; + $o .= replace_macros(get_markup_template('voting_fakelink.tpl'), array( + '$phrase' => $phrase, + '$type' => $type, + '$id' => $id )); - $o .= $phrase; - // $o .= EOL ; $total = count($arr); if($total >= MAX_LIKERS) diff --combined include/items.php index 3779126840,08127c6eb6..54b392b386 --- a/include/items.php +++ b/include/items.php @@@ -5,8 -5,7 +5,9 @@@ require_once('include/oembed.php') require_once('include/salmon.php'); require_once('include/crypto.php'); require_once('include/Photo.php'); +require_once('include/tags.php'); +require_once('include/text.php'); + require_once('include/email.php'); function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) { @@@ -27,7 -26,7 +28,7 @@@ } } - + // default permissions - anonymous user @@@ -239,7 -238,7 +240,7 @@@ function construct_activity_object($ite $r->link = str_replace('&','&', $r->link); $r->link = preg_replace('/\/','',$r->link); $o .= $r->link; - } + } else $o .= '' . "\r\n"; } @@@ -271,7 -270,7 +272,7 @@@ function construct_activity_target($ite $r->link = str_replace('&','&', $r->link); $r->link = preg_replace('/\/','',$r->link); $o .= $r->link; - } + } else $o .= '' . "\r\n"; } @@@ -671,7 -670,7 +672,7 @@@ function get_atom_elements($feed,$item } // translate OStatus unfollow to activity streams if it happened to get selected - + if((x($res,'verb')) && ($res['verb'] === 'http://ostatus.org/schema/1.0/unfollow')) $res['verb'] = ACTIVITY_UNFOLLOW; @@@ -722,7 -721,7 +723,7 @@@ if($child[NAMESPACE_ACTIVITY]['object-type'][0]['data']) { $res['object-type'] = $child[NAMESPACE_ACTIVITY]['object-type'][0]['data']; $res['object'] .= '' . $child[NAMESPACE_ACTIVITY]['object-type'][0]['data'] . '' . "\n"; - } + } if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'id') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data']) $res['object'] .= '' . $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'] . '' . "\n"; if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'link') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['link']) @@@ -760,7 -759,7 +761,7 @@@ $child = $rawobj[0]['child']; if($child[NAMESPACE_ACTIVITY]['object-type'][0]['data']) { $res['target'] .= '' . $child[NAMESPACE_ACTIVITY]['object-type'][0]['data'] . '' . "\n"; - } + } if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'id') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data']) $res['target'] .= '' . $child[SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'] . '' . "\n"; if(x($child[SIMPLEPIE_NAMESPACE_ATOM_10], 'link') && $child[SIMPLEPIE_NAMESPACE_ATOM_10]['link']) @@@ -883,7 -882,7 +884,7 @@@ function item_store($arr,$force_parent $arr['gravity'] = 0; elseif(activity_match($arr['verb'],ACTIVITY_POST)) $arr['gravity'] = 6; - else + else $arr['gravity'] = 6; // extensible catchall if(! x($arr,'type')) @@@ -899,23 -898,8 +900,23 @@@ require_once('library/langdet/Text/LanguageDetect.php'); $naked_body = preg_replace('/\[(.+?)\]/','',$arr['body']); $l = new Text_LanguageDetect; - $lng = $l->detectConfidence($naked_body); - $arr['postopts'] = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : ''); + //$lng = $l->detectConfidence($naked_body); + //$arr['postopts'] = (($lng['language']) ? 'lang=' . $lng['language'] . ';' . $lng['confidence'] : ''); + $lng = $l->detect($naked_body, 3); + + if (sizeof($lng) > 0) { + $postopts = ""; + + foreach ($lng as $language => $score) { + if ($postopts == "") + $postopts = "lang="; + else + $postopts .= ":"; + + $postopts .= $language.";".$score; + } + $arr['postopts'] = $postopts; + } } $arr['wall'] = ((x($arr,'wall')) ? intval($arr['wall']) : 0); @@@ -1033,7 -1017,7 +1034,7 @@@ logger('item_store: item parent was not found - ignoring item'); return 0; } - + $parent_deleted = 0; } } @@@ -1074,8 -1058,8 +1075,8 @@@ if(count($r)) { $current_post = $r[0]['id']; logger('item_store: created item ' . $current_post); - } - else { + create_tags_from_item($r[0]['id']); + } else { logger('item_store: could not locate created item'); return 0; } @@@ -1088,7 -1072,7 +1089,7 @@@ ); } - if((! $parent_id) || ($arr['parent-uri'] === $arr['uri'])) + if((! $parent_id) || ($arr['parent-uri'] === $arr['uri'])) $parent_id = $current_post; if(strlen($allow_cid) || strlen($allow_gid) || strlen($deny_cid) || strlen($deny_gid)) @@@ -1109,7 -1093,6 +1110,7 @@@ intval($parent_deleted), intval($current_post) ); + create_tags_from_item($current_post); $arr['id'] = $current_post; $arr['parent'] = $parent_id; @@@ -1153,15 -1136,6 +1154,15 @@@ tag_deliver($arr['uid'],$current_post); + // Store the fresh generated item into the cache + $cachefile = get_cachefile($arr["guid"]."-".hash("md5", $arr['body'])); + + if (($cachefile != '') AND !file_exists($cachefile)) { + $s = prepare_text($arr['body']); + file_put_contents($cachefile, $s); + logger('item_store: put item '.$current_post.' into cachefile '.$cachefile); + } + return $current_post; } @@@ -1298,7 -1272,7 +1299,7 @@@ function tag_deliver($uid,$item_id) intval($item_id) ); - proc_run('php','include/notifier.php','tgroup',$item_id); + proc_run('php','include/notifier.php','tgroup',$item_id); } @@@ -1369,7 -1343,7 +1370,7 @@@ function dfrn_deliver($owner,$contact,$ if($contact['duplex'] && $contact['dfrn-id']) $idtosend = '0:' . $orig_id; if($contact['duplex'] && $contact['issued-id']) - $idtosend = '1:' . $orig_id; + $idtosend = '1:' . $orig_id; $rino = ((function_exists('mcrypt_encrypt')) ? 1 : 0); @@@ -1387,7 -1361,7 +1388,7 @@@ break; case SSL_POLICY_SELFSIGN: $ssl_policy = 'self'; - break; + break; case SSL_POLICY_NONE: default: $ssl_policy = 'none'; @@@ -1440,7 -1414,7 +1441,7 @@@ intval(($perm == 'rw') ? 1 : 0), intval($contact['id']) ); - $contact['writable'] = (string) 1 - intval($contact['writable']); + $contact['writable'] = (string) 1 - intval($contact['writable']); } } @@@ -1584,7 -1558,7 +1585,7 @@@ function consume_feed($xml,$importer,&$ logger('consume_feed: empty input'); return; } - + $feed = new SimplePie(); $feed->set_raw_data($xml); if($datedir) @@@ -1620,7 -1594,7 +1621,7 @@@ if($elems['name'][0]['attribs'][NAMESPACE_DFRN]['updated']) { $name_updated = $elems['name'][0]['attribs'][NAMESPACE_DFRN]['updated']; $new_name = $elems['name'][0]['data']; - } + } if((x($elems,'link')) && ($elems['link'][0]['attribs']['']['rel'] === 'photo') && ($elems['link'][0]['attribs'][NAMESPACE_DFRN]['updated'])) { $photo_timestamp = datetime_convert('UTC','UTC',$elems['link'][0]['attribs'][NAMESPACE_DFRN]['updated']); $photo_url = $elems['link'][0]['attribs']['']['href']; @@@ -1663,12 -1637,12 +1664,12 @@@ intval($contact['uid']) ); } - + $img->scaleImageSquare(175); - + $hash = $resource_id; $r = $img->store($contact['uid'], $contact['id'], $hash, basename($photo_url), 'Contact Photos', 4); - + $img->scaleImage(80); $r = $img->store($contact['uid'], $contact['id'], $hash, basename($photo_url), 'Contact Photos', 5); @@@ -1677,7 -1651,7 +1678,7 @@@ $a = get_app(); - q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s' + q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1", dbesc(datetime_convert()), dbesc($a->get_baseurl() . '/photo/' . $hash . '-4.'.$img->getExt()), @@@ -1727,7 -1701,7 +1728,7 @@@ * to contain a sparkle link and perhaps a photo. * */ - + $bdtext = sprintf( t('%s\'s birthday'), $contact['name']); $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' ) ; @@@ -1744,7 -1718,7 +1745,7 @@@ dbesc($bdtext2), dbesc('birthday') ); - + // update bdyear @@@ -1836,7 -1810,6 +1837,7 @@@ dbesc(implode(',',$newtags)), intval($i[0]['id']) ); + create_tags_from_item($i[0]['id']); } } } @@@ -1851,7 -1824,6 +1852,7 @@@ dbesc($item['uri']), intval($importer['uid']) ); + create_tags_from_itemuri($item['uri'], $importer['uid']); } else { $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', @@@ -1862,7 -1834,6 +1863,7 @@@ dbesc($uri), intval($importer['uid']) ); + create_tags_from_itemuri($uri, $importer['uid']); if($item['last-child']) { // ensure that last-child is set in case the comment that had it just got wiped. q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d ", @@@ -1976,7 -1947,6 +1977,7 @@@ dbesc($item_id), intval($importer['uid']) ); + create_tags_from_itemuri($item_id, $importer['uid']); } // update last-child if it changes @@@ -2018,7 -1988,7 +2019,7 @@@ dbesc($parent_uri) ); if($r && count($r)) - continue; + continue; } if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) { @@@ -2041,7 -2011,6 +2042,7 @@@ dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . $newtag), intval($r[0]['id']) ); + create_tags_from_item($r[0]['id']); } } } @@@ -2125,7 -2094,6 +2126,7 @@@ dbesc($item_id), intval($importer['uid']) ); + create_tags_from_itemuri($item_id, $importer['uid']); } // update last-child if it changes @@@ -2263,7 -2231,7 +2264,7 @@@ function local_delivery($importer,$data if($elems['name'][0]['attribs'][NAMESPACE_DFRN]['updated']) { $name_updated = $elems['name'][0]['attribs'][NAMESPACE_DFRN]['updated']; $new_name = $elems['name'][0]['data']; - } + } if((x($elems,'link')) && ($elems['link'][0]['attribs']['']['rel'] === 'photo') && ($elems['link'][0]['attribs'][NAMESPACE_DFRN]['updated'])) { $photo_timestamp = datetime_convert('UTC','UTC',$elems['link'][0]['attribs'][NAMESPACE_DFRN]['updated']); $photo_url = $elems['link'][0]['attribs']['']['href']; @@@ -2302,12 -2270,12 +2303,12 @@@ intval($importer['importer_uid']) ); } - + $img->scaleImageSquare(175); - + $hash = $resource_id; $r = $img->store($importer['importer_uid'], $importer['id'], $hash, basename($photo_url), 'Contact Photos', 4); - + $img->scaleImage(80); $r = $img->store($importer['importer_uid'], $importer['id'], $hash, basename($photo_url), 'Contact Photos', 5); @@@ -2316,7 -2284,7 +2317,7 @@@ $a = get_app(); - q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s' + q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1", dbesc(datetime_convert()), dbesc($a->get_baseurl() . '/photo/' . $hash . '-4.'.$img->getExt()), @@@ -2375,17 -2343,17 +2376,17 @@@ /** relocated user must have original key pair */ /*$newloc['pubkey'] = notags(unxmlify($base['pubkey'][0]['data'])); $newloc['prvkey'] = notags(unxmlify($base['prvkey'][0]['data']));*/ - + logger("items:relocate contact ".print_r($newloc, true).print_r($importer, true), LOGGER_DEBUG); - + // update contact $r = q("SELECT photo, url FROM contact WHERE id=%d AND uid=%d;", intval($importer['id']), intval($importer['importer_uid'])); - if ($r === false) + if ($r === false) return 1; $old = $r[0]; - + $x = q("UPDATE contact SET name = '%s', photo = '%s', @@@ -2428,7 -2396,7 +2429,7 @@@ if ($x === false) return 1; } - + // TODO // merge with current record, current contents have priority // update record, set url-updated @@@ -2502,7 -2470,7 +2503,7 @@@ $hash = random_string(); - + $r = q("INSERT INTO `intro` ( `uid`, `fid`, `contact-id`, `note`, `hash`, `datetime`, `blocked` ) VALUES( %d, %d, %d, '%s', '%s', '%s', %d )", intval($fsugg['uid']), @@@ -2556,7 -2524,7 +2557,7 @@@ $msg['uri'] = notags(unxmlify($base['id'][0]['data'])); $msg['parent-uri'] = notags(unxmlify($base['in-reply-to'][0]['data'])); $msg['created'] = datetime_convert(notags(unxmlify('UTC','UTC',$base['sentdate'][0]['data']))); - + dbesc_array($msg); $r = dbq("INSERT INTO `mail` (`" . implode("`, `", array_keys($msg)) @@@ -2580,12 -2548,12 +2581,12 @@@ 'verb' => ACTIVITY_POST, 'otype' => 'mail' ); - + notification($notif_params); return 0; // NOTREACHED - } + } $community_page = 0; $rawtags = $feed->get_feed_tags( NAMESPACE_DFRN, 'community'); @@@ -2599,7 -2567,7 +2600,7 @@@ ); $importer['forum'] = (string) $community_page; } - + logger('local_delivery: feed item count = ' . $feed->get_item_quantity()); // process any deleted entries @@@ -2709,14 -2677,14 +2710,14 @@@ if(count($i)) { // For tags, the owner cannot remove the tag on the author's copy of the post. - + $owner_remove = (($item['contact-id'] == $i[0]['contact-id']) ? true: false); $author_remove = (($item['origin'] && $item['self']) ? true : false); - $author_copy = (($item['origin']) ? true : false); + $author_copy = (($item['origin']) ? true : false); if($owner_remove && $author_copy) continue; - if($author_remove || $owner_remove) { + if($author_remove || $owner_remove) { $tags = explode(',',$i[0]['tag']); $newtags = array(); if(count($tags)) { @@@ -2728,7 -2696,6 +2729,7 @@@ dbesc(implode(',',$newtags)), intval($i[0]['id']) ); + create_tags_from_item($i[0]['id']); } } } @@@ -2743,7 -2710,6 +2744,7 @@@ dbesc($item['uri']), intval($importer['importer_uid']) ); + create_tags_from_itemuri($item['uri'], $importer['importer_uid']); } else { $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', @@@ -2754,7 -2720,6 +2755,7 @@@ dbesc($uri), intval($importer['importer_uid']) ); + create_tags_from_itemuri($uri, $importer['importer_uid']); if($item['last-child']) { // ensure that last-child is set in case the comment that had it just got wiped. q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d ", @@@ -2762,7 -2727,7 +2763,7 @@@ dbesc($item['parent-uri']), intval($item['uid']) ); - // who is the last child now? + // who is the last child now? $r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 AND `uid` = %d ORDER BY `created` DESC LIMIT 1", dbesc($item['parent-uri']), @@@ -2772,7 -2737,7 +2773,7 @@@ q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d LIMIT 1", intval($r[0]['id']) ); - } + } } // if this is a relayed delete, propagate it to other recipients @@@ -2866,11 -2831,11 +2867,11 @@@ if(count($r)) { $iid = $r[0]['id']; if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) { - + // do not accept (ignore) an earlier edit than one we currently have. if(datetime_convert('UTC','UTC',$datarray['edited']) < $r[0]['edited']) continue; - + logger('received updated comment' , LOGGER_DEBUG); $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($datarray['title']), @@@ -2880,7 -2845,6 +2881,7 @@@ dbesc($item_id), intval($importer['importer_uid']) ); + create_tags_from_itemuri($item_id, $importer['importer_uid']); proc_run('php',"include/notifier.php","comment-import",$iid); @@@ -2917,14 -2881,14 +2918,14 @@@ dbesc($datarray['verb']), dbesc($datarray['parent-uri']), dbesc($datarray['parent-uri']) - + ); if($r && count($r)) - continue; + continue; } if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) { - + $xo = parse_xml_string($datarray['object'],false); $xt = parse_xml_string($datarray['target'],false); @@@ -2937,9 -2901,9 +2938,9 @@@ intval($importer['importer_uid']) ); if(! count($tagp)) - continue; + continue; - // extract tag, if not duplicate, and this user allows tags, add to parent item + // extract tag, if not duplicate, and this user allows tags, add to parent item if($xo->id && $xo->content) { $newtag = '#[url=' . $xo->id . ']'. $xo->content . '[/url]'; @@@ -2953,10 -2917,9 +2954,10 @@@ intval($tagp[0]['id']), dbesc(datetime_convert()) ); + create_tags_from_item($tagp[0]['id']); } } - } + } } } @@@ -2973,7 -2936,7 +2974,7 @@@ $parent = $r[0]['parent']; $parent_uri = $r[0]['parent-uri']; } - + if(! $is_like) { $r1 = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `uid` = %d AND `parent` = %d", dbesc(datetime_convert()), @@@ -2991,7 -2954,7 +2992,7 @@@ if($posted_id && $parent) { proc_run('php',"include/notifier.php","comment-import","$posted_id"); - + if((! $is_like) && (! $importer['self'])) { require_once('include/enotify.php'); @@@ -3054,7 -3017,6 +3055,7 @@@ dbesc($item_id), intval($importer['importer_uid']) ); + create_tags_from_itemuri($item_id, $importer['importer_uid']); } // update last-child if it changes @@@ -3091,7 -3053,7 +3092,7 @@@ dbesc($parent_uri) ); if($r && count($r)) - continue; + continue; } @@@ -3106,25 -3068,24 +3107,25 @@@ intval($importer['importer_uid']) ); if(! count($r)) - continue; + continue; - // extract tag, if not duplicate, add to parent item + // extract tag, if not duplicate, add to parent item if($xo->content) { if(! (stristr($r[0]['tag'],trim($xo->content)))) { q("UPDATE item SET tag = '%s' WHERE id = %d LIMIT 1", dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . $xo->id . ']'. $xo->content . '[/url]'), intval($r[0]['id']) ); + create_tags_from_item($r[0]['id']); } - } + } } } $posted_id = item_store($datarray); // find out if our user is involved in this conversation and wants to be notified. - + if(!x($datarray['type']) || $datarray['type'] != 'activity') { $myconv = q("SELECT `author-link`, `author-avatar`, `parent` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `parent` != 0 AND `deleted` = 0", @@@ -3138,11 -3099,11 +3139,11 @@@ // first make sure this isn't our own post coming back to us from a wall-to-wall event if(! link_compare($datarray['author-link'],$importer_url)) { - + foreach($myconv as $conv) { // now if we find a match, it means we're in this conversation - + if(! link_compare($conv['author-link'],$importer_url)) continue; @@@ -3230,7 -3191,6 +3231,7 @@@ dbesc($item_id), intval($importer['importer_uid']) ); + create_tags_from_itemuri($item_id, $importer['importer_uid']); } // update last-child if it changes @@@ -3354,7 -3314,7 +3355,7 @@@ function new_follower($importer,$contac // send email notification to owner? } else { - + // create contact record $r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `name`, `nick`, `photo`, `network`, `rel`, @@@ -3377,7 -3337,7 +3378,7 @@@ if(count($r)) $contact_record = $r[0]; - // create notification + // create notification $hash = random_string(); if(is_array($contact_record)) { @@@ -3410,12 -3370,12 +3411,12 @@@ '$sitename' => $a->config['sitename'] )); $res = mail($r[0]['email'], - (($sharing) ? t('A new person is sharing with you at ') : t("You have a new follower at ")) . $a->config['sitename'], + email_header_encode((($sharing) ? t('A new person is sharing with you at ') : t("You have a new follower at ")) . $a->config['sitename'],'UTF-8'), $email, - 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" + 'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n" . 'Content-type: text/plain; charset=UTF-8' . "\n" . 'Content-transfer-encoding: 8bit' ); - + } } } @@@ -3485,7 -3445,7 +3486,7 @@@ function subscribe_to_hub($url,$importe post_url($url,$params); logger('subscribe_to_hub: returns: ' . $a->get_curl_code(), LOGGER_DEBUG); - + return; } @@@ -3772,11 -3732,11 +3773,11 @@@ function item_getfeedtags($item) function item_getfeedattach($item) { $ret = ''; - $arr = explode(',',$item['attach']); + $arr = explode('[/attach],',$item['attach']); if(count($arr)) { foreach($arr as $r) { $matches = false; - $cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches); + $cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|',$r,$matches); if($cnt) { $ret .= 'get_baseurl() . '/' . $_SESSION['return_url']); //NOTREACHED } - + } diff --combined include/text.php index 54c9f39fa6,d1fff85ea3..53dd06d1fd --- a/include/text.php +++ b/include/text.php @@@ -23,7 -23,6 +23,6 @@@ function replace_macros($s,$r) if(gettype($s) === 'string') { $template = $s; $s = new FriendicaSmarty(); - $s->error_reporting = E_ALL & ~E_NOTICE; } foreach($r as $key=>$value) { if($key[0] === '$') { @@@ -490,12 -489,12 +489,12 @@@ function get_template_file($a, $filenam if($root !== '' && $root[strlen($root)-1] !== '/') $root = $root . '/'; - if(file_exists($root . "view/theme/$theme/$filename")) - $template_file = $root . "view/theme/$theme/$filename"; - elseif (x($a->theme_info,"extends") && file_exists($root . "view/theme/".$a->theme_info["extends"]."/$filename")) - $template_file = $root . "view/theme/".$a->theme_info["extends"]."/$filename"; + if(file_exists("{$root}view/theme/$theme/$filename")) + $template_file = "{$root}view/theme/$theme/$filename"; + elseif (x($a->theme_info,"extends") && file_exists("{$root}view/theme/{$a->theme_info["extends"]}/$filename")) + $template_file = "{$root}view/theme/{$a->theme_info["extends"]}/$filename"; else - $template_file = $root . "view/$filename"; + $template_file = "{$root}view/$filename"; return $template_file; }} @@@ -562,12 -561,11 +561,12 @@@ function get_tags($s) $ret = array(); // ignore anything in a code block - $s = preg_replace('/\[code\](.*?)\[\/code\]/sm','',$s); - // ignore anything in a bbtag + // Force line feeds at bbtags + $s = str_replace(array("[", "]"), array("\n[", "]\n"), $s); + // ignore anything in a bbtag $s = preg_replace('/\[(.*?)\]/sm','',$s); // Match full names against @tags including the space between first and last @@@ -1019,8 -1017,7 +1018,8 @@@ function prepare_body($item,$attach = f $a = get_app(); call_hooks('prepare_body_init', $item); - $cachefile = get_cachefile($item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body'])); + //$cachefile = get_cachefile($item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body'])); + $cachefile = get_cachefile($item["guid"]."-".hash("md5", $item['body'])); if (($cachefile != '')) { if (file_exists($cachefile)) @@@ -1028,7 -1025,6 +1027,7 @@@ else { $s = prepare_text($item['body']); file_put_contents($cachefile, $s); + logger('prepare_body: put item '.$item["id"].' into cachefile '.$cachefile); } } else $s = prepare_text($item['body']); @@@ -1045,13 -1041,13 +1044,13 @@@ return $s; } - $arr = explode(',',$item['attach']); + $arr = explode('[/attach],',$item['attach']); if(count($arr)) { $s .= '
'; foreach($arr as $r) { $matches = false; $icon = ''; - $cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches, PREG_SET_ORDER); + $cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|',$r,$matches, PREG_SET_ORDER); if($cnt) { foreach($matches as $mtch) { $icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/'))); diff --combined object/Item.php index de28da4642,9c06fc8cf7..18281e9bcb --- a/object/Item.php +++ b/object/Item.php @@@ -66,6 -66,7 +66,7 @@@ class Item extends BaseObject if(! visible_activity($item)) { continue; } + $item['pagedrop'] = $data['pagedrop']; $child = new Item($item); $this->add_child($child); } @@@ -145,30 -146,10 +146,30 @@@ call_hooks('render_location',$locate); $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate)); + $searchpath = $a->get_baseurl()."/search?tag="; $tags=array(); $hashtags = array(); $mentions = array(); - foreach(explode(',',$item['tag']) as $tag){ + + $taglist = q("SELECT `type`, `term`, `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` IN (%d, %d) ORDER BY `tid`", + intval(TERM_OBJ_POST), intval($item['id']), intval(TERM_HASHTAG), intval(TERM_MENTION)); + + foreach($taglist as $tag) { + + if ($tag["url"] == "") + $tag["url"] = $searchpath.strtolower($tag["term"]); + + if ($tag["type"] == TERM_HASHTAG) { + $hashtags[] = "#".$tag["term"].""; + $prefix = "#"; + } elseif ($tag["type"] == TERM_MENTION) { + $mentions[] = "@".$tag["term"].""; + $prefix = "@"; + } + $tags[] = $prefix."".$tag["term"].""; + } + + /*foreach(explode(',',$item['tag']) as $tag){ $tag = trim($tag); if ($tag!="") { $t = bbcode($tag); @@@ -178,7 -159,8 +179,7 @@@ elseif($t[0] == '@') $mentions[] = $t; } - - } + }*/ $like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : ''); $dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : ''); @@@ -232,28 -214,8 +233,28 @@@ localize_item($item); if ($item["postopts"]) { - $langdata = explode(";", $item["postopts"]); - $langstr = substr($langdata[0], 5)." (".round($langdata[1]*100, 1)."%)"; + //$langdata = explode(";", $item["postopts"]); + //$langstr = substr($langdata[0], 5)." (".round($langdata[1]*100, 1)."%)"; + $langstr = ""; + if (substr($item["postopts"], 0, 5) == "lang=") { + $postopts = substr($item["postopts"], 5); + + $languages = explode(":", $postopts); + + if (sizeof($languages) == 1) { + $languages = array(); + $languages[] = $postopts; + } + + foreach ($languages as $language) { + $langdata = explode(";", $language); + if ($langstr != "") + $langstr .= ", "; + + //$langstr .= $langdata[0]." (".round($langdata[1]*100, 1)."%)"; + $langstr .= round($langdata[1]*100, 1)."% ".$langdata[0]; + } + } } $body = prepare_body($item,true); @@@ -289,7 -251,7 +290,7 @@@ 'has_cats' => ((count($categories)) ? 'true' : ''), 'has_folders' => ((count($folders)) ? 'true' : ''), 'categories' => $categories, - 'folders' => $folders, + 'folders' => $folders, 'body' => $body_e, 'text' => $text_e, 'id' => $this->get_id(), @@@ -536,13 -498,7 +537,7 @@@ return false; } - if($a->theme['template_engine'] === 'smarty3') { - $template_file = get_template_file($a, 'smarty3/' . $this->available_templates[$name]); - } - else { - $template_file = $this->available_templates[$name]; - } - $this->template = $template_file; + $this->template = $this->available_templates[$name]; } /** diff --combined update.php index 4bee3a3bc1,1bea71f4d7..2ab2f300c0 --- a/update.php +++ b/update.php @@@ -1,6 -1,6 +1,6 @@@