\r\n";
$r = q("SELECT `id`, `name`, `url`, `network` FROM `contact`
WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `notify` != ''
diff --git a/include/api.php b/include/api.php
old mode 100755
new mode 100644
index 013f4b97ae..ab83d63be4
--- a/include/api.php
+++ b/include/api.php
@@ -3,6 +3,7 @@
require_once("datetime.php");
require_once("conversation.php");
require_once("oauth.php");
+ require_once("html2plain.php");
/*
* Twitter-Like API
*
@@ -82,7 +83,7 @@
$record = $r[0];
} else {
logger('API_login failure: ' . print_r($_SERVER,true), LOGGER_DEBUG);
- header('WWW-Authenticate: Basic realm="Friendika"');
+ header('WWW-Authenticate: Basic realm="Friendica"');
header('HTTP/1.0 401 Unauthorized');
die('This api requires login');
}
@@ -120,6 +121,7 @@
if (strpos($a->query_string, ".json")>0) $type="json";
if (strpos($a->query_string, ".rss")>0) $type="rss";
if (strpos($a->query_string, ".atom")>0) $type="atom";
+ if (strpos($a->query_string, ".as")>0) $type="as";
$r = call_user_func($info['func'], $a, $type);
if ($r===false) return;
@@ -143,6 +145,12 @@
header ("Content-Type: application/atom+xml");
return ''."\n".$r;
break;
+ case "as":
+ //header ("Content-Type: application/json");
+ //foreach($r as $rr)
+ // return json_encode($rr);
+ return json_encode($r);
+ break;
}
//echo ""; var_dump($r); die();
@@ -306,10 +314,10 @@
}
$ret = Array(
+ 'id' => intval($uinfo[0]['cid']),
'self' => intval($uinfo[0]['self']),
'uid' => intval($uinfo[0]['uid']),
- 'id' => intval($uinfo[0]['cid']),
- 'name' => $uinfo[0]['name'],
+ 'name' => (($uinfo[0]['name']) ? $uinfo[0]['name'] : $uinfo[0]['nick']),
'screen_name' => (($uinfo[0]['nick']) ? $uinfo[0]['nick'] : $uinfo[0]['name']),
'location' => ($usr) ? $usr[0]['default-location'] : '',
'profile_image_url' => $uinfo[0]['micro'],
@@ -347,6 +355,8 @@
}
function api_item_get_user(&$a, $item) {
+ global $usercache;
+
// The author is our direct contact, in a conversation with us.
if(link_compare($item['url'],$item['author-link'])) {
return api_get_user($a,$item['cid']);
@@ -362,27 +372,40 @@
list($nick, $name) = array_map("trim",explode("(",$item['author-name']));
$name=str_replace(")","",$name);
-
+
+ if ($name == '')
+ $name = $nick;
+
+ if ($nick == '')
+ $nick = $name;
+
+ // Generating a random ID
+ if (!array_key_exists($nick, $usercache))
+ $usercache[$nick] = mt_rand(2000000, 2100000);
+
$ret = array(
- 'uid' => 0,
- 'id' => 0,
+ 'id' => $usercache[$nick],
'name' => $name,
'screen_name' => $nick,
'location' => '', //$uinfo[0]['default-location'],
+ 'description' => '',
'profile_image_url' => $item['author-avatar'],
'url' => $item['author-link'],
- 'contact_url' => 0,
'protected' => false, #
+ 'followers_count' => 0,
'friends_count' => 0,
'created_at' => '',
+ 'favourites_count' => 0,
'utc_offset' => 0, #XXX: fix me
'time_zone' => '', //$uinfo[0]['timezone'],
- 'geo_enabled' => false,
'statuses_count' => 0,
+ 'following' => 1,
+ 'statusnet_blocking' => false,
+ 'notifications' => false,
+ 'uid' => 0,
+ 'contact_url' => 0,
+ 'geo_enabled' => false,
'lang' => 'en', #XXX: fix me
- 'description' => '',
- 'followers_count' => 0,
- 'favourites_count' => 0,
'contributors_enabled' => false,
'follow_request_sent' => false,
'profile_background_color' => 'cfe8f6',
@@ -393,7 +416,6 @@
'profile_background_image_url' => '',
'profile_background_tile' => false,
'profile_use_background_image' => false,
- 'notifications' => false,
'verified' => true, #XXX: fix me
'followers' => '', #XXX: fix me
'status' => array()
@@ -591,16 +613,16 @@
$in_reply_to_screen_name = $lastwall['reply_author'];
}
$status_info = array(
- 'created_at' => api_date($lastwall['created']),
- 'id' => $lastwall['contact-id'],
- 'text' => strip_tags(bbcode($lastwall['body'])),
- 'source' => (($lastwall['app']) ? $lastwall['app'] : 'web'),
+ 'text' => html2plain(bbcode($lastwall['body']), 0),
'truncated' => false,
+ 'created_at' => api_date($lastwall['created']),
'in_reply_to_status_id' => $in_reply_to_status_id,
+ 'source' => (($lastwall['app']) ? $lastwall['app'] : 'web'),
+ 'id' => $lastwall['contact-id'],
'in_reply_to_user_id' => $in_reply_to_user_id,
- 'favorited' => false,
'in_reply_to_screen_name' => $in_reply_to_screen_name,
'geo' => '',
+ 'favorited' => false,
'coordinates' => $lastwall['coord'],
'place' => $lastwall['location'],
'contributors' => ''
@@ -650,7 +672,7 @@
$user_info['status'] = array(
'created_at' => api_date($lastwall['created']),
'id' => $lastwall['contact-id'],
- 'text' => strip_tags(bbcode($lastwall['body'])),
+ 'text' => html2plain(bbcode($lastwall['body']), 0),
'source' => (($lastwall['app']) ? $lastwall['app'] : 'web'),
'truncated' => false,
'in_reply_to_status_id' => $in_reply_to_status_id,
@@ -686,10 +708,17 @@
$count = (x($_REQUEST,'count')?$_REQUEST['count']:20);
$page = (x($_REQUEST,'page')?$_REQUEST['page']-1:0);
if ($page<0) $page=0;
- $since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
+ $since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
+ $max_id = (x($_REQUEST,'max_id')?$_REQUEST['max_id']:0);
+ //$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$start = $page*$count;
+ //$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
+
+ if ($max_id > 0)
+ $sql_extra = 'AND `item`.`id` <= '.intval($max_id);
+
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
@@ -715,6 +744,13 @@
case "atom":
case "rss":
$data = api_rss_extra($a, $data, $user_info);
+ break;
+ case "as":
+ $as = api_format_as($a, $ret, $user_info);
+ $as['title'] = $a->config['sitename']." Home Timeline";
+ $as['link']['url'] = $a->get_baseurl()."/".$user_info["screen_name"]."/all";
+ return($as);
+ break;
}
return api_apply_template("timeline", $type, $data);
@@ -722,6 +758,271 @@
api_register_func('api/statuses/home_timeline','api_statuses_home_timeline', true);
api_register_func('api/statuses/friends_timeline','api_statuses_home_timeline', true);
+ function api_statuses_public_timeline(&$a, $type){
+ if (local_user()===false) return false;
+
+ $user_info = api_get_user($a);
+ // get last newtork messages
+
+
+ // params
+ $count = (x($_REQUEST,'count')?$_REQUEST['count']:20);
+ $page = (x($_REQUEST,'page')?$_REQUEST['page']-1:0);
+ if ($page<0) $page=0;
+ $since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
+ $max_id = (x($_REQUEST,'max_id')?$_REQUEST['max_id']:0);
+ //$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
+
+ $start = $page*$count;
+
+ //$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
+
+ if ($max_id > 0)
+ $sql_extra = 'AND `item`.`id` <= '.intval($max_id);
+
+ /*$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+ `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
+ `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+ FROM `item`, `contact`
+ WHERE `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
+ AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
+ AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
+ AND `item`.`private` = 0 AND `item`.`wall` = 1 AND `user`.`hidewall` = 0
+ AND `contact`.`id` = `item`.`contact-id`
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ $sql_extra
+ AND `item`.`id`>%d
+ ORDER BY `item`.`received` DESC LIMIT %d ,%d ",
+ intval($since_id),
+ intval($start), intval($count)
+ );*/
+ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+ `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
+ `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`,
+ `user`.`nickname`, `user`.`hidewall`
+ FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+ LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
+ WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
+ AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
+ AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
+ AND `item`.`private` = 0 AND `item`.`wall` = 1 AND `user`.`hidewall` = 0
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ $sql_extra
+ AND `item`.`id`>%d
+ ORDER BY `received` DESC LIMIT %d, %d ",
+ intval($since_id),
+ intval($start),
+ intval($count));
+
+ $ret = api_format_items($r,$user_info);
+
+
+ $data = array('$statuses' => $ret);
+ switch($type){
+ case "atom":
+ case "rss":
+ $data = api_rss_extra($a, $data, $user_info);
+ break;
+ case "as":
+ $as = api_format_as($a, $ret, $user_info);
+ $as['title'] = $a->config['sitename']." Public Timeline";
+ $as['link']['url'] = $a->get_baseurl()."/";
+ return($as);
+ break;
+ }
+
+ return api_apply_template("timeline", $type, $data);
+ }
+ api_register_func('api/statuses/public_timeline','api_statuses_public_timeline', true);
+
+ /**
+ *
+ */
+ function api_statuses_show(&$a, $type){
+ if (local_user()===false) return false;
+
+ $user_info = api_get_user($a);
+
+ // params
+ $id = intval($a->argv[3]);
+
+ logger('API: api_statuses_show: '.$id);
+
+ //$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
+
+ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+ `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
+ `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+ FROM `item`, `contact`
+ WHERE `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
+ AND `contact`.`id` = `item`.`contact-id`
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ $sql_extra
+ AND `item`.`id`=%d",
+ intval($id)
+ );
+
+ $ret = api_format_items($r,$user_info);
+
+ $data = array('$status' => $ret[0]);
+ /*switch($type){
+ case "atom":
+ case "rss":
+ $data = api_rss_extra($a, $data, $user_info);
+ }*/
+ return api_apply_template("status", $type, $data);
+ }
+ api_register_func('api/statuses/show','api_statuses_show', true);
+
+
+ /**
+ *
+ */
+ function api_statuses_repeat(&$a, $type){
+ if (local_user()===false) return false;
+
+ $user_info = api_get_user($a);
+
+ // params
+ $id = intval($a->argv[3]);
+
+ logger('API: api_statuses_repeat: '.$id);
+
+ //$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
+
+ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`nick` as `reply_author`,
+ `contact`.`name`, `contact`.`photo`, `contact`.`url` as `reply_url`, `contact`.`rel`,
+ `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
+ `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+ FROM `item`, `contact`
+ WHERE `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
+ AND `contact`.`id` = `item`.`contact-id`
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ $sql_extra
+ AND `item`.`id`=%d",
+ intval($id)
+ );
+
+ $_REQUEST['body'] = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8')."[url=".$r[0]['reply_url']."]".$r[0]['reply_author']."[/url] \n".$r[0]['body'];
+ $_REQUEST['profile_uid'] = local_user();
+ $_REQUEST['type'] = 'wall';
+ $_REQUEST['api_source'] = true;
+
+ require_once('mod/item.php');
+ item_post($a);
+
+ if ($type == 'xml')
+ $ok = "true";
+ else
+ $ok = "ok";
+
+ return api_apply_template('test', $type, array('$ok' => $ok));
+ }
+ api_register_func('api/statuses/retweet','api_statuses_repeat', true);
+
+ /**
+ *
+ */
+ function api_statuses_destroy(&$a, $type){
+ if (local_user()===false) return false;
+
+ $user_info = api_get_user($a);
+
+ // params
+ $id = intval($a->argv[3]);
+
+ logger('API: api_statuses_destroy: '.$id);
+
+ require_once('include/items.php');
+ drop_item($id, false);
+
+ if ($type == 'xml')
+ $ok = "true";
+ else
+ $ok = "ok";
+
+ return api_apply_template('test', $type, array('$ok' => $ok));
+ }
+ api_register_func('api/statuses/destroy','api_statuses_destroy', true);
+
+ /**
+ *
+ * http://developer.twitter.com/doc/get/statuses/mentions
+ *
+ */
+ function api_statuses_mentions(&$a, $type){
+ if (local_user()===false) return false;
+
+ $user_info = api_get_user($a);
+ // get last newtork messages
+
+
+ // params
+ $count = (x($_REQUEST,'count')?$_REQUEST['count']:20);
+ $page = (x($_REQUEST,'page')?$_REQUEST['page']-1:0);
+ if ($page<0) $page=0;
+ $since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
+ $max_id = (x($_REQUEST,'max_id')?$_REQUEST['max_id']:0);
+ //$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
+
+ $start = $page*$count;
+
+ //$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
+
+ $myurl = $a->get_baseurl() . '/profile/'. $a->user['nickname'];
+ $myurl = substr($myurl,strpos($myurl,'://')+3);
+ $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
+ $diasp_url = str_replace('/profile/','/u/',$myurl);
+ $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` regexp '%s' or `tag` regexp '%s' or tag regexp '%s' )) ",
+ dbesc($myurl . '$'),
+ dbesc($myurl . '\\]'),
+ dbesc($diasp_url . '\\]')
+ );
+
+ if ($max_id > 0)
+ $sql_extra .= ' AND `item`.`id` <= '.intval($max_id);
+
+ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
+ `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
+ `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
+ FROM `item`, `contact`
+ WHERE `item`.`uid` = %d
+ AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
+ AND `contact`.`id` = `item`.`contact-id`
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ $sql_extra
+ AND `item`.`id`>%d
+ ORDER BY `item`.`received` DESC LIMIT %d ,%d ",
+ intval($user_info['uid']),
+ intval($since_id),
+ intval($start), intval($count)
+ );
+
+ $ret = api_format_items($r,$user_info);
+
+
+ $data = array('$statuses' => $ret);
+ switch($type){
+ case "atom":
+ case "rss":
+ $data = api_rss_extra($a, $data, $user_info);
+ break;
+ case "as":
+ $as = api_format_as($a, $ret, $user_info);
+ $as["title"] = $a->config['sitename']." Mentions";
+ $as['link']['url'] = $a->get_baseurl()."/";
+ return($as);
+ break;
+ }
+
+ return api_apply_template("timeline", $type, $data);
+ }
+ api_register_func('api/statuses/mentions','api_statuses_mentions', true);
+ api_register_func('api/statuses/replies','api_statuses_mentions', true);
function api_statuses_user_timeline(&$a, $type){
@@ -740,7 +1041,8 @@
$count = (x($_REQUEST,'count')?$_REQUEST['count']:20);
$page = (x($_REQUEST,'page')?$_REQUEST['page']-1:0);
if ($page<0) $page=0;
- $since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
+ $since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
+ //$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$start = $page*$count;
@@ -833,6 +1135,70 @@
api_register_func('api/favorites','api_favorites', true);
+ function api_format_as($a, $ret, $user_info) {
+
+ $as = array();
+ $as['title'] = $a->config['sitename']." Public Timeline";
+ $items = array();
+ foreach ($ret as $item) {
+ $singleitem["actor"]["displayName"] = $item["user"]["name"];
+ $singleitem["actor"]["id"] = $item["user"]["contact_url"];
+ $avatar[0]["url"] = $item["user"]["profile_image_url"];
+ $avatar[0]["rel"] = "avatar";
+ $avatar[0]["type"] = "";
+ $avatar[0]["width"] = 96;
+ $avatar[0]["height"] = 96;
+ $avatar[1]["url"] = $item["user"]["profile_image_url"];
+ $avatar[1]["rel"] = "avatar";
+ $avatar[1]["type"] = "";
+ $avatar[1]["width"] = 48;
+ $avatar[1]["height"] = 48;
+ $avatar[2]["url"] = $item["user"]["profile_image_url"];
+ $avatar[2]["rel"] = "avatar";
+ $avatar[2]["type"] = "";
+ $avatar[2]["width"] = 24;
+ $avatar[2]["height"] = 24;
+ $singleitem["actor"]["avatarLinks"] = $avatar;
+
+ $singleitem["actor"]["image"]["url"] = $item["user"]["profile_image_url"];
+ $singleitem["actor"]["image"]["rel"] = "avatar";
+ $singleitem["actor"]["image"]["type"] = "";
+ $singleitem["actor"]["image"]["width"] = 96;
+ $singleitem["actor"]["image"]["height"] = 96;
+ $singleitem["actor"]["type"] = "person";
+ $singleitem["actor"]["url"] = $item["person"]["contact_url"];
+ $singleitem["actor"]["statusnet:profile_info"]["local_id"] = $item["user"]["id"];
+ $singleitem["actor"]["statusnet:profile_info"]["following"] = $item["user"]["following"] ? "true" : "false";
+ $singleitem["actor"]["statusnet:profile_info"]["blocking"] = "false";
+ $singleitem["actor"]["contact"]["preferredUsername"] = $item["user"]["screen_name"];
+ $singleitem["actor"]["contact"]["displayName"] = $item["user"]["name"];
+ $singleitem["actor"]["contact"]["addresses"] = "";
+
+ $singleitem["body"] = $item["text"];
+ $singleitem["object"]["displayName"] = $item["text"];
+ $singleitem["object"]["id"] = $item["url"];
+ $singleitem["object"]["type"] = "note";
+ $singleitem["object"]["url"] = $item["url"];
+ //$singleitem["context"] =;
+ $singleitem["postedTime"] = date("c", strtotime($item["published"]));
+ $singleitem["provider"]["objectType"] = "service";
+ $singleitem["provider"]["displayName"] = "Test";
+ $singleitem["provider"]["url"] = "http://test.tld";
+ $singleitem["title"] = $item["text"];
+ $singleitem["verb"] = "post";
+ $singleitem["statusnet:notice_info"]["local_id"] = $item["id"];
+ $singleitem["statusnet:notice_info"]["source"] = $item["source"];
+ $singleitem["statusnet:notice_info"]["favorite"] = "false";
+ $singleitem["statusnet:notice_info"]["repeated"] = "false";
+ //$singleitem["original"] = $item;
+ $items[] = $singleitem;
+ }
+ $as['items'] = $items;
+ $as['link']['url'] = $a->get_baseurl()."/".$user_info["screen_name"]."/all";
+ $as['link']['rel'] = "alternate";
+ $as['link']['type'] = "text/html";
+ return($as);
+ }
function api_format_items($r,$user_info) {
@@ -846,33 +1212,64 @@
foreach($r as $item) {
localize_item($item);
$status_user = (($item['cid']==$user_info['id'])?$user_info: api_item_get_user($a,$item));
+
+ if ($item['parent']!=$item['id']) {
+ $r = q("select id from item where parent=%s and id<%s order by id desc limit 1",
+ intval($item['parent']), intval($item['id']));
+ if ($r)
+ $in_reply_to_status_id = $r[0]['id'];
+ else
+ $in_reply_to_status_id = $item['parent'];
+
+ $r = q("select `item`.`contact-id`, `contact`.nick, `item`.`author-name` from item, contact
+ where `contact`.`id` = `item`.`contact-id` and `item`.id=%d", intval($in_reply_to_status_id));
+
+ $in_reply_to_screen_name = $r[0]['author-name'];
+ $in_reply_to_user_id = $r[0]['contact-id'];
+
+ } else {
+ $in_reply_to_screen_name = '';
+ $in_reply_to_user_id = 0;
+ $in_reply_to_status_id = 0;
+ }
+
$status = array(
- 'created_at'=> api_date($item['created']),
- 'published' => api_date($item['created']),
- 'updated' => api_date($item['edited']),
- 'id' => intval($item['id']),
- 'message_id' => $item['uri'],
- 'text' => strip_tags(bbcode($item['body'])),
- 'statusnet_html' => bbcode($item['body']),
- 'source' => (($item['app']) ? $item['app'] : 'web'),
- 'url' => ($item['plink']!=''?$item['plink']:$item['author-link']),
+ 'text' => trim($item['title']." \n".html2plain(bbcode($item['body']), 0)),
'truncated' => False,
- 'in_reply_to_status_id' => ($item['parent']!=$item['id']? intval($item['parent']):''),
- 'in_reply_to_user_id' => '',
- 'favorited' => $item['starred'] ? true : false,
- 'in_reply_to_screen_name' => '',
+ 'created_at'=> api_date($item['created']),
+ 'in_reply_to_status_id' => $in_reply_to_status_id,
+ 'source' => (($item['app']) ? $item['app'] : 'web'),
+ 'id' => intval($item['id']),
+ 'in_reply_to_user_id' => $in_reply_to_user_id,
+ 'in_reply_to_screen_name' => $in_reply_to_screen_name,
'geo' => '',
- 'coordinates' => $item['coord'],
- 'place' => $item['location'],
- 'contributors' => '',
- 'annotations' => '',
- 'entities' => '',
+ 'favorited' => $item['starred'] ? true : false,
'user' => $status_user ,
- 'objecttype' => (($item['object-type']) ? $item['object-type'] : ACTIVITY_OBJ_NOTE),
- 'verb' => (($item['verb']) ? $item['verb'] : ACTIVITY_POST),
- 'self' => $a->get_baseurl()."/api/statuses/show/".$item['id'].".".$type,
- 'edit' => $a->get_baseurl()."/api/statuses/show/".$item['id'].".".$type,
+ 'statusnet_html' => bbcode($item['body']),
+ 'statusnet_conversation_id' => 0,
);
+
+ // Seesmic doesn't like the following content
+ if ($_SERVER['HTTP_USER_AGENT'] != 'Seesmic') {
+ $status2 = array(
+ 'updated' => api_date($item['edited']),
+ 'published' => api_date($item['created']),
+ 'message_id' => $item['uri'],
+ 'url' => ($item['plink']!=''?$item['plink']:$item['author-link']),
+ 'coordinates' => $item['coord'],
+ 'place' => $item['location'],
+ 'contributors' => '',
+ 'annotations' => '',
+ 'entities' => '',
+ 'objecttype' => (($item['object-type']) ? $item['object-type'] : ACTIVITY_OBJ_NOTE),
+ 'verb' => (($item['verb']) ? $item['verb'] : ACTIVITY_POST),
+ 'self' => $a->get_baseurl()."/api/statuses/show/".$item['id'].".".$type,
+ 'edit' => $a->get_baseurl()."/api/statuses/show/".$item['id'].".".$type,
+ );
+
+ $status = array_merge($status, $status2);
+ }
+
$ret[]=$status;
};
return $ret;
@@ -882,17 +1279,31 @@
function api_account_rate_limit_status(&$a,$type) {
$hash = array(
+ 'reset_time_in_seconds' => strtotime('now + 1 hour'),
'remaining_hits' => (string) 150,
'hourly_limit' => (string) 150,
'reset_time' => datetime_convert('UTC','UTC','now + 1 hour',ATOM_TIME),
- 'reset_time_in_seconds' => strtotime('now + 1 hour')
);
+ if ($type == "xml")
+ $hash['resettime_in_seconds'] = $hash['reset_time_in_seconds'];
return api_apply_template('ratelimit', $type, array('$hash' => $hash));
}
api_register_func('api/account/rate_limit_status','api_account_rate_limit_status',true);
+ function api_help_test(&$a,$type) {
+
+ if ($type == 'xml')
+ $ok = "true";
+ else
+ $ok = "ok";
+
+ return api_apply_template('test', $type, array('$ok' => $ok));
+
+ }
+ api_register_func('api/help/test','api_help_test',true);
+
/**
* https://dev.twitter.com/docs/api/1/get/statuses/friends
* This function is deprecated by Twitter
@@ -1075,7 +1486,7 @@
'recipient_screen_name'=> $recipient['screen_name'],
'recipient'=> $recipient,
- 'text'=> $item['title']."\n".strip_tags(bbcode($item['body'])) ,
+ 'text'=> $item['title']."\n".html2plain(bbcode($item['body']), 0) ,
);
@@ -1144,7 +1555,7 @@
'recipient_screen_name'=> $recipient['screen_name'],
'recipient'=> $recipient,
- 'text'=> $item['title']."\n".strip_tags(bbcode($item['body'])) ,
+ 'text'=> $item['title']."\n".html2plain(bbcode($item['body']), 0) ,
);
@@ -1197,4 +1608,31 @@
api_register_func('api/oauth/request_token', 'api_oauth_request_token', false);
api_register_func('api/oauth/access_token', 'api_oauth_access_token', false);
+/*
+Not implemented by now:
+favorites
+favorites/create
+favorites/destroy
+statuses/retweets_of_me
+friendships/create
+friendships/destroy
+friendships/exists
+friendships/show
+account/update_location
+account/update_profile_background_image
+account/update_profile_image
+blocks/create
+blocks/destroy
+oauth/authorize
+Not implemented in status.net:
+statuses/retweeted_to_me
+statuses/retweeted_by_me
+direct_messages/destroy
+account/end_session
+account/update_delivery_device
+notifications/follow
+notifications/leave
+blocks/exists
+blocks/blocking
+*/
diff --git a/include/attach.php b/include/attach.php
old mode 100755
new mode 100644
diff --git a/include/auth.php b/include/auth.php
old mode 100755
new mode 100644
index fc52684e64..1341f3bb8a
--- a/include/auth.php
+++ b/include/auth.php
@@ -24,7 +24,7 @@ if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && ((! (x($_POST,'auth-p
if(((x($_POST,'auth-params')) && ($_POST['auth-params'] === 'logout')) || ($a->module === 'logout')) {
// process logout request
-
+ call_hooks("logging_out");
nuke_session();
info( t('Logged out.') . EOL);
goaway(z_root());
@@ -77,7 +77,7 @@ else {
$noid = get_config('system','no_openid');
- $openid_url = trim( (strlen($_POST['openid_url'])?$_POST['openid_url']:$_POST['username']) );
+ $openid_url = trim((strlen($_POST['openid_url'])?$_POST['openid_url']:$_POST['username']) );
// validate_url alters the calling parameter
@@ -94,37 +94,21 @@ else {
// Otherwise it's probably an openid.
+ try {
require_once('library/openid.php');
$openid = new LightOpenID;
$openid->identity = $openid_url;
$_SESSION['openid'] = $openid_url;
$a = get_app();
- $openid->returnUrl = $a->get_baseurl() . '/openid';
-
- $r = q("SELECT `uid` FROM `user` WHERE `openid` = '%s' LIMIT 1",
- dbesc($openid_url)
- );
- if(count($r)) {
- // existing account
- goaway($openid->authUrl());
- // NOTREACHED
- }
- else {
- if($a->config['register_policy'] == REGISTER_CLOSED) {
- $a = get_app();
- notice( t('Login failed.') . EOL);
- goaway(z_root());
- // NOTREACHED
- }
- // new account
- $_SESSION['register'] = 1;
- $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson');
- $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default');
- goaway($openid->authUrl());
- // NOTREACHED
- }
+ $openid->returnUrl = $a->get_baseurl(true) . '/openid';
+ goaway($openid->authUrl());
+ } catch (Exception $e) {
+ notice( t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.').' '. t('The error message was:').' '.$e->getMessage());
+ }
+ // NOTREACHED
}
}
+
if((x($_POST,'auth-params')) && $_POST['auth-params'] === 'login') {
$record = null;
@@ -165,7 +149,7 @@ else {
}
if((! $record) || (! count($record))) {
- logger('authenticate: failed login attempt: ' . notags(trim($_POST['username'])));
+ logger('authenticate: failed login attempt: ' . notags(trim($_POST['username'])) . ' from IP ' . $_SERVER['REMOTE_ADDR']);
notice( t('Login failed.') . EOL );
goaway(z_root());
}
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
old mode 100755
new mode 100644
diff --git a/include/bbcode.php b/include/bbcode.php
index cff26f5c8e..3697f1fc5d 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -189,8 +189,29 @@ function bbcode($Text,$preserve_nl = false) {
// Check for [code] text
$Text = preg_replace("/\[code\](.*?)\[\/code\]/ism","$CodeLayout", $Text);
+ // Declare the format for [spoiler] layout
+ $SpoilerLayout = '$1 ';
+
+ // Check for [spoiler] text
+ // handle nested quotes
+ $endlessloop = 0;
+ while ((strpos($Text, "[/spoiler]") !== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20))
+ $Text = preg_replace("/\[spoiler\](.*?)\[\/spoiler\]/ism","$SpoilerLayout", $Text);
+
+ // Check for [spoiler=Author] text
+
+ $t_wrote = t('$1 wrote:');
+
+ // handle nested quotes
+ $endlessloop = 0;
+ while ((strpos($Text, "[/spoiler]")!== false) and (strpos($Text, "[spoiler=") !== false) and (++$endlessloop < 20))
+ $Text = preg_replace("/\[spoiler=[\"\']*(.*?)[\"\']*\](.*?)\[\/spoiler\]/ism",
+ "" . $t_wrote . " $2 ",
+ $Text);
+
// Declare the format for [quote] layout
$QuoteLayout = '$1 ';
+
// Check for [quote] text
// handle nested quotes
$endlessloop = 0;
@@ -205,17 +226,21 @@ function bbcode($Text,$preserve_nl = false) {
$endlessloop = 0;
while ((strpos($Text, "[/quote]")!== false) and (strpos($Text, "[quote=") !== false) and (++$endlessloop < 20))
$Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism",
- "" . $t_wrote . " $2 ",
+ "" . $t_wrote . " $2 ",
$Text);
// [img=widthxheight]image source[/img]
- $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", ' ', $Text);
+ //$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", ' ', $Text);
+ $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", ' ', $Text);
// Images
// [img]pathtoimage[/img]
$Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", ' ', $Text);
+ $Text = preg_replace("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4))\[\/video\]/ism", '$1 ', $Text);
+
+ $Text = preg_replace("/\[audio\](.*?\.(ogg|ogv|oga|ogm|webm|mp4|mp3))\[\/audio\]/ism", '$1 ', $Text);
// Try to Oembed
$Text = preg_replace_callback("/\[video\](.*?)\[\/video\]/ism", 'tryoembed', $Text);
@@ -224,9 +249,6 @@ function bbcode($Text,$preserve_nl = false) {
// html5 video and audio
- $Text = preg_replace("/\[video\](.*?)\[\/video\]/ism", '$1 ', $Text);
-
- $Text = preg_replace("/\[audio\](.*?)\[\/audio\]/ism", '$1 ', $Text);
$Text = preg_replace("/\[iframe\](.*?)\[\/iframe\]/ism", '', $Text);
diff --git a/include/cache.php b/include/cache.php
old mode 100755
new mode 100644
diff --git a/include/config.php b/include/config.php
index 2cddda0b8d..4cff38090c 100755
--- a/include/config.php
+++ b/include/config.php
@@ -80,6 +80,7 @@ function set_config($family,$key,$value) {
// manage array value
$dbvalue = (is_array($value)?serialize($value):$value);
+ $dbvalue = (is_bool($value) ? intval($value) : $value);
if(get_config($family,$key,true) === false) {
$a->config[$family][$key] = $value;
diff --git a/include/contact_selectors.php b/include/contact_selectors.php
old mode 100755
new mode 100644
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
old mode 100755
new mode 100644
index caa0572d20..e0f37f078f
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -15,8 +15,6 @@ function findpeople_widget() {
$a = get_app();
- $inv = (($a->config['register_policy'] != REGISTER_CLOSED) ? t('Invite Friends') : '');
-
if(get_config('system','invitation_only')) {
$x = get_pconfig(local_user(),'system','invites_remaining');
if($x || is_site_admin()) {
@@ -34,7 +32,7 @@ function findpeople_widget() {
'$findthem' => t('Find'),
'$suggest' => t('Friend Suggestions'),
'$similar' => t('Similar Interests'),
- '$inv' => $inv
+ '$inv' => t('Invite Friends')
));
}
@@ -48,7 +46,7 @@ function networks_widget($baseurl,$selected = '') {
return '';
- $r = q("select distinct(network) from contact where uid = %d",
+ $r = q("select distinct(network) from contact where uid = %d and self = 0",
intval(local_user())
);
@@ -75,4 +73,61 @@ function networks_widget($baseurl,$selected = '') {
));
}
+function fileas_widget($baseurl,$selected = '') {
+ $a = get_app();
+ if(! local_user())
+ return '';
+
+ $saved = get_pconfig(local_user(),'system','filetags');
+ if(! strlen($saved))
+ return;
+
+ $matches = false;
+ $terms = array();
+ $cnt = preg_match_all('/\[(.*?)\]/',$saved,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $unescaped = xmlify(file_tag_decode($mtch[1]));
+ $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
+ }
+ }
+
+ return replace_macros(get_markup_template('fileas_widget.tpl'),array(
+ '$title' => t('Saved Folders'),
+ '$desc' => '',
+ '$sel_all' => (($selected == '') ? 'selected' : ''),
+ '$all' => t('Everything'),
+ '$terms' => $terms,
+ '$base' => $baseurl,
+
+ ));
+}
+
+function categories_widget($baseurl,$selected = '') {
+ $a = get_app();
+
+ $saved = get_pconfig($a->profile['profile_uid'],'system','filetags');
+ if(! strlen($saved))
+ return;
+
+ $matches = false;
+ $terms = array();
+ $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $unescaped = xmlify(file_tag_decode($mtch[1]));
+ $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
+ }
+ }
+
+ return replace_macros(get_markup_template('categories_widget.tpl'),array(
+ '$title' => t('Categories'),
+ '$desc' => '',
+ '$sel_all' => (($selected == '') ? 'selected' : ''),
+ '$all' => t('Everything'),
+ '$terms' => $terms,
+ '$base' => $baseurl,
+
+ ));
+}
diff --git a/include/conversation.php b/include/conversation.php
old mode 100755
new mode 100644
index f4740688cd..df92a40ed0
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -94,9 +94,9 @@ function localize_item(&$item){
}
- $A = '[url=' . $Alink . ']' . $Aname . '[/url]';
- $B = '[url=' . $Blink . ']' . $Bname . '[/url]';
- if ($Bphoto!="") $Bphoto = '[url=' . $Blink . '][img]' . $Bphoto . '[/img][/url]';
+ $A = '[url=' . zrl($Alink) . ']' . $Aname . '[/url]';
+ $B = '[url=' . zrl($Blink) . ']' . $Bname . '[/url]';
+ if ($Bphoto!="") $Bphoto = '[url=' . zrl($Blink) . '][img]' . $Bphoto . '[/img][/url]';
$item['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$Bphoto;
@@ -108,8 +108,8 @@ function localize_item(&$item){
if(count($r)==0) return;
$obj=$r[0];
- $author = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
- $objauthor = '[url=' . $obj['author-link'] . ']' . $obj['author-name'] . '[/url]';
+ $author = '[url=' . zrl($item['author-link']) . ']' . $item['author-name'] . '[/url]';
+ $objauthor = '[url=' . zrl($obj['author-link']) . ']' . $obj['author-name'] . '[/url]';
switch($obj['verb']){
case ACTIVITY_POST:
@@ -158,14 +158,21 @@ function localize_item(&$item){
$target = $r[0];
$Bname = $target['author-name'];
$Blink = $target['author-link'];
- $A = '[url=' . $Alink . ']' . $Aname . '[/url]';
- $B = '[url=' . $Blink . ']' . $Bname . '[/url]';
+ $A = '[url=' . zrl($Alink) . ']' . $Aname . '[/url]';
+ $B = '[url=' . zrl($Blink) . ']' . $Bname . '[/url]';
$P = '[url=' . $target['plink'] . ']' . t('post/item') . '[/url]';
$item['body'] = sprintf( t('%1$s marked %2$s\'s %3$s as favorite'), $A, $B, $P)."\n";
}
}
}
+ $matches = null;
+ if(preg_match_all('/@\[url=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) {
+ foreach($matches as $mtch) {
+ if(! strpos($mtch[1],'zrl='))
+ $item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']);
+ }
+ }
}
@@ -179,11 +186,15 @@ function localize_item(&$item){
* that are based on unique features of the calling module.
*
*/
- if(!function_exists('conversation')){
+
+if(!function_exists('conversation')) {
function conversation(&$a, $items, $mode, $update, $preview = false) {
+
require_once('bbcode.php');
+ $ssl_state = ((local_user()) ? true : false);
+
$profile_owner = 0;
$page_writeable = false;
@@ -217,7 +228,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
if($update)
$return_url = $_SESSION['return_url'];
else
- $return_url = $_SESSION['return_url'] = $a->cmd;
+ $return_url = $_SESSION['return_url'] = $a->query_string;
load_contact_links(local_user());
@@ -239,7 +250,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$threads = array();
$threadsid = -1;
- if(count($items)) {
+ if($items && count($items)) {
if($mode === 'network-new' || $mode === 'search' || $mode === 'community') {
@@ -272,13 +283,16 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
if($item['author-link'] && (! $item['author-name']))
$profile_name = $item['author-link'];
+
+
$sp = false;
$profile_link = best_link_url($item,$sp);
- if($sp)
- $sparkle = ' sparkle';
if($profile_link === 'mailbox')
$profile_link = '';
-
+ if($sp)
+ $sparkle = ' sparkle';
+ else
+ $profile_link = zrl($profile_link);
$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
if(($normalised != 'mailbox') && (x($a->contacts[$normalised])))
@@ -343,7 +357,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
'like' => '',
'dislike' => '',
'comment' => '',
- 'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
+ 'conv' => (($preview) ? '' : array('href'=> $a->get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))),
'previewing' => $previewing,
'wait' => t('Please wait'),
);
@@ -373,7 +387,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$comments[$item['parent']] = 1;
else
$comments[$item['parent']] += 1;
- }
+ } elseif(! x($comments,$item['parent']))
+ $comments[$item['parent']] = 0; // avoid notices later on
}
// map all the like/dislike activities for each parent item
@@ -418,26 +433,6 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$toplevelprivate = (($toplevelpost && $item['private']) ? true : false);
$item_writeable = (($item['writable'] || $item['self']) ? true : false);
- // DISABLED
- /*
- if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) {
- $blowhard_count ++;
- if($blowhard_count == 3) {
- $o .= ''
- . t('See more posts like this') . '
' . '';
- }
- }
- else {
- $blowhard = $item['cid'];
- if($blowhard_count >= 3)
- $o .= '
';
- $blowhard_count = 0;
- }
- // END DISABLED
- */
-
$comments_seen = 0;
$comments_collapsed = false;
$comment_lastcollapsed = false;
@@ -445,13 +440,16 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$threadsid++;
$threads[$threadsid]['id'] = $item['item_id'];
+ $threads[$threadsid]['private'] = $item['private'];
$threads[$threadsid]['items'] = array();
}
else {
- // prevent private email from leaking into public conversation
- if((! $toplevelpost) && (! $toplevelprivate) && ($item['private']) && ($profile_owner != local_user()))
+
+ // prevent private email reply to public conversation from leaking.
+ if($item['private'] && ! $threads[$threadsid]['private'])
continue;
+
$comments_seen ++;
$comment_lastcollapsed = false;
$comment_firstcollapsed = false;
@@ -475,7 +473,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$comment_lastcollapsed = true;
}
- $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
+ $redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $item['cid'] ;
$lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
@@ -496,13 +494,13 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
// This will have been stored in $a->page_contact by our calling page.
// Put this person on the left of the wall-to-wall notice.
- $owner_url = $a->page_contact['url'];
+ $owner_url = zrl($a->page_contact['url']);
$owner_photo = $a->page_contact['thumb'];
$owner_name = $a->page_contact['name'];
$template = $wallwall;
$commentww = 'ww';
}
- if((! $item['wall']) && (strlen($item['owner-link'])) && ($item['owner-link'] != $item['author-link'])) {
+ if((! $item['wall']) && (strlen($item['owner-link'])) && (! link_compare($item['owner-link'],$item['author-link']))) {
// Could be anybody.
@@ -513,10 +511,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$commentww = 'ww';
// If it is our contact, use a friendly redirect link
if((link_compare($item['owner-link'],$item['url']))
- && ($item['network'] === 'dfrn')) {
+ && ($item['network'] === NETWORK_DFRN)) {
$owner_url = $redirect_url;
$osparkle = ' sparkle';
}
+ else
+ $owner_url = zrl($owner_url);
}
}
@@ -532,9 +532,12 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
}
+ $qc = $qcomment = null;
- $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
- $qcomment = (($qc) ? explode("\n",$qc) : null);
+ if(in_array('qcomment',$a->plugins)) {
+ $qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
+ $qcomment = (($qc) ? explode("\n",$qc) : null);
+ }
if(($show_comment_box) || (($show_comment_box == false) && ($override_comment_box == false) && ($item['last-child']))) {
$comment = replace_macros($cmnt_tpl,array(
@@ -557,7 +560,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
}
$edpost = (((($profile_owner == local_user()) && ($toplevelpost) && (intval($item['wall']) == 1)) || ($mode === 'notes'))
- ? array($a->get_baseurl()."/editpost/".$item['id'], t("Edit"))
+ ? array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"))
: False);
@@ -574,24 +577,28 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
);
$star = false;
+ $filer = false;
+
$isstarred = "unstarred";
- if ($profile_owner == local_user() && $toplevelpost) {
- $isstarred = (($item['starred']) ? "starred" : "unstarred");
+ if ($profile_owner == local_user()) {
+ if($toplevelpost) {
+ $isstarred = (($item['starred']) ? "starred" : "unstarred");
- $star = array(
- 'do' => t("add star"),
- 'undo' => t("remove star"),
- 'toggle' => t("toggle star status"),
- 'classdo' => (($item['starred']) ? "hidden" : ""),
- 'classundo' => (($item['starred']) ? "" : "hidden"),
- 'starred' => t('starred'),
- 'tagger' => t("add tag"),
- 'classtagger' => "",
- );
+ $star = array(
+ 'do' => t("add star"),
+ 'undo' => t("remove star"),
+ 'toggle' => t("toggle star status"),
+ 'classdo' => (($item['starred']) ? "hidden" : ""),
+ 'classundo' => (($item['starred']) ? "" : "hidden"),
+ 'starred' => t('starred'),
+ 'tagger' => t("add tag"),
+ 'classtagger' => "",
+ );
+ }
+ $filer = t("save to folder");
}
-
$photo = $item['photo'];
$thumb = $item['thumb'];
@@ -604,14 +611,14 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
if($item['author-link'] && (! $item['author-name']))
$profile_name = $item['author-link'];
-
$sp = false;
$profile_link = best_link_url($item,$sp);
- if($sp)
- $sparkle = ' sparkle';
-
if($profile_link === 'mailbox')
$profile_link = '';
+ if($sp)
+ $sparkle = ' sparkle';
+ else
+ $profile_link = zrl($profile_link);
$normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']);
if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
@@ -657,7 +664,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
// template to use to render item (wall, walltowall, search)
'template' => $template,
- 'type' => implode("",array_slice(split("/",$item['verb']),-1)),
+ 'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
'tags' => $tags,
'body' => template_escape($body),
'text' => strip_tags(template_escape($body)),
@@ -685,6 +692,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
'edpost' => $edpost,
'isstarred' => $isstarred,
'star' => $star,
+ 'filer' => $filer,
'drop' => $drop,
'vote' => $likebuttons,
'like' => $like,
@@ -706,7 +714,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$page_template = get_markup_template("conversation.tpl");
$o .= replace_macros($page_template, array(
- '$baseurl' => $a->get_baseurl(),
+ '$baseurl' => $a->get_baseurl($ssl_state),
'$mode' => $mode,
'$user' => $a->user,
'$threads' => $threads,
@@ -716,7 +724,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
return $o;
}}
-function best_link_url($item,&$sparkle) {
+function best_link_url($item,&$sparkle,$ssl_state = false) {
$a = get_app();
@@ -728,7 +736,7 @@ function best_link_url($item,&$sparkle) {
if((local_user()) && (local_user() == $item['uid'])) {
if(isset($a->contacts) && x($a->contacts,$clean_url)) {
if($a->contacts[$clean_url]['network'] === NETWORK_DFRN) {
- $best_url = $a->get_baseurl() . '/redir/' . $a->contacts[$clean_url]['id'];
+ $best_url = $a->get_baseurl($ssl_state) . '/redir/' . $a->contacts[$clean_url]['id'];
$sparkle = true;
}
else
@@ -749,10 +757,14 @@ function best_link_url($item,&$sparkle) {
if(! function_exists('item_photo_menu')){
function item_photo_menu($item){
$a = get_app();
-
- if (local_user() && (! count($a->contacts)))
- load_contact_links(local_user());
+ $ssl_state = false;
+
+ if(local_user()) {
+ $ssl_state = true;
+ if(! count($a->contacts))
+ load_contact_links(local_user());
+ }
$contact_url="";
$pm_url="";
$status_link="";
@@ -760,7 +772,7 @@ function item_photo_menu($item){
$posts_link="";
$sparkle = false;
- $profile_link = best_link_url($item,$sparkle);
+ $profile_link = best_link_url($item,$sparkle,$ssl_state);
if($profile_link === 'mailbox')
$profile_link = '';
@@ -769,9 +781,11 @@ function item_photo_menu($item){
$status_link = $profile_link . "?url=status";
$photos_link = $profile_link . "?url=photos";
$profile_link = $profile_link . "?url=profile";
- $pm_url = $a->get_baseurl() . '/message/new/' . $cid;
+ $pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid;
+ $zurl = '';
}
else {
+ $profile_link = zrl($profile_link);
if(local_user() && local_user() == $item['uid'] && link_compare($item['url'],$item['author-link'])) {
$cid = $item['contact-id'];
}
@@ -780,14 +794,25 @@ function item_photo_menu($item){
}
}
if(($cid) && (! $item['self'])) {
- $contact_url = $a->get_baseurl() . '/contacts/' . $cid;
- $posts_link = $a->get_baseurl() . '/network/?cid=' . $cid;
+ $contact_url = $a->get_baseurl($ssl_state) . '/contacts/' . $cid;
+ $posts_link = $a->get_baseurl($ssl_state) . '/network/?cid=' . $cid;
+
+ $clean_url = normalise_link($item['author-link']);
+
+ if((local_user()) && (local_user() == $item['uid'])) {
+ if(isset($a->contacts) && x($a->contacts,$clean_url)) {
+ if($a->contacts[$clean_url]['network'] === NETWORK_DIASPORA) {
+ $pm_url = $a->get_baseurl($ssl_state) . '/message/new/' . $cid;
+ }
+ }
+ }
+
}
$menu = Array(
t("View status") => $status_link,
t("View profile") => $profile_link,
- t("View photos") => $photos_link,
+ t("View photos") => $photos_link,
t("View recent") => $posts_link,
t("Edit contact") => $contact_url,
t("Send PM") => $pm_url,
@@ -817,9 +842,11 @@ function like_puller($a,$item,&$arr,$mode) {
if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) {
$url = $item['author-link'];
if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === 'dfrn') && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) {
- $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
+ $url = $a->get_baseurl(true) . '/redir/' . $item['contact-id'];
$sparkle = ' class="sparkle" ';
}
+ else
+ $url = zrl($url);
if(! ((isset($arr[$item['parent'] . '-l'])) && (is_array($arr[$item['parent'] . '-l']))))
$arr[$item['parent'] . '-l'] = array();
if(! isset($arr[$item['parent']]))
@@ -879,7 +906,7 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$newpost' => 'true',
- '$baseurl' => $a->get_baseurl(),
+ '$baseurl' => $a->get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$geotag' => $geotag,
'$nickname' => $x['nickname'],
@@ -888,8 +915,8 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
'$vidurl' => t("Please enter a video link/URL:"),
'$audurl' => t("Please enter an audio link/URL:"),
'$term' => t('Tag term:'),
- '$whereareu' => t('Where are you right now?'),
- '$title' => t('Enter a title for this item')
+ '$fileas' => t('Save to Folder:'),
+ '$whereareu' => t('Where are you right now?')
));
@@ -929,8 +956,8 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
$o .= replace_macros($tpl,array(
'$return_path' => $a->cmd,
- '$action' => $a->get_baseurl().'/item',
- '$share' => (($x['button']) ? $x['button'] : t('Share')),
+ '$action' => $a->get_baseurl(true) . '/item',
+ '$share' => (x($x,'button') ? $x['button'] : t('Share')),
'$upload' => t('Upload photo'),
'$shortupload' => t('upload photo'),
'$attach' => t('Attach file'),
@@ -947,13 +974,15 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
'$shortnoloc' => t('clear location'),
'$title' => "",
'$placeholdertitle' => t('Set title'),
+ '$category' => "",
+ '$placeholdercategory' => t('Categories (comma-separated list)'),
'$wait' => t('Please wait'),
'$permset' => t('Permission settings'),
'$shortpermset' => t('permissions'),
'$ptyp' => (($notes_cid) ? 'note' : 'wall'),
'$content' => '',
'$post_id' => '',
- '$baseurl' => $a->get_baseurl(),
+ '$baseurl' => $a->get_baseurl(true),
'$defloc' => $x['default_location'],
'$visitor' => $x['visitor'],
'$pvisit' => (($notes_cid) ? 'none' : $x['visitor']),
@@ -995,8 +1024,8 @@ function conv_sort($arr,$order) {
usort($parents,'sort_thr_commented');
if(count($parents))
- foreach($parents as $x)
- $x['children'] = array();
+ foreach($parents as $i=>$_x)
+ $parents[$i]['children'] = array();
foreach($arr as $x) {
if($x['id'] != $x['parent']) {
diff --git a/include/cronhooks.php b/include/cronhooks.php
old mode 100755
new mode 100644
diff --git a/include/crypto.php b/include/crypto.php
old mode 100755
new mode 100644
diff --git a/include/datetime.php b/include/datetime.php
old mode 100755
new mode 100644
diff --git a/include/dba.php b/include/dba.php
old mode 100755
new mode 100644
index 7455b6b3ee..76cc0bc7b9
--- a/include/dba.php
+++ b/include/dba.php
@@ -1,5 +1,7 @@
debug)
- logger('dba: ' . printable(print_r($r, true)), LOGGER_DATA);
+ logger('dba: ' . printable(print_r($r, true)));
return($r);
}
@@ -207,8 +207,10 @@ function q($sql) {
unset($args[0]);
if($db && $db->connected) {
- $ret = $db->q(vsprintf($sql,$args));
- return $ret;
+ $stmt = vsprintf($sql,$args);
+ if($stmt === false)
+ logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true));
+ return $db->q($stmt);
}
/**
diff --git a/include/delivery.php b/include/delivery.php
old mode 100755
new mode 100644
index c1ff07bd54..794b8f27a3
--- a/include/delivery.php
+++ b/include/delivery.php
@@ -256,7 +256,8 @@ function delivery_run($argv, $argc){
'$picdate' => xmlify(datetime_convert('UTC','UTC',$owner['avatar-date'] . '+00:00' , ATOM_TIME)) ,
'$uridate' => xmlify(datetime_convert('UTC','UTC',$owner['uri-date'] . '+00:00' , ATOM_TIME)) ,
'$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , ATOM_TIME)) ,
- '$birthday' => $birthday
+ '$birthday' => $birthday,
+ '$community' => (($owner['page-flags'] == PAGE_COMMUNITY) ? '1 ' : '')
));
foreach($items as $item) {
@@ -320,6 +321,14 @@ function delivery_run($argv, $argc){
$x[0]['writable'] = 1;
}
+ $ssl_policy = get_config('system','ssl_policy');
+ fix_contact_ssl_policy($x[0],$ssl_policy);
+
+ // If we are setup as a soapbox we aren't accepting input from this person
+
+ if($x[0]['page-flags'] == PAGE_SOAPBOX)
+ break;
+
require_once('library/simplepie/simplepie.inc');
logger('mod-delivery: local delivery');
local_delivery($x[0],$atom);
@@ -435,8 +444,8 @@ function delivery_run($argv, $argc){
$headers .= 'Reply-to: ' . $reply_to . "\n";
// for testing purposes: Collect exported mails
- $file = tempnam("/tmp/friendica/", "mail-out-");
- file_put_contents($file, json_encode($it));
+ // $file = tempnam("/tmp/friendica/", "mail-out-");
+ // file_put_contents($file, json_encode($it));
$headers .= 'Message-Id: <' . iri2msgid($it['uri']). '>' . "\n";
@@ -446,30 +455,16 @@ function delivery_run($argv, $argc){
if($it['uri'] !== $it['parent-uri']) {
$headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n";
- if(! strlen($it['title'])) {
+ if(!strlen($it['title'])) {
$r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1",
- dbesc($it['parent-uri'])
- );
- if(count($r)) {
- $subtitle = $r[0]['title'];
- if($subtitle) {
- if(strncasecmp($subtitle,'RE:',3))
- $subject = $subtitle;
- else
- $subject = 'Re: ' . $subtitle;
- }
- }
+ dbesc($it['parent-uri']));
+
+ if(count($r) AND ($r[0]['title'] != ''))
+ $subject = $r[0]['title'];
}
+ if(strncasecmp($subject,'RE:',3))
+ $subject = 'Re: '.$subject;
}
- /*$headers .= 'MIME-Version: 1.0' . "\n";
- //$headers .= 'Content-Type: text/html; charset=UTF-8' . "\n";
- $headers .= 'Content-Type: text/plain; charset=UTF-8' . "\n";
- $headers .= 'Content-Transfer-Encoding: 8bit' . "\n\n";
- $html = prepare_body($it);
- //$message = '' . $html . '';
- $message = html2plain($html);
- logger('notifier: email delivery to ' . $addr);
- mail($addr, $subject, $message, $headers);*/
email_send($addr, $subject, $headers, $it);
}
break;
diff --git a/include/diaspora.php b/include/diaspora.php
old mode 100755
new mode 100644
index dca857a198..06df9c24a4
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -9,6 +9,12 @@ require_once('include/queue_fn.php');
function diaspora_dispatch_public($msg) {
+ $enabled = intval(get_config('system','diaspora_enabled'));
+ if(! $enabled) {
+ logger('mod-diaspora: disabled');
+ return;
+ }
+
$r = q("SELECT `user`.* FROM `user` WHERE `user`.`uid` IN ( SELECT `contact`.`uid` FROM `contact` WHERE `contact`.`network` = '%s' AND `contact`.`addr` = '%s' ) AND `account_expired` = 0 ",
dbesc(NETWORK_DIASPORA),
dbesc($msg['author'])
@@ -29,6 +35,12 @@ function diaspora_dispatch($importer,$msg) {
$ret = 0;
+ $enabled = intval(get_config('system','diaspora_enabled'));
+ if(! $enabled) {
+ logger('mod-diaspora: disabled');
+ return;
+ }
+
// php doesn't like dashes in variable names
$msg['message'] = str_replace(
@@ -688,9 +700,9 @@ function diaspora_post($importer,$xml) {
// don't link tags that are already embedded in links
- if(preg_match('/\[(.*?)' . preg_quote($tag) . '(.*?)\]/',$body))
+ if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
continue;
- if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag) . '(.*?)\)/',$body))
+ if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
continue;
$basetag = str_replace('_',' ',substr($tag,1));
@@ -853,9 +865,9 @@ function diaspora_reshare($importer,$xml) {
// don't link tags that are already embedded in links
- if(preg_match('/\[(.*?)' . preg_quote($tag) . '(.*?)\]/',$body))
+ if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
continue;
- if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag) . '(.*?)\)/',$body))
+ if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
continue;
@@ -1094,9 +1106,9 @@ function diaspora_comment($importer,$xml,$msg) {
// don't link tags that are already embedded in links
- if(preg_match('/\[(.*?)' . preg_quote($tag) . '(.*?)\]/',$body))
+ if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
continue;
- if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag) . '(.*?)\)/',$body))
+ if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
continue;
@@ -1159,6 +1171,48 @@ function diaspora_comment($importer,$xml,$msg) {
proc_run('php','include/notifier.php','comment',$message_id);
}
+
+ $myconv = q("SELECT `author-link`, `author-avatar`, `parent` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `parent` != 0 ",
+ dbesc($parent_item['uri']),
+ intval($importer['uid'])
+ );
+
+ if(count($myconv)) {
+ $importer_url = $a->get_baseurl() . '/profile/' . $importer['nickname'];
+
+ 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;
+
+ require_once('include/enotify.php');
+
+ $conv_parent = $conv['parent'];
+
+ notification(array(
+ 'type' => NOTIFY_COMMENT,
+ 'notify_flags' => $importer['notify-flags'],
+ 'language' => $importer['language'],
+ 'to_name' => $importer['username'],
+ 'to_email' => $importer['email'],
+ 'uid' => $importer['uid'],
+ 'item' => $datarray,
+ 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id,
+ 'source_name' => $datarray['author-name'],
+ 'source_link' => $datarray['author-link'],
+ 'source_photo' => $datarray['author-avatar'],
+ 'verb' => ACTIVITY_POST,
+ 'otype' => 'item',
+ 'parent' => $conv_parent,
+
+ ));
+
+ // only send one notification
+ break;
+ }
+ }
return;
}
@@ -1695,7 +1749,7 @@ function diaspora_retraction($importer,$xml) {
contact_remove($contact['id']);
}
elseif($type === 'Post') {
- $r = q("select * from item where guid = '%s' and uid = %d limit 1",
+ $r = q("select * from item where guid = '%s' and uid = %d and not file like '%%[%%' limit 1",
dbesc('guid'),
intval($importer['uid'])
);
@@ -1743,7 +1797,7 @@ function diaspora_signed_retraction($importer,$xml,$msg) {
}
if($type === 'StatusMessage') {
- $r = q("select * from item where guid = '%s' and uid = %d limit 1",
+ $r = q("select * from item where guid = '%s' and uid = %d and not file like '%%[%%' limit 1",
dbesc($guid),
intval($importer['uid'])
);
@@ -1878,6 +1932,7 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
$images = array();
+ $title = $item['title'];
$body = $item['body'];
/*
@@ -1902,9 +1957,12 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
}
}
*/
-
$body = xmlify(html_entity_decode(bb2diaspora($body)));
+ if(strlen($title))
+ $body = xmlify('**' . html_entity_decode($title) . '**' . "\n") . $body;
+
+
if($item['attach']) {
$cnt = preg_match_all('/href=\"(.*?)\"(.*?)title=\"(.*?)\"/ism',$item['attach'],$matches,PREG_SET_ORDER);
if(cnt) {
@@ -2225,6 +2283,11 @@ function diaspora_send_mail($item,$owner,$contact) {
function diaspora_transmit($owner,$contact,$slap,$public_batch) {
+ $enabled = intval(get_config('system','diaspora_enabled'));
+ if(! $enabled) {
+ return 200;
+ }
+
$a = get_app();
$logid = random_string(4);
$dest_url = (($public_batch) ? $contact['batch'] : $contact['notify']);
diff --git a/include/directory.php b/include/directory.php
old mode 100755
new mode 100644
diff --git a/include/email.php b/include/email.php
old mode 100755
new mode 100644
index 659978b6ee..b43ae0dc1c
--- a/include/email.php
+++ b/include/email.php
@@ -1,5 +1,7 @@
parts) {
$ret['body'] = email_get_part($mbox,$uid,$struc,0, 'html');
+ $html = $ret['body'];
if (trim($ret['body']) == '')
$ret['body'] = email_get_part($mbox,$uid,$struc,0, 'plain');
@@ -107,6 +110,17 @@ function email_get_msg($mbox,$uid) {
else
$ret['body'] = $text;
}
+
+ $ret['body'] = removegpg($ret['body']);
+ $msg = removesig($ret['body']);
+ $ret['body'] = $msg['body'];
+ $ret['body'] = convertquote($ret['body'], $reply);
+
+ if (trim($html) != '')
+ $ret['body'] = removelinebreak($ret['body']);
+
+ $ret['body'] = unifyattributionline($ret['body']);
+
return $ret;
}
@@ -236,7 +250,7 @@ function email_header_encode($in_str, $charset) {
// remove trailing spacer and
// add start and end delimiters
- $spacer = preg_quote($spacer);
+ $spacer = preg_quote($spacer,'/');
$out_str = preg_replace("/" . $spacer . "$/", "", $out_str);
$out_str = $start . $out_str . $end;
}
diff --git a/include/enotify.php b/include/enotify.php
old mode 100755
new mode 100644
index a505f1f040..8385bdec59
--- a/include/enotify.php
+++ b/include/enotify.php
@@ -5,6 +5,12 @@ function notification($params) {
logger('notification: entry', LOGGER_DEBUG);
$a = get_app();
+
+ // from here on everything is in the recipients language
+
+ push_lang($params['language']);
+
+
$banner = t('Friendica Notification');
$product = FRIENDICA_PLATFORM;
$siteurl = z_path();
@@ -153,9 +159,33 @@ function notification($params) {
}
- // from here on everything is in the recipients language
+ if($params['type'] == NOTIFY_SYSTEM) {
+
+ }
+
+ $h = array(
+ 'params' => $params,
+ 'subject' => $subject,
+ 'preamble' => $preamble,
+ 'epreamble' => $epreamble,
+ 'body' => $body,
+ 'sitelink' => $sitelink,
+ 'tsitelink' => $tsitelink,
+ 'hsitelink' => $hsitelink,
+ 'itemlink' => $itemlink
+ );
+
+ call_hooks('enotify',$h);
+
+ $subject = $h['subject'];
+ $preamble = $h['preamble'];
+ $epreamble = $h['epreamble'];
+ $body = $h['body'];
+ $sitelink = $h['sitelink'];
+ $tsitelink = $h['tsitelink'];
+ $hsitelink = $h['hsitelink'];
+ $itemlink = $h['itemlink'];
- push_lang($params['language']);
require_once('include/html2bbcode.php');
@@ -207,8 +237,10 @@ function notification($params) {
);
if($r)
$notify_id = $r[0]['id'];
- else
+ else {
+ pop_lang();
return;
+ }
$itemlink = $a->get_baseurl() . '/notify/view/' . $notify_id;
$msg = replace_macros($epreamble,array('$itemlink' => $itemlink));
@@ -219,11 +251,10 @@ function notification($params) {
);
-
// send email notification if notification preferences permit
require_once('bbcode.php');
- if(intval($params['notify_flags']) & intval($params['type'])) {
+ if((intval($params['notify_flags']) & intval($params['type'])) || $params['type'] == NOTIFY_SYSTEM) {
logger('notification: sending notification email');
diff --git a/include/event.php b/include/event.php
old mode 100755
new mode 100644
index 4a9a9a0041..29202baddf
--- a/include/event.php
+++ b/include/event.php
@@ -163,7 +163,7 @@ function bbtoevent($s) {
if(preg_match("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",$s,$match))
$ev['adjust'] = $match[1];
$match = '';
- $ev['nofinish'] = (($ev['start'] && (!x($ev, 'finish') || !$ev['finish'])) ? 1 : 0);
+ $ev['nofinish'] = (((x($ev, 'start') && $ev['start']) && (!x($ev, 'finish') || !$ev['finish'])) ? 1 : 0);
return $ev;
}
diff --git a/include/expire.php b/include/expire.php
old mode 100755
new mode 100644
diff --git a/include/fcontact.php b/include/fcontact.php
old mode 100755
new mode 100644
diff --git a/include/group.php b/include/group.php
old mode 100755
new mode 100644
diff --git a/include/html2bbcode.php b/include/html2bbcode.php
old mode 100755
new mode 100644
index 442e386911..69ccf41b71
--- a/include/html2bbcode.php
+++ b/include/html2bbcode.php
@@ -142,14 +142,14 @@ function html2bbcode($message)
node2bbcode($doc, 'span', array('style'=>'font-style: italic;'), '[i]', '[/i]');
node2bbcode($doc, 'span', array('style'=>'font-weight: bold;'), '[b]', '[/b]');
- node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/', 'size'=>'/(\d+)/', 'color'=>'/(.+)/'), '[font=$1][size=$2][color=$3]', '[/color][/size][/font]');
+ /*node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/', 'size'=>'/(\d+)/', 'color'=>'/(.+)/'), '[font=$1][size=$2][color=$3]', '[/color][/size][/font]');
node2bbcode($doc, 'font', array('size'=>'/(\d+)/', 'color'=>'/(.+)/'), '[size=$1][color=$2]', '[/color][/size]');
node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/', 'size'=>'/(.+)/'), '[font=$1][size=$2]', '[/size][/font]');
node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/', 'color'=>'/(.+)/'), '[font=$1][color=$3]', '[/color][/font]');
node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/'), '[font=$1]', '[/font]');
node2bbcode($doc, 'font', array('size'=>'/(\d+)/'), '[size=$1]', '[/size]');
node2bbcode($doc, 'font', array('color'=>'/(.+)/'), '[color=$1]', '[/color]');
-
+*/
// Untested
//node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(.+?)[,;].*font-family:\s*(.+?)[,;].*color:\s*(.+?)[,;].*/'), '[size=$1][font=$2][color=$3]', '[/color][/font][/size]');
//node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(\d+)[,;].*/'), '[size=$1]', '[/size]');
@@ -191,13 +191,13 @@ function html2bbcode($message)
node2bbcode($doc, 'hr', array(), "[hr]", "");
- //node2bbcode($doc, 'table', array(), "", "");
- //node2bbcode($doc, 'tr', array(), "\n", "");
- //node2bbcode($doc, 'td', array(), "\t", "");
- node2bbcode($doc, 'table', array(), "[table]", "[/table]");
- node2bbcode($doc, 'th', array(), "[th]", "[/th]");
- node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]");
- node2bbcode($doc, 'td', array(), "[td]", "[/td]");
+ node2bbcode($doc, 'table', array(), "", "");
+ node2bbcode($doc, 'tr', array(), "\n", "");
+ node2bbcode($doc, 'td', array(), "\t", "");
+ //node2bbcode($doc, 'table', array(), "[table]", "[/table]");
+ //node2bbcode($doc, 'th', array(), "[th]", "[/th]");
+ //node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]");
+ //node2bbcode($doc, 'td', array(), "[td]", "[/td]");
node2bbcode($doc, 'h1', array(), "\n\n[size=xx-large][b]", "[/b][/size]\n");
node2bbcode($doc, 'h2', array(), "\n\n[size=x-large][b]", "[/b][/size]\n");
@@ -216,7 +216,7 @@ function html2bbcode($message)
node2bbcode($doc, 'audio', array('src'=>'/(.+)/'), '[audio]$1', '[/audio]');
node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), '[iframe]$1', '[/iframe]');
- node2bbcode($doc, 'code', array(), '[code]$1', '[/code]');
+ node2bbcode($doc, 'code', array(), '[code]', '[/code]');
$message = $doc->saveHTML();
diff --git a/include/html2plain.php b/include/html2plain.php
index 2a4cf66391..21261327db 100644
--- a/include/html2plain.php
+++ b/include/html2plain.php
@@ -1,9 +1,15 @@
(.*?)<\/a>/is';
+ preg_match_all($pattern, $message, $result, PREG_SET_ORDER);
+
+ $urls = array();
+ foreach ($result as $treffer) {
+ // A list of some links that should be ignored
+ $list = array("/user/", "/tag/", "/group/", "/profile/", "/search?search=", "mailto:", "/u/", "/node/",
+ "//facebook.com/profile.php?id=", "//plus.google.com/");
+ foreach ($list as $listitem)
+ if (strpos($treffer[1], $listitem) !== false)
+ $ignore = true;
+
+ if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/posts") !== false))
+ $ignore = false;
+
+ if (!$ignore)
+ $urls[$treffer[1]] = $treffer[1];
+ }
+ return($urls);
+}
+
+function html2plain($html, $wraplength = 75, $compact = false)
{
global $lang;
@@ -93,22 +121,16 @@ function html2plain($html)
$message = str_replace(array("\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"), array("<", ">", " ", " ", ""), $message);
$message = preg_replace('= [\s]*=i', " ", $message);
- // nach ... suchen, die ... miteinander vergleichen und bei Gleichheit durch ein einzelnes ... ersetzen.
- $pattern = '/(.*?)<\/a>/is';
- preg_match_all($pattern, $message, $result, PREG_SET_ORDER);
+ // Collecting all links
+ $urls = collecturls($message);
- foreach ($result as $treffer) {
- if ($treffer[1] == $treffer[2]) {
- $search = ''.$treffer[1].' ';
- $message = str_replace($search, $treffer[1], $message);
- }
- }
@$doc->loadHTML($message);
node2bbcode($doc, 'html', array(), '', '');
node2bbcode($doc, 'body', array(), '', '');
// MyBB-Auszeichnungen
+ /*
node2bbcode($doc, 'span', array('style'=>'text-decoration: underline;'), '_', '_');
node2bbcode($doc, 'span', array('style'=>'font-style: italic;'), '/', '/');
node2bbcode($doc, 'span', array('style'=>'font-weight: bold;'), '*', '*');
@@ -117,8 +139,12 @@ function html2plain($html)
node2bbcode($doc, 'b', array(), '*', '*');
node2bbcode($doc, 'i', array(), '/', '/');
node2bbcode($doc, 'u', array(), '_', '_');
+ */
- node2bbcode($doc, 'blockquote', array(), '[quote]', "[/quote]\n");
+ if ($compact)
+ node2bbcode($doc, 'blockquote', array(), "»", "«");
+ else
+ node2bbcode($doc, 'blockquote', array(), '[quote]', "[/quote]\n");
node2bbcode($doc, 'br', array(), "\n", '');
@@ -131,7 +157,7 @@ function html2plain($html)
//node2bbcode($doc, 'ol', array(), "\n[list=1]", "[/list]\n");
node2bbcode($doc, 'li', array(), "\n* ", "\n");
- node2bbcode($doc, 'hr', array(), str_repeat("-", 70), "");
+ node2bbcode($doc, 'hr', array(), "\n".str_repeat("-", 70)."\n", "");
node2bbcode($doc, 'tr', array(), "\n", "");
node2bbcode($doc, 'td', array(), "\t", "");
@@ -143,16 +169,25 @@ function html2plain($html)
node2bbcode($doc, 'h5', array(), "\n\n*", "*\n");
node2bbcode($doc, 'h6', array(), "\n\n*", "*\n");
- node2bbcode($doc, 'a', array('href'=>'/(.+)/'), ' $1', '', true);
- node2bbcode($doc, 'img', array('alt'=>'/(.+)/'), '$1', '');
- node2bbcode($doc, 'img', array('title'=>'/(.+)/'), '$1', '');
- node2bbcode($doc, 'img', array(), '', '');
- node2bbcode($doc, 'img', array('src'=>'/(.+)/'), '[img]$1', '[/img]');
+ // Problem: there is no reliable way to detect if it is a link to a tag or profile
+ //node2bbcode($doc, 'a', array('href'=>'/(.+)/'), ' $1 ', '', true);
+ node2bbcode($doc, 'a', array('href'=>'/(.+)/', 'rel'=>'oembed'), ' $1 ', '', true);
+ //node2bbcode($doc, 'img', array('alt'=>'/(.+)/'), '$1', '');
+ //node2bbcode($doc, 'img', array('title'=>'/(.+)/'), '$1', '');
+ //node2bbcode($doc, 'img', array(), '', '');
+ if (!$compact)
+ node2bbcode($doc, 'img', array('src'=>'/(.+)/'), '[img]$1', '[/img]');
+ else
+ node2bbcode($doc, 'img', array('src'=>'/(.+)/'), '', '');
+
+ node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), ' $1 ', '', true);
$message = $doc->saveHTML();
- $message = str_replace("[img]", "", $message);
- $message = str_replace("[/img]", "", $message);
+ if (!$compact) {
+ $message = str_replace("[img]", "", $message);
+ $message = str_replace("[/img]", "", $message);
+ }
// was ersetze ich da?
// Irgendein stoerrisches UTF-Zeug
@@ -168,12 +203,20 @@ function html2plain($html)
$message = html_entity_decode($message, ENT_QUOTES, 'UTF-8');
+ if (!$compact) {
+ $counter = 1;
+ foreach ($urls as $id=>$url)
+ if (strpos($message, $url) == false)
+ $message .= "\n".$url." ";
+ //$message .= "\n[".($counter++)."] ".$url;
+ }
+
do {
$oldmessage = $message;
$message = str_replace("\n\n\n", "\n\n", $message);
} while ($oldmessage != $message);
- $message = quotelevel(trim($message));
+ $message = quotelevel(trim($message), $wraplength);
return(trim($message));
}
diff --git a/include/items.php b/include/items.php
old mode 100755
new mode 100644
index a1254e165a..ee69605349
--- a/include/items.php
+++ b/include/items.php
@@ -7,14 +7,11 @@ require_once('include/crypto.php');
function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) {
- // default permissions - anonymous user
-
- if(! strlen($owner_nick))
- killme();
+ $sitefeed = ((strlen($owner_nick)) ? false : true); // not yet implemented, need to rewrite huge chunks of following logic
$public_feed = (($dfrn_id) ? false : true);
- $starred = false;
- $converse = false;
+ $starred = false; // not yet implemented, possible security issues
+ $converse = false;
if($public_feed && $a->argc > 2) {
for($x = 2; $x < $a->argc; $x++) {
@@ -25,10 +22,11 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
}
}
+ // default permissions - anonymous user
$sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '' ";
- $r = q("SELECT `contact`.*, `user`.`uid` AS `user_uid`, `user`.`nickname`, `user`.`timezone`
+ $r = q("SELECT `contact`.*, `user`.`uid` AS `user_uid`, `user`.`nickname`, `user`.`timezone`, `user`.`page-flags`
FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
WHERE `contact`.`self` = 1 AND `user`.`nickname` = '%s' LIMIT 1",
dbesc($owner_nick)
@@ -156,7 +154,8 @@ function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0)
'$picdate' => xmlify(datetime_convert('UTC','UTC',$owner['avatar-date'] . '+00:00' , ATOM_TIME)) ,
'$uridate' => xmlify(datetime_convert('UTC','UTC',$owner['uri-date'] . '+00:00' , ATOM_TIME)) ,
'$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , ATOM_TIME)) ,
- '$birthday' => ((strlen($birthday)) ? '' . xmlify($birthday) . ' ' : '')
+ '$birthday' => ((strlen($birthday)) ? '' . xmlify($birthday) . ' ' : ''),
+ '$community' => (($owner['page-flags'] == PAGE_COMMUNITY) ? '1 ' : '')
));
call_hooks('atom_feed', $atom);
@@ -417,7 +416,7 @@ function get_atom_elements($feed,$item) {
// the wild, by sanitising it and converting supported tags to bbcode before we rip out any remaining
// html.
- if((strpos($res['body'],'<') !== false) || (strpos($res['body'],'>') !== false)) {
+ if((strpos($res['body'],'<') !== false) && (strpos($res['body'],'>') !== false)) {
$res['body'] = reltoabs($res['body'],$base_url);
@@ -430,13 +429,21 @@ function get_atom_elements($feed,$item) {
// we shouldn't need a whitelist, because the bbcode converter
// will strip out any unsupported tags.
- // $config->set('HTML.Allowed', 'p,b,a[href],i');
$purifier = new HTMLPurifier($config);
$res['body'] = $purifier->purify($res['body']);
- $res['body'] = html2bbcode($res['body']);
+ $res['body'] = @html2bbcode($res['body']);
}
+ elseif(! $have_real_body) {
+
+ // it's not one of our messages and it has no tags
+ // so it's probably just text. We'll escape it just to be safe.
+
+ $res['body'] = escape_tags($res['body']);
+ }
+
+ // this tag is obsolete but we keep it for really old sites
$allow = $item->get_item_tags(NAMESPACE_DFRN,'comment-allow');
if($allow && $allow[0]['data'] == 1)
@@ -682,7 +689,7 @@ function item_store($arr,$force_parent = false) {
unset($arr['dsprsig']);
}
- if($arr['gravity'])
+ if(x($arr, 'gravity'))
$arr['gravity'] = intval($arr['gravity']);
elseif($arr['parent-uri'] === $arr['uri'])
$arr['gravity'] = 0;
@@ -742,6 +749,7 @@ function item_store($arr,$force_parent = false) {
if($arr['parent-uri'] === $arr['uri']) {
$parent_id = 0;
+ $parent_deleted = 0;
$allow_cid = $arr['allow_cid'];
$allow_gid = $arr['allow_gid'];
$deny_cid = $arr['deny_cid'];
@@ -800,6 +808,8 @@ function item_store($arr,$force_parent = false) {
logger('item_store: item parent was not found - ignoring item');
return 0;
}
+
+ $parent_deleted = 0;
}
}
@@ -1043,6 +1053,22 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
if(! $rino_enable)
$rino = 0;
+ $ssl_val = intval(get_config('system','ssl_policy'));
+ $ssl_policy = '';
+
+ switch($ssl_val){
+ case SSL_POLICY_FULL:
+ $ssl_policy = 'full';
+ break;
+ case SSL_POLICY_SELFSIGN:
+ $ssl_policy = 'self';
+ break;
+ case SSL_POLICY_NONE:
+ default:
+ $ssl_policy = 'none';
+ break;
+ }
+
$url = $contact['notify'] . '&dfrn_id=' . $idtosend . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . (($rino) ? '&rino=1' : '');
logger('dfrn_deliver: ' . $url);
@@ -1072,11 +1098,23 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
$postvars = array();
$sent_dfrn_id = hex2bin((string) $res->dfrn_id);
$challenge = hex2bin((string) $res->challenge);
+ $perm = (($res->perm) ? $res->perm : null);
$dfrn_version = (float) (($res->dfrn_version) ? $res->dfrn_version : 2.0);
$rino_allowed = ((intval($res->rino) === 1) ? 1 : 0);
+ $page = (($owner['page-flags'] == PAGE_COMMUNITY) ? 1 : 0);
$final_dfrn_id = '';
+ if($perm) {
+ if((($perm == 'rw') && (! intval($contact['writable'])))
+ || (($perm == 'r') && (intval($contact['writable'])))) {
+ q("update contact set writable = %d where id = %d limit 1",
+ intval(($perm == 'rw') ? 1 : 0),
+ intval($contact['id'])
+ );
+ $contact['writable'] = (string) 1 - intval($contact['writable']);
+ }
+ }
if(($contact['duplex'] && strlen($contact['pubkey']))
|| ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey']))
@@ -1115,6 +1153,11 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
$postvars['perm'] = 'r';
}
+ $postvars['ssl_policy'] = $ssl_policy;
+
+ if($page)
+ $postvars['page'] = '1';
+
if($rino && $rino_allowed && (! $dissolve)) {
$key = substr(random_string(),0,16);
$data = bin2hex(aes_encrypt($postvars['data'],$key));
@@ -1379,6 +1422,19 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
}
+ $community_page = 0;
+ $rawtags = $feed->get_feed_tags( NAMESPACE_DFRN, 'community');
+ if($rawtags) {
+ $community_page = intval($rawtags[0]['data']);
+ }
+ if(is_array($contact) && intval($contact['forum']) != $community_page) {
+ q("update contact set forum = %d where id = %d limit 1",
+ intval($community_page),
+ intval($contact['id'])
+ );
+ $contact['forum'] = (string) $community_page;
+ }
+
// process any deleted entries
@@ -1398,7 +1454,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
}
if($deleted && is_array($contact)) {
$r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join `contact` on `item`.`contact-id` = `contact`.`id`
- WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d LIMIT 1",
+ WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d AND NOT `item`.`file` LIKE '%%[%%' LIMIT 1",
dbesc($uri),
intval($importer['uid']),
intval($contact['id'])
@@ -1543,9 +1599,10 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
if(count($r)) {
if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) {
- $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($datarray['title']),
dbesc($datarray['body']),
+ dbesc($datarray['tag']),
dbesc(datetime_convert('UTC','UTC',$datarray['edited'])),
dbesc($item_id),
intval($importer['uid'])
@@ -1595,6 +1652,14 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
if((activity_match($datarray['verb'],ACTIVITY_LIKE)) || (activity_match($datarray['verb'],ACTIVITY_DISLIKE))) {
$datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE;
+ // only one like or dislike per person
+ $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1",
+ intval($datarray['uid']),
+ intval($datarray['contact-id']),
+ dbesc($datarray['verb'])
+ );
+ if($r && count($r))
+ continue;
}
if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) {
@@ -1680,9 +1745,10 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
if(count($r)) {
if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) {
- $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($datarray['title']),
dbesc($datarray['body']),
+ dbesc($datarray['tag']),
dbesc(datetime_convert('UTC','UTC',$datarray['edited'])),
dbesc($item_id),
intval($importer['uid'])
@@ -1747,6 +1813,18 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
+
+ if(! link_compare($datarray['owner-link'],$contact['url'])) {
+ // The item owner info is not our contact. It's OK and is to be expected if this is a tgroup delivery,
+ // but otherwise there's a possible data mixup on the sender's system.
+ // the tgroup delivery code called from item_store will correct it if it's a forum,
+ // but we're going to unconditionally correct it here so that the post will always be owned by our contact.
+ logger('consume_feed: Correcting item owner.', LOGGER_DEBUG);
+ $datarray['owner-name'] = $contact['name'];
+ $datarray['owner-link'] = $contact['url'];
+ $datarray['owner-avatar'] = $contact['thumb'];
+ }
+
$r = item_store($datarray);
continue;
@@ -1837,6 +1915,14 @@ function local_delivery($importer,$data) {
);
if(count($r)) {
$fid = $r[0]['id'];
+
+ // OK, we do. Do we already have an introduction for this person ?
+ $r = q("select id from intro where uid = %d and fid = %d limit 1",
+ intval($fsugg['uid']),
+ intval($fid)
+ );
+ if(count($r))
+ return 0;
}
if(! $fid)
$r = q("INSERT INTO `fcontact` ( `name`,`url`,`photo`,`request` ) VALUES ( '%s', '%s', '%s', '%s' ) ",
@@ -1857,6 +1943,7 @@ function local_delivery($importer,$data) {
else
return 0;
+
$hash = random_string();
$r = q("INSERT INTO `intro` ( `uid`, `fid`, `contact-id`, `note`, `hash`, `datetime`, `blocked` )
@@ -1942,6 +2029,19 @@ function local_delivery($importer,$data) {
// NOTREACHED
}
+
+ $community_page = 0;
+ $rawtags = $feed->get_feed_tags( NAMESPACE_DFRN, 'community');
+ if($rawtags) {
+ $community_page = intval($rawtags[0]['data']);
+ }
+ if(intval($importer['forum']) != $community_page) {
+ q("update contact set forum = %d where id = %d limit 1",
+ intval($community_page),
+ intval($importer['id'])
+ );
+ $importer['forum'] = (string) $community_page;
+ }
logger('local_delivery: feed item count = ' . $feed->get_item_quantity());
@@ -1964,7 +2064,7 @@ function local_delivery($importer,$data) {
if($deleted) {
$r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join contact on `item`.`contact-id` = `contact`.`id`
- WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d LIMIT 1",
+ WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d AND NOT `item`.`file` LIKE '%%[%%' LIMIT 1",
dbesc($uri),
intval($importer['importer_uid']),
intval($importer['id'])
@@ -1981,6 +2081,7 @@ function local_delivery($importer,$data) {
if(($item['verb'] === ACTIVITY_TAG) && ($item['object-type'] === ACTVITY_OBJ_TAGTERM)) {
$xo = parse_xml_string($item['object'],false);
$xt = parse_xml_string($item['target'],false);
+
if($xt->type === ACTIVITY_OBJ_NOTE) {
$i = q("select * from `item` where uri = '%s' and uid = %d limit 1",
dbesc($xt->id),
@@ -2136,6 +2237,14 @@ function local_delivery($importer,$data) {
$datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE;
$datarray['last-child'] = 0;
+ // only one like or dislike per person
+ $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1",
+ intval($datarray['uid']),
+ intval($datarray['contact-id']),
+ dbesc($datarray['verb'])
+ );
+ if($r && count($r))
+ continue;
}
if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) {
@@ -2251,9 +2360,10 @@ function local_delivery($importer,$data) {
if(count($r)) {
if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) {
- $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($datarray['title']),
dbesc($datarray['body']),
+ dbesc($datarray['tag']),
dbesc(datetime_convert('UTC','UTC',$datarray['edited'])),
dbesc($item_id),
intval($importer['importer_uid'])
@@ -2285,6 +2395,15 @@ function local_delivery($importer,$data) {
if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) {
$datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE;
+ // only one like or dislike per person
+ $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1",
+ intval($datarray['uid']),
+ intval($datarray['contact-id']),
+ dbesc($datarray['verb'])
+ );
+ if($r && count($r))
+ continue;
+
}
if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) {
@@ -2407,9 +2526,10 @@ function local_delivery($importer,$data) {
if(count($r)) {
if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) {
- $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `tag` = '%s', `edited` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($datarray['title']),
dbesc($datarray['body']),
+ dbesc($datarray['tag']),
dbesc(datetime_convert('UTC','UTC',$datarray['edited'])),
dbesc($item_id),
intval($importer['importer_uid'])
@@ -2439,6 +2559,18 @@ function local_delivery($importer,$data) {
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['importer_uid'];
$datarray['contact-id'] = $importer['id'];
+
+ if(! link_compare($datarray['owner-link'],$contact['url'])) {
+ // The item owner info is not our contact. It's OK and is to be expected if this is a tgroup delivery,
+ // but otherwise there's a possible data mixup on the sender's system.
+ // the tgroup delivery code called from item_store will correct it if it's a forum,
+ // but we're going to unconditionally correct it here so that the post will always be owned by our contact.
+ logger('local_delivery: Correcting item owner.', LOGGER_DEBUG);
+ $datarray['owner-name'] = $importer['senderName'];
+ $datarray['owner-link'] = $importer['url'];
+ $datarray['owner-avatar'] = $importer['thumb'];
+ }
+
$r = item_store($datarray);
continue;
}
@@ -2823,6 +2955,11 @@ function item_expire($uid,$days) {
foreach($r as $item) {
+ // don't expire filed items
+
+ if(strpos($item['file'],'[') !== false)
+ continue;
+
// Only expire posts, not photos and photo comments
if($expire_photos==0 && strlen($item['resource-id']))
diff --git a/include/message.php b/include/message.php
old mode 100755
new mode 100644
index 7ad80ae9c6..377d7c715b
--- a/include/message.php
+++ b/include/message.php
@@ -1,4 +1,5 @@
get_baseurl() . ':' . local_user() . ':' . $hash ;
+
+ $convid = 0;
+ $reply = false;
+
+ require_once('include/Scrape.php');
+
+ $me = probe_url($replyto);
+
+ if(! $me['name'])
+ return -2;
+
+ $conv_guid = get_guid();
+
+ $recip_handle = $recipient['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
+
+ $sender_nick = basename($replyto);
+ $sender_host = substr($replyto,strpos($replyto,'://')+3);
+ $sender_host = substr($sender_host,0,strpos($sender_host,'/'));
+ $sender_handle = $sender_nick . '@' . $sender_host;
+
+ $handles = $recip_handle . ';' . $sender_handle;
+
+ $r = q("insert into conv (uid,guid,creator,created,updated,subject,recips) values(%d, '%s', '%s', '%s', '%s', '%s', '%s') ",
+ intval(local_user()),
+ dbesc($conv_guid),
+ dbesc($sender_handle),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc($subject),
+ dbesc($handles)
+ );
+
+ $r = q("select * from conv where guid = '%s' and uid = %d limit 1",
+ dbesc($conv_guid),
+ intval($recipient['uid'])
+ );
+ if(count($r))
+ $convid = $r[0]['id'];
+
+ if(! $convid) {
+ logger('send message: conversation not found.');
+ return -4;
+ }
+
+ $r = q("INSERT INTO `mail` ( `uid`, `guid`, `convid`, `from-name`, `from-photo`, `from-url`,
+ `contact-id`, `title`, `body`, `seen`, `reply`, `replied`, `uri`, `parent-uri`, `created`, `unknown`)
+ VALUES ( %d, '%s', %d, '%s', '%s', '%s', %d, '%s', '%s', %d, %d, %d, '%s', '%s', '%s', %d )",
+ intval($recipient['uid']),
+ dbesc(get_guid()),
+ intval($convid),
+ dbesc($me['name']),
+ dbesc($me['photo']),
+ dbesc($me['url']),
+ 0,
+ dbesc($subject),
+ dbesc($body),
+ 0,
+ 0,
+ 0,
+ dbesc($uri),
+ dbesc($replyto),
+ datetime_convert(),
+ 1
+ );
+
+ return 0;
+
+}
diff --git a/include/msgclean.php b/include/msgclean.php
new file mode 100644
index 0000000000..eabb47788a
--- /dev/null
+++ b/include/msgclean.php
@@ -0,0 +1,225 @@
+\s.*?To: (.*?)\s*?Cc: (.*?)\s*?Sent: (.*?)\s.*?Subject: ([^\n].*)\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/----- Original Message -----\s.*?From: "([^<"].*?)" <(.*?)>\s.*?To: (.*?)\s*?Sent: (.*?)\s.*?Subject: ([^\n].*)\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/-------- Original-Nachricht --------\s*\['.$quote.'\]\nDatum: (.*?)\nVon: (.*?) <(.*?)>\nAn: (.*?)\nBetreff: (.*?)\n/i', "[".$quote."='$2']\n", $message);
+ $message = savereplace('/-------- Original-Nachricht --------\s*\['.$quote.'\]\sDatum: (.*?)\s.*Von: "([^<"].*?)" <(.*?)>\s.*An: (.*?)\n.*/i', "[".$quote."='$2']\n", $message);
+ $message = savereplace('/-------- Original-Nachricht --------\s*\['.$quote.'\]\nDatum: (.*?)\nVon: (.*?)\nAn: (.*?)\nBetreff: (.*?)\n/i', "[".$quote."='$2']\n", $message);
+
+ $message = savereplace('/-----Urspr.*?ngliche Nachricht-----\sVon: "([^<"].*?)" <(.*?)>\s.*Gesendet: (.*?)\s.*An: (.*?)\s.*Betreff: ([^\n].*?).*:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/-----Urspr.*?ngliche Nachricht-----\sVon: "([^<"].*?)" <(.*?)>\s.*Gesendet: (.*?)\s.*An: (.*?)\s.*Betreff: ([^\n].*?)\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/Am (.*?), schrieb (.*?):\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+
+ $message = savereplace('/Am .*?, \d+ .*? \d+ \d+:\d+:\d+ \+\d+\sschrieb\s(.*?)\s<(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/Am (.*?) schrieb (.*?) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+ $message = savereplace('/Am (.*?) schrieb <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+ $message = savereplace('/Am (.*?) schrieb (.*?):\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+ $message = savereplace('/Am (.*?) schrieb (.*?)\n(.*?):\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+
+ $message = savereplace('/(\d+)\/(\d+)\/(\d+) ([^<"].*?) <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message);
+
+ $message = savereplace('/On .*?, \d+ .*? \d+ \d+:\d+:\d+ \+\d+\s(.*?)\s<(.*?)>\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/On (.*?) at (.*?), (.*?)\s<(.*?)>\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$3']\n", $message);
+ $message = savereplace('/On (.*?)\n([^<].*?)\s<(.*?)>\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+ $message = savereplace('/On (.*?), (.*?), (.*?)\s<(.*?)>\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$3']\n", $message);
+ $message = savereplace('/On ([^,].*?), (.*?)\swrote:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+ $message = savereplace('/On (.*?), (.*?)\swrote\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+
+ // Der loescht manchmal den Body - was eigentlich unmoeglich ist
+ $message = savereplace('/On (.*?),(.*?),(.*?),(.*?), (.*?) wrote:\s*\['.$quote.'\]/i', "[".$quote."='$5']\n", $message);
+
+ $message = savereplace('/Zitat von ([^<].*?) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/Quoting ([^<].*?) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/From: "([^<"].*?)" <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/From: <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/Du \(([^)].*?)\) schreibst:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/--- (.*?) <.*?> schrieb am (.*?):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/--- (.*?) schrieb am (.*?):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/\* (.*?) <(.*?)> hat geschrieben:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/(.*?) <(.*?)> schrieb (.*?)\):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/(.*?) <(.*?)> schrieb am (.*?) um (.*):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/(.*?) schrieb am (.*?) um (.*):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/(.*?) \((.*?)\) schrieb:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+ $message = savereplace('/(.*?) schrieb:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/(.*?) <(.*?)> writes:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/(.*?) \((.*?)\) writes:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+ $message = savereplace('/(.*?) writes:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/\* (.*?) wrote:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/(.*?) wrote \(.*?\):\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/(.*?) wrote:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/([^<].*?) <.*?> hat am (.*?)\sum\s(.*)\sgeschrieben:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+
+ $message = savereplace('/(\d+)\/(\d+)\/(\d+) ([^<"].*?) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message);
+ $message = savereplace('/(\d+)\/(\d+)\/(\d+) (.*?) <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message);
+ $message = savereplace('/(\d+)\/(\d+)\/(\d+) <(.*?)>:\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message);
+ $message = savereplace('/(\d+)\/(\d+)\/(\d+) <(.*?)>\s*\['.$quote.'\]/i', "[".$quote."='$4']\n", $message);
+
+ $message = savereplace('/(.*?) <(.*?)> schrubselte:\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
+ $message = savereplace('/(.*?) \((.*?)\) schrubselte:\s*\['.$quote.'\]/i', "[".$quote."='$2']\n", $message);
+
+ }
+ return($message);
+}
+
+function removegpg($message)
+{
+
+ $pattern = '/(.*)\s*-----BEGIN PGP SIGNED MESSAGE-----\s*[\r\n].*Hash:.*?[\r\n](.*)'.
+ '[\r\n]\s*-----BEGIN PGP SIGNATURE-----\s*[\r\n].*'.
+ '[\r\n]\s*-----END PGP SIGNATURE-----(.*)/is';
+
+ preg_match($pattern, $message, $result);
+
+ $cleaned = trim($result[1].$result[2].$result[3]);
+
+ $cleaned = str_replace(array("\n- --\n", "\n- -"), array("\n-- \n", "\n-"), $cleaned);
+
+
+ if ($cleaned == '')
+ $cleaned = $message;
+
+ return($cleaned);
+}
+
+function removesig($message)
+{
+ $sigpos = strrpos($message, "\n-- \n");
+ $quotepos = strrpos($message, "[/quote]");
+
+ if ($sigpos == 0) {
+ // Speziell fuer web.de, die das als Trenner verwenden
+ $message = str_replace("\n___________________________________________________________\n", "\n-- \n", $message);
+ $sigpos = strrpos($message, "\n-- \n");
+ $quotepos = strrpos($message, "[/quote]");
+ }
+
+ // Sollte sich der Signaturtrenner innerhalb eines Quotes befinden
+ // wird keine Signaturtrennung ausgefuehrt
+ if (($sigpos < $quotepos) and ($sigpos != 0))
+ return(array('body' => $message, 'sig' => ''));
+
+ // To-Do: Regexp umstellen, so dass auf 1 oder kein Leerzeichen
+ // geprueft wird
+ //$message = str_replace("\n--\n", "\n-- \n", $message);
+
+ $pattern = '/(.*)[\r\n]-- [\r\n](.*)/is';
+
+ preg_match($pattern, $message, $result);
+
+ if (($result[1] != '') and ($result[2] != '')) {
+ $cleaned = trim($result[1])."\n";
+ $sig = trim($result[2]);
+ // '[hr][size=x-small][color=darkblue]'.trim($result[2]).'[/color][/size]';
+ } else {
+ $cleaned = $message;
+ $sig = '';
+ }
+
+ return(array('body' => $cleaned, 'sig' => $sig));
+}
+
+function removelinebreak($message)
+{
+ $arrbody = explode("\n", trim($message));
+
+ $lines = array();
+ $lineno = 0;
+
+ foreach($arrbody as $i => $line) {
+ $currquotelevel = 0;
+ $currline = $line;
+ while ((strlen($currline)>0) and ((substr($currline, 0, 1) == '>')
+ or (substr($currline, 0, 1) == ' '))) {
+ if (substr($currline, 0, 1) == '>')
+ $currquotelevel++;
+
+ $currline = ltrim(substr($currline, 1));
+ }
+
+ $quotelevel = 0;
+ $nextline = trim($arrbody[$i+1]);
+ while ((strlen($nextline)>0) and ((substr($nextline, 0, 1) == '>')
+ or (substr($nextline, 0, 1) == ' '))) {
+ if (substr($nextline, 0, 1) == '>')
+ $quotelevel++;
+
+ $nextline = ltrim(substr($nextline, 1));
+ }
+
+ $len = strlen($line);
+ $firstword = strpos($nextline.' ', ' ');
+
+ $specialchars = ((substr(trim($nextline), 0, 1) == '-') or
+ (substr(trim($nextline), 0, 1) == '=') or
+ (substr(trim($nextline), 0, 1) == '*') or
+ (substr(trim($nextline), 0, 1) == '·') or
+ (substr(trim($nextline), 0, 4) == '[url') or
+ (substr(trim($nextline), 0, 5) == '[size') or
+ (substr(trim($nextline), 0, 7) == 'http://') or
+ (substr(trim($nextline), 0, 8) == 'https://'));
+
+ if (!$specialchars)
+ $specialchars = ((substr(rtrim($line), -1) == '-') or
+ (substr(rtrim($line), -1) == '=') or
+ (substr(rtrim($line), -1) == '*') or
+ (substr(rtrim($line), -1) == '·') or
+ (substr(rtrim($line), -6) == '[/url]') or
+ (substr(rtrim($line), -7) == '[/size]'));
+
+ //if ($specialchars)
+ // echo ("Special\n");
+
+ if ($lines[$lineno] != '') {
+ if (substr($lines[$lineno], -1) != ' ')
+ $lines[$lineno] .= ' ';
+
+ while ((strlen($line)>0) and ((substr($line, 0, 1) == '>')
+ or (substr($line, 0, 1) == ' '))) {
+
+ $line = ltrim(substr($line, 1));
+ }
+
+ }
+ //else
+ // $lines[$lineno] = $quotelevel.'-'.$len.'-'.$firstword.'-';
+
+ $lines[$lineno] .= $line;
+ //if ((($len + $firstword < 68) and (substr($line, -1, 1) != ' '))
+ // or ($quotelevel != $currquotelevel) or $specialchars)
+ if (((substr($line, -1, 1) != ' '))
+ or ($quotelevel != $currquotelevel))
+ $lineno++;
+ }
+ return(implode("\n", $lines));
+
+}
+?>
diff --git a/include/nav.php b/include/nav.php
old mode 100755
new mode 100644
index 511ca07fc0..2c9c643a92
--- a/include/nav.php
+++ b/include/nav.php
@@ -8,6 +8,8 @@ function nav(&$a) {
*
*/
+ $ssl_state = ((local_user()) ? true : false);
+
if(!(x($a->page,'nav')))
$a->page['nav'] = '';
@@ -27,7 +29,7 @@ function nav(&$a) {
$myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : '');
- $sitelocation = $myident . substr($a->get_baseurl(),strpos($a->get_baseurl(),'//') + 2 );
+ $sitelocation = $myident . substr($a->get_baseurl($ssl_state),strpos($a->get_baseurl($ssl_state),'//') + 2 );
// nav links: array of array('href', 'text', 'extra css classes', 'title')
@@ -53,7 +55,7 @@ function nav(&$a) {
// user info
$r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid']));
$userinfo = array(
- 'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl()."/images/default-profile-mm.jpg"),
+ 'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl($ssl_state)."/images/person-48.jpg"),
'name' => $a->user['username'],
);
@@ -67,7 +69,9 @@ function nav(&$a) {
* "Home" should also take you home from an authenticated remote profile connection
*/
- $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
+ $homelink = get_my_url();
+ if(! $homelink)
+ $homelink = ((x($_SESSION,'visitor_home')) ? $_SESSION['visitor_home'] : '');
if(($a->module != 'home') && (! (local_user())))
$nav['home'] = array($homelink, t('Home'), "", t('Home Page'));
@@ -76,7 +80,7 @@ function nav(&$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() . '/help';
+ $help_url = $a->get_baseurl($ssl_state) . '/help';
if(! get_config('system','hide_help'))
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'));
@@ -122,6 +126,9 @@ function nav(&$a) {
}
$nav['messages'] = array('message', t('Messages'), "", t('Private mail'));
+ $nav['messages']['inbox'] = array('message', t('Inbox'), "", t('Inbox'));
+ $nav['messages']['outbox']= array('message/sent', t('Outbox'), "", t('Outbox'));
+ $nav['messages']['new'] = array('message/new', t('New Message'), "", t('New Message'));
if(is_array($a->identities) && count($a->identities) > 1) {
$nav['manage'] = array('manage', t('Manage'), "", t('Manage other pages'));
diff --git a/include/network.php b/include/network.php
old mode 100755
new mode 100644
index c72919dd8b..38d0980d50
--- a/include/network.php
+++ b/include/network.php
@@ -303,7 +303,7 @@ function webfinger_dfrn($s,&$hcard) {
if(! function_exists('webfinger')) {
-function webfinger($s) {
+function webfinger($s, $debug = false) {
$host = '';
if(strstr($s,'@')) {
$host = substr($s,strpos($s,'@') + 1);
@@ -328,7 +328,7 @@ function webfinger($s) {
}}
if(! function_exists('lrdd')) {
-function lrdd($uri) {
+function lrdd($uri, $debug = false) {
$a = get_app();
@@ -364,6 +364,9 @@ function lrdd($uri) {
logger('lrdd: host_meta: ' . $xml, LOGGER_DATA);
+ if(! stristr($xml,'get_hostname();
+ $localhost = str_replace('www.','',$a->get_hostname());
if(strpos($localhost,':'))
$localhost = substr($localhost,0,strpos($localhost,':'));
@@ -337,7 +337,9 @@ function notifier_run($argv, $argc){
'$picdate' => xmlify(datetime_convert('UTC','UTC',$owner['avatar-date'] . '+00:00' , ATOM_TIME)) ,
'$uridate' => xmlify(datetime_convert('UTC','UTC',$owner['uri-date'] . '+00:00' , ATOM_TIME)) ,
'$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , ATOM_TIME)) ,
- '$birthday' => $birthday
+ '$birthday' => $birthday,
+ '$community' => (($owner['page-flags'] == PAGE_COMMUNITY) ? '1 ' : '')
+
));
if($mail) {
@@ -535,6 +537,17 @@ function notifier_run($argv, $argc){
$x[0]['writable'] = 1;
}
+ // if contact's ssl policy changed, which we just determined
+ // is on our own server, update our contact links
+
+ $ssl_policy = get_config('system','ssl_policy');
+ fix_contact_ssl_policy($x[0],$ssl_policy);
+
+ // If we are setup as a soapbox we aren't accepting input from this person
+
+ if($x[0]['page-flags'] == PAGE_SOAPBOX)
+ break;
+
require_once('library/simplepie/simplepie.inc');
logger('mod-delivery: local delivery');
local_delivery($x[0],$atom);
@@ -648,38 +661,23 @@ function notifier_run($argv, $argc){
$headers .= 'Reply-to: ' . $reply_to . "\n";
// for testing purposes: Collect exported mails
- $file = tempnam("/tmp/friendica/", "mail-out2-");
- file_put_contents($file, json_encode($it));
+ //$file = tempnam("/tmp/friendica/", "mail-out2-");
+ //file_put_contents($file, json_encode($it));
$headers .= 'Message-Id: <' . iri2msgid($it['uri']) . '>' . "\n";
if($it['uri'] !== $it['parent-uri']) {
$headers .= 'References: <' . iri2msgid($it['parent-uri']) . '>' . "\n";
- if(! strlen($it['title'])) {
+ if(!strlen($it['title'])) {
$r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' LIMIT 1",
- dbesc($it['parent-uri'])
- );
- if(count($r)) {
- $subtitle = $r[0]['title'];
- if($subtitle) {
- if(strncasecmp($subtitle,'RE:',3))
- $subject = $subtitle;
- else
- $subject = 'Re: ' . $subtitle;
- }
- }
- }
- }
+ dbesc($it['parent-uri']));
- /*$headers .= 'MIME-Version: 1.0' . "\n";
- //$headers .= 'Content-Type: text/html; charset=UTF-8' . "\n";
- $headers .= 'Content-Type: text/plain; charset=UTF-8' . "\n";
- $headers .= 'Content-Transfer-Encoding: 8bit' . "\n\n";
- $html = prepare_body($it);
- //$message = '' . $html . '';
- $message = html2plain($html);
- logger('notifier: email delivery to ' . $addr);
- mail($addr, $subject, $message, $headers);*/
+ if(count($r) AND ($r[0]['title'] != ''))
+ $subject = $r[0]['title'];
+ }
+ if(strncasecmp($subject,'RE:',3))
+ $subject = 'Re: '.$subject;
+ }
email_send($addr, $subject, $headers, $it);
}
break;
diff --git a/include/oauth.php b/include/oauth.php
old mode 100755
new mode 100644
diff --git a/include/oembed.php b/include/oembed.php
old mode 100755
new mode 100644
index 5c3c595f57..1f45d28143
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -1,6 +1,6 @@
query("//link[@type='application/json+oembed']");
foreach($entries as $e){
$href = $e->getAttributeNode("href")->nodeValue;
- $txt = fetch_url($href);
+ $txt = fetch_url($href . '&maxwidth=425');
+ break;
}
}
}
@@ -43,7 +47,7 @@ function oembed_fetch_url($embedurl){
if ($txt==false || $txt==""){
// try oohembed service
- $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl);
+ $ourl = "http://oohembed.com/oohembed/?url=".urlencode($embedurl).'&maxwidth=425';
$txt = fetch_url($ourl);
}
@@ -62,7 +66,7 @@ function oembed_fetch_url($embedurl){
function oembed_format_object($j){
$embedurl = $j->embedurl;
- $jhtml = oembed_iframe($j->embedurl,$j->width,$j->height );
+ $jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null) );
$ret="";
switch ($j->type) {
case "video": {
diff --git a/include/pgettext.php b/include/pgettext.php
old mode 100755
new mode 100644
diff --git a/include/pidfile.php b/include/pidfile.php
new file mode 100644
index 0000000000..47df8d1f46
--- /dev/null
+++ b/include/pidfile.php
@@ -0,0 +1,32 @@
+_file = "$dir/$name.pid";
+
+ if (file_exists($this->_file)) {
+ $pid = trim(file_get_contents($this->_file));
+ if (posix_kill($pid, 0)) {
+ $this->_running = true;
+ }
+ }
+
+ if (! $this->_running) {
+ $pid = getmypid();
+ file_put_contents($this->_file, $pid);
+ }
+ }
+
+ public function __destruct() {
+ if ((! $this->_running) && file_exists($this->_file)) {
+ unlink($this->_file);
+ }
+ }
+
+ public function is_already_running() {
+ return $this->_running;
+ }
+}
+?>
diff --git a/include/plugin.php b/include/plugin.php
old mode 100755
new mode 100644
index 8280b1022e..8196e87561
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -17,7 +17,12 @@ function uninstall_plugin($plugin){
}}
if (! function_exists('install_plugin')){
-function install_plugin($plugin){
+function install_plugin($plugin) {
+
+ // silently fail if plugin was removed
+
+ if(! file_exists('addon/' . $plugin . '/' . $plugin . '.php'))
+ return false;
logger("Addons: installing " . $plugin);
$t = @filemtime('addon/' . $plugin . '/' . $plugin . '.php');
@include_once('addon/' . $plugin . '/' . $plugin . '.php');
@@ -32,9 +37,11 @@ function install_plugin($plugin){
intval($t),
$plugin_admin
);
+ return true;
}
else {
logger("Addons: FAILED installing " . $plugin);
+ return false;
}
}}
@@ -249,6 +256,7 @@ function get_theme_info($theme){
list($k,$v) = array_map("trim", explode(":",$l,2));
$k= strtolower($k);
if ($k=="author"){
+
$r=preg_match("|([^<]+)<([^>]+)>|", $v, $m);
if ($r) {
$info['author'][] = array('name'=>$m[1], 'link'=>$m[2]);
@@ -276,3 +284,13 @@ function get_theme_info($theme){
return $info;
}}
+
+function get_theme_screenshot($theme) {
+ $a = get_app();
+ $exts = array('.png','.jpg');
+ foreach($exts as $ext) {
+ if(file_exists('view/theme/' . $theme . '/screenshot' . $ext))
+ return($a->get_baseurl() . '/view/theme/' . $theme . '/screenshot' . $ext);
+ }
+ return($a->get_baseurl() . '/images/blank.png');
+}
diff --git a/include/poller.php b/include/poller.php
old mode 100755
new mode 100644
index cfbc46b87e..499483d007
--- a/include/poller.php
+++ b/include/poller.php
@@ -1,7 +1,6 @@
is_already_running()) {
+ logger("poller: Already running");
+ exit;
+ }
+ }
+
$a->set_baseurl(get_config('system','url'));
load_hooks();
@@ -70,6 +79,19 @@ function poller_run($argv, $argc){
// clear old cache
Cache::clear();
+ // clear item cache files if they are older than one day
+ $cache = get_config('system','itemcache');
+ if (($cache != '') and is_dir($cache)) {
+ if ($dh = opendir($cache)) {
+ while (($file = readdir($dh)) !== false) {
+ $fullpath = $cache."/".$file;
+ if ((filetype($fullpath) == "file") and filectime($fullpath) < (time() - 86400))
+ unlink($fullpath);
+ }
+ closedir($dh);
+ }
+ }
+
$manual_id = 0;
$generation = 0;
$hub_update = false;
@@ -141,7 +163,10 @@ function poller_run($argv, $argc){
if($manual_id)
$contact['last-update'] = '0000-00-00 00:00:00';
- if($contact['network'] === NETWORK_DFRN || $contact['network'] === NETWORK_OSTATUS)
+ if($contact['network'] === NETWORK_DFRN)
+ $contact['priority'] = 2;
+
+ if(!get_config('system','ostatus_use_priority') and ($contact['network'] === NETWORK_OSTATUS))
$contact['priority'] = 2;
if($contact['priority'] || $contact['subhub']) {
@@ -217,7 +242,7 @@ function poller_run($argv, $argc){
$importer_uid = $contact['uid'];
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
+ $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` LEFT JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
intval($importer_uid)
);
if(! count($r))
@@ -489,12 +514,17 @@ function poller_run($argv, $argc){
//$datarray['title'] = notags(trim($meta->subject));
$datarray['created'] = datetime_convert('UTC','UTC',$meta->date);
- $r = email_get_msg($mbox,$msg_uid);
+ // Is it reply?
+ $reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") or
+ (substr(strtolower($datarray['title']), 0, 3) == "re-") or
+ (raw_refs != ""));
+
+ $r = email_get_msg($mbox,$msg_uid, $reply);
if(! $r) {
logger("Mail: can't fetch msg ".$msg_uid);
continue;
}
- $datarray['body'] = escape_tags(convertquote($r['body'], false));
+ $datarray['body'] = escape_tags($r['body']);
logger("Mail: Importing ".$msg_uid);
diff --git a/include/profile_advanced.php b/include/profile_advanced.php
old mode 100755
new mode 100644
diff --git a/include/profile_selectors.php b/include/profile_selectors.php
old mode 100755
new mode 100644
diff --git a/include/profile_update.php b/include/profile_update.php
old mode 100755
new mode 100644
diff --git a/include/queue.php b/include/queue.php
old mode 100755
new mode 100644
index d312b50f5a..7e92705be2
--- a/include/queue.php
+++ b/include/queue.php
@@ -61,13 +61,18 @@ function queue_run($argv, $argc){
q("DELETE FROM `queue` WHERE `created` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
}
- if($queue_id)
+ if($queue_id) {
$r = q("SELECT `id` FROM `queue` WHERE `id` = %d LIMIT 1",
intval($queue_id)
);
- else
- $r = q("SELECT `id` FROM `queue` WHERE `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ");
+ }
+ else {
+ // For the first 12 hours we'll try to deliver every 15 minutes
+ // After that, we'll only attempt delivery once per hour.
+
+ $r = q("SELECT `id` FROM `queue` WHERE (( `created` > UTC_TIMESTAMP() - INTERVAL 12 HOUR && `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ) OR ( `last` < UTC_TIMESTAMP() - INTERVAL 1 HOUR ))");
+ }
if(! count($r)){
return;
}
diff --git a/include/queue_fn.php b/include/queue_fn.php
old mode 100755
new mode 100644
diff --git a/include/quoteconvert.php b/include/quoteconvert.php
index 3aee93234f..2a6d28370a 100644
--- a/include/quoteconvert.php
+++ b/include/quoteconvert.php
@@ -124,7 +124,7 @@ function removetofu($message)
}
if ($quotestart != 0) {
- $message = trim(substr($message, 0, $quotestart))."\n[collapsed]\n".substr($message, $quotestart+7, -8).'[/collapsed]';
+ $message = trim(substr($message, 0, $quotestart))."\n[spoiler]".substr($message, $quotestart+7, -8).'[/spoiler]';
}
return($message);
diff --git a/include/remoteupdate.php b/include/remoteupdate.php
old mode 100755
new mode 100644
diff --git a/include/salmon.php b/include/salmon.php
old mode 100755
new mode 100644
diff --git a/include/security.php b/include/security.php
old mode 100755
new mode 100644
index bc2c9f0bf8..66622fd331
--- a/include/security.php
+++ b/include/security.php
@@ -9,6 +9,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
$_SESSION['authenticated'] = 1;
$_SESSION['page_flags'] = $user_record['page-flags'];
$_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $user_record['nickname'];
+ $_SESSION['my_address'] = $user_record['nickname'] . '@' . substr($a->get_baseurl(),strpos($a->get_baseurl(),'://')+3);
$_SESSION['addr'] = $_SERVER['REMOTE_ADDR'];
$a->user = $user_record;
@@ -108,14 +109,18 @@ function can_write_wall(&$a,$owner) {
if(remote_user()) {
- // user remembered decision and avoid a DB lookup for each and every display item
+ // use remembered decision and avoid a DB lookup for each and every display item
// DO NOT use this function if there are going to be multiple owners
+ // We have a contact-id for an authenticated remote user, this block determines if the contact
+ // belongs to this page owner, and has the necessary permissions to post content
+
if($verified === 2)
return true;
elseif($verified === 1)
return false;
else {
+
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` LEFT JOIN `user` on `user`.`uid` = `contact`.`uid`
WHERE `contact`.`uid` = %d AND `contact`.`id` = %d AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `user`.`blockwall` = 0 AND `readonly` = 0 AND ( `contact`.`rel` IN ( %d , %d ) OR `user`.`page-flags` = %d ) LIMIT 1",
@@ -125,6 +130,7 @@ function can_write_wall(&$a,$owner) {
intval(CONTACT_IS_FRIEND),
intval(PAGE_COMMUNITY)
);
+
if(count($r)) {
$verified = 2;
return true;
@@ -197,7 +203,7 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) {
" AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' )
AND ( allow_gid = '' OR allow_gid REGEXP '%s' )
- AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s')
+ AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s')
",
intval($remote_user),
intval($remote_user),
@@ -207,4 +213,135 @@ function permissions_sql($owner_id,$remote_verified = false,$groups = null) {
}
}
return $sql;
+}
+
+
+function item_permissions_sql($owner_id,$remote_verified = false,$groups = null) {
+
+ $local_user = local_user();
+ $remote_user = remote_user();
+
+ /**
+ * Construct permissions
+ *
+ * default permissions - anonymous user
+ */
+
+ $sql = " AND allow_cid = ''
+ AND allow_gid = ''
+ AND deny_cid = ''
+ AND deny_gid = ''
+ AND private = 0
+ ";
+
+ /**
+ * Profile owner - everything is visible
+ */
+
+ if(($local_user) && ($local_user == $owner_id)) {
+ $sql = '';
+ }
+
+ /**
+ * Authenticated visitor. Unless pre-verified,
+ * check that the contact belongs to this $owner_id
+ * and load the groups the visitor belongs to.
+ * If pre-verified, the caller is expected to have already
+ * done this and passed the groups into this function.
+ */
+
+ elseif($remote_user) {
+
+ if(! $remote_verified) {
+ $r = q("SELECT id FROM contact WHERE id = %d AND uid = %d AND blocked = 0 LIMIT 1",
+ intval($remote_user),
+ intval($owner_id)
+ );
+ if(count($r)) {
+ $remote_verified = true;
+ $groups = init_groups_visitor($remote_user);
+ }
+ }
+ if($remote_verified) {
+
+ $gs = '<<>>'; // should be impossible to match
+
+ if(is_array($groups) && count($groups)) {
+ foreach($groups as $g)
+ $gs .= '|<' . intval($g) . '>';
+ }
+
+ $sql = sprintf(
+ " AND ( private = 0 OR ( private = 1 AND wall = 1 AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' )
+ AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' )
+ AND ( allow_gid = '' OR allow_gid REGEXP '%s' )
+ AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s')))
+ ",
+ intval($remote_user),
+ intval($remote_user),
+ dbesc($gs),
+ dbesc($gs)
+ );
+ }
+ }
+
+ return $sql;
+}
+
+
+/*
+ * Functions used to protect against Cross-Site Request Forgery
+ * The security token has to base on at least one value that an attacker can't know - here it's the session ID and the private key.
+ * In this implementation, a security token is reusable (if the user submits a form, goes back and resubmits the form, maybe with small changes;
+ * or if the security token is used for ajax-calls that happen several times), but only valid for a certain amout of time (3hours).
+ * The "typename" seperates the security tokens of different types of forms. This could be relevant in the following case:
+ * A security token is used to protekt a link from CSRF (e.g. the "delete this profile"-link).
+ * If the new page contains by any chance external elements, then the used security token is exposed by the referrer.
+ * Actually, important actions should not be triggered by Links / GET-Requests at all, but somethimes they still are,
+ * so this mechanism brings in some damage control (the attacker would be able to forge a request to a form of this type, but not to forms of other types).
+ */
+function get_form_security_token($typename = '') {
+ $a = get_app();
+
+ $timestamp = time();
+ $sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $timestamp . $typename);
+
+ return $timestamp . '.' . $sec_hash;
+}
+
+function check_form_security_token($typename = '', $formname = 'form_security_token') {
+ if (!x($_REQUEST, $formname)) return false;
+ $hash = $_REQUEST[$formname];
+
+ $max_livetime = 10800; // 3 hours
+
+ $a = get_app();
+
+ $x = explode('.', $hash);
+ if (time() > (IntVal($x[0]) + $max_livetime)) return false;
+
+ $sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename);
+
+ return ($sec_hash == $x[1]);
+}
+
+function check_form_security_std_err_msg() {
+ return t('The form security token was not correct. This probably happened because the form has been opened for too long (>3 hours) before subitting it.') . EOL;
+}
+function check_form_security_token_redirectOnErr($err_redirect, $typename = '', $formname = 'form_security_token') {
+ if (!check_form_security_token($typename, $formname)) {
+ $a = get_app();
+ logger('check_form_security_token failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
+ logger('check_form_security_token failed: _REQUEST data: ' . print_r($_REQUEST, true), LOGGER_DATA);
+ notice( check_form_security_std_err_msg() );
+ goaway($a->get_baseurl() . $err_redirect );
+ }
+}
+function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'form_security_token') {
+ if (!check_form_security_token($typename, $formname)) {
+ logger('check_form_security_token failed: user ' . $a->user['guid'] . ' - form element ' . $typename);
+ logger('check_form_security_token failed: _REQUEST data: ' . print_r($_REQUEST, true), LOGGER_DATA);
+ header('HTTP/1.1 403 Forbidden');
+ killme();
+ }
}
\ No newline at end of file
diff --git a/include/session.php b/include/session.php
old mode 100755
new mode 100644
diff --git a/include/socgraph.php b/include/socgraph.php
old mode 100755
new mode 100644
index 79d7340a4e..3f51940492
--- a/include/socgraph.php
+++ b/include/socgraph.php
@@ -230,19 +230,21 @@ function all_friends($uid,$cid,$start = 0, $limit = 80) {
-function suggestion_query($uid, $start = 0, $limit = 40) {
+function suggestion_query($uid, $start = 0, $limit = 80) {
if(! $uid)
return array();
$r = q("SELECT count(glink.gcid) as `total`, gcontact.* from gcontact
left join glink on glink.gcid = gcontact.id
- where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d)
+ where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d )
+ and not gcontact.name in ( select name from contact where uid = %d )
and not gcontact.id in ( select gcid from gcign where uid = %d )
group by glink.gcid order by total desc limit %d, %d ",
intval($uid),
intval($uid),
intval($uid),
+ intval($uid),
intval($start),
intval($limit)
);
@@ -252,11 +254,13 @@ function suggestion_query($uid, $start = 0, $limit = 40) {
$r2 = q("SELECT gcontact.* from gcontact
left join glink on glink.gcid = gcontact.id
- where glink.uid = 0 and glink.cid = 0 and not gcontact.nurl in ( select nurl from contact where uid = %d)
+ where glink.uid = 0 and glink.cid = 0 and not gcontact.nurl in ( select nurl from contact where uid = %d )
+ and not gcontact.name in ( select name from contact where uid = %d )
and not gcontact.id in ( select gcid from gcign where uid = %d )
order by rand() limit %d, %d ",
intval($uid),
intval($uid),
+ intval($uid),
intval($start),
intval($limit)
);
diff --git a/include/system_unavailable.php b/include/system_unavailable.php
old mode 100755
new mode 100644
diff --git a/include/template_processor.php b/include/template_processor.php
old mode 100755
new mode 100644
index 8671587fc4..46252c355f
--- a/include/template_processor.php
+++ b/include/template_processor.php
@@ -13,12 +13,14 @@
var $debug=false;
private function _preg_error(){
+
switch(preg_last_error()){
case PREG_INTERNAL_ERROR: echo('PREG_INTERNAL_ERROR'); break;
case PREG_BACKTRACK_LIMIT_ERROR: echo('PREG_BACKTRACK_LIMIT_ERROR'); break;
case PREG_RECURSION_LIMIT_ERROR: echo('PREG_RECURSION_LIMIT_ERROR'); break;
case PREG_BAD_UTF8_ERROR: echo('PREG_BAD_UTF8_ERROR'); break;
- case PREG_BAD_UTF8_OFFSET_ERROR: echo('PREG_BAD_UTF8_OFFSET_ERROR'); break;
+// This is only valid for php > 5.3, not certain how to code around it for unit tests
+// case PREG_BAD_UTF8_OFFSET_ERROR: echo('PREG_BAD_UTF8_OFFSET_ERROR'); break;
default:
//die("Unknown preg error.");
return;
@@ -80,8 +82,13 @@
*/
private function _replcb_for($args){
$m = array_map('trim', explode(" as ", $args[2]));
- list($keyname, $varname) = explode("=>",$m[1]);
- if (is_null($varname)) { $varname=$keyname; $keyname=""; }
+ $x = explode("=>",$m[1]);
+ if (count($x) == 1) {
+ $varname = $x[0];
+ $keyname = "";
+ } else {
+ list($keyname, $varname) = $x;
+ }
if ($m[0]=="" || $varname=="" || is_null($varname)) die("template error: 'for ".$m[0]." as ".$varname."'") ;
//$vals = $this->r[$m[0]];
$vals = $this->_get_var($m[0]);
@@ -91,7 +98,7 @@
$this->_push_stack();
$r = $this->r;
$r[$varname] = $v;
- if ($keyname!='') $r[$keyname] = $k;
+ if ($keyname!='') $r[$keyname] = (($k === 0) ? '0' : $k);
$ret .= $this->replace($args[3], $r);
$this->_pop_stack();
}
@@ -198,7 +205,7 @@
$os=$s; $count++;
$s = $this->var_replace($s);
}
- return template_unescape($s);
+ return $s;
}
}
diff --git a/include/text.php b/include/text.php
old mode 100755
new mode 100644
index 042ee982cb..aced9e0a81
--- a/include/text.php
+++ b/include/text.php
@@ -20,7 +20,7 @@ function replace_macros($s,$r) {
//$a = get_app();
//$a->page['debug'] .= "$tt \n";
- return $r;
+ return template_unescape($r);
}}
@@ -80,6 +80,9 @@ function escape_tags($string) {
if(! function_exists('autoname')) {
function autoname($len) {
+ if($len <= 0)
+ return '';
+
$vowels = array('a','a','ai','au','e','e','e','ee','ea','i','ie','o','ou','u');
if(mt_rand(0,5) == 4)
$vowels[] = 'y';
@@ -205,7 +208,6 @@ function hex2bin($s) {
return '';
if(! ctype_xdigit($s)) {
- logger('hex2bin: illegal input: ' . print_r(debug_backtrace(), true));
return($s);
}
@@ -226,6 +228,9 @@ if(! function_exists('paginate')) {
function paginate(&$a) {
$o = '';
$stripped = preg_replace('/(&page=[0-9]*)/','',$a->query_string);
+
+// $stripped = preg_replace('/&zrl=(.*?)([\?&]|$)/ism','',$stripped);
+
$stripped = str_replace('q=','',$stripped);
$stripped = trim($stripped,'/');
$pagenum = $a->pager['page'];
@@ -610,6 +615,8 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
$url = $redirect_url;
$sparkle = ' sparkle';
}
+ else
+ $url = zrl($url);
}
$click = ((x($contact,'click')) ? ' onclick="' . $contact['click'] . '" ' : '');
if($click)
@@ -638,7 +645,7 @@ if(! function_exists('search')) {
function search($s,$id='search-box',$url='/search',$save = false) {
$a = get_app();
$o = '';
}
+ $matches = false;
+ $cnt = preg_match_all('/<(.*?)>/',$item['file'],$matches,PREG_SET_ORDER);
+ if($cnt) {
+// logger('prepare_text: categories: ' . print_r($matches,true), LOGGER_DEBUG);
+ foreach($matches as $mtch) {
+ if(strlen($x))
+ $x .= ',';
+ $x .= xmlify(file_tag_decode($mtch[1]));
+ }
+ if(strlen($x))
+ $s .= '' . t('Categories:') . ' ' . $x . '
';
+ }
+ $matches = false;
+ $x = '';
+ $cnt = preg_match_all('/\[(.*?)\]/',$item['file'],$matches,PREG_SET_ORDER);
+ if($cnt) {
+// logger('prepare_text: filed_under: ' . print_r($matches,true), LOGGER_DEBUG);
+ foreach($matches as $mtch) {
+ if(strlen($x))
+ $x .= ' ';
+ $x .= xmlify(file_tag_decode($mtch[1])) . ' ' . t('[remove]') . ' ';
+ }
+ if(strlen($x) && (local_user() == $item['uid']))
+ $s .= '' . t('Filed under:') . ' ' . $x . '
';
+ }
+
+ // Look for spoiler
+ $spoilersearch = '';
+
+ // Remove line breaks before the spoiler
+ while ((strpos($s, "\n".$spoilersearch) !== false))
+ $s = str_replace("\n".$spoilersearch, $spoilersearch, $s);
+ while ((strpos($s, " ".$spoilersearch) !== false))
+ $s = str_replace(" ".$spoilersearch, $spoilersearch, $s);
+
+ while ((strpos($s, $spoilersearch) !== false)) {
+
+ $pos = strpos($s, $spoilersearch);
+ $rnd = random_string(8);
+ $spoilerreplace = ' '.sprintf(t('Click to open/close')).' '.
+ '';
+ $s = substr($s, 0, $pos).$spoilerreplace.substr($s, $pos+strlen($spoilersearch));
+ }
+
+ // Look for quote with author
+ $authorsearch = '';
+
+ while ((strpos($s, $authorsearch) !== false)) {
+
+ $pos = strpos($s, $authorsearch);
+ $rnd = random_string(8);
+ $authorreplace = ' '.sprintf(t('Click to open/close')).' '.
+ '';
+ $s = substr($s, 0, $pos).$authorreplace.substr($s, $pos+strlen($authorsearch));
+ }
+
$prep_arr = array('item' => $item, 'html' => $s);
call_hooks('prepare_body_final', $prep_arr);
+
return $prep_arr['html'];
}}
@@ -1231,4 +1302,207 @@ function item_post_type($item) {
return t('post');
}
+// post categories and "save to file" use the same item.file table for storage.
+// We will differentiate the different uses by wrapping categories in angle brackets
+// and save to file categories in square brackets.
+// To do this we need to escape these characters if they appear in our tag.
+
+function file_tag_encode($s) {
+ return str_replace(array('<','>','[',']'),array('%3c','%3e','%5b','%5d'),$s);
+}
+
+function file_tag_decode($s) {
+ return str_replace(array('%3c','%3e','%5b','%5d'),array('<','>','[',']'),$s);
+}
+
+function file_tag_file_query($table,$s,$type = 'file') {
+
+ if($type == 'file')
+ $str = preg_quote( '[' . str_replace('%','%%',file_tag_encode($s)) . ']' );
+ else
+ $str = preg_quote( '<' . str_replace('%','%%',file_tag_encode($s)) . '>' );
+ return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' ";
+}
+
+// ex. given music,video return or [music][video]
+function file_tag_list_to_file($list,$type = 'file') {
+ $tag_list = '';
+ if(strlen($list)) {
+ $list_array = explode(",",$list);
+ if($type == 'file') {
+ $lbracket = '[';
+ $rbracket = ']';
+ }
+ else {
+ $lbracket = '<';
+ $rbracket = '>';
+ }
+
+ foreach($list_array as $item) {
+ if(strlen($item)) {
+ $tag_list .= $lbracket . file_tag_encode(trim($item)) . $rbracket;
+ }
+ }
+ }
+ return $tag_list;
+}
+
+// ex. given [friends], return music,video or friends
+function file_tag_file_to_list($file,$type = 'file') {
+ $matches = false;
+ $list = '';
+ if($type == 'file') {
+ $cnt = preg_match_all('/\[(.*?)\]/',$file,$matches,PREG_SET_ORDER);
+ }
+ else {
+ $cnt = preg_match_all('/<(.*?)>/',$file,$matches,PREG_SET_ORDER);
+ }
+ if($cnt) {
+ foreach($matches as $mtch) {
+ if(strlen($list))
+ $list .= ',';
+ $list .= file_tag_decode($mtch[1]);
+ }
+ }
+
+ return $list;
+}
+
+function file_tag_update_pconfig($uid,$file_old,$file_new,$type = 'file') {
+ // $file_old - categories previously associated with an item
+ // $file_new - new list of categories for an item
+
+ if(! intval($uid))
+ return false;
+
+ if($file_old == $file_new)
+ return true;
+
+ $saved = get_pconfig($uid,'system','filetags');
+ if(strlen($saved)) {
+ if($type == 'file') {
+ $lbracket = '[';
+ $rbracket = ']';
+ }
+ else {
+ $lbracket = '<';
+ $rbracket = '>';
+ }
+
+ $filetags_updated = $saved;
+
+ // check for new tags to be added as filetags in pconfig
+ $new_tags = array();
+ $check_new_tags = explode(",",file_tag_file_to_list($file_new,$type));
+
+ foreach($check_new_tags as $tag) {
+ if(! stristr($saved,$lbracket . file_tag_encode($tag) . $rbracket))
+ $new_tags[] = $tag;
+ }
+
+ $filetags_updated .= file_tag_list_to_file(implode(",",$new_tags),$type);
+
+ // check for deleted tags to be removed from filetags in pconfig
+ $deleted_tags = array();
+ $check_deleted_tags = explode(",",file_tag_file_to_list($file_old,$type));
+
+ foreach($check_deleted_tags as $tag) {
+ if(! stristr($file_new,$lbracket . file_tag_encode($tag) . $rbracket))
+ $deleted_tags[] = $tag;
+ }
+
+ foreach($deleted_tags as $key => $tag) {
+ $r = q("select file from item where uid = %d " . file_tag_file_query('item',$tag,$type),
+ intval($uid)
+ );
+
+ if(count($r)) {
+ unset($deleted_tags[$key]);
+ }
+ else {
+ $filetags_updated = str_replace($lbracket . file_tag_encode($tag) . $rbracket,'',$filetags_updated);
+ }
+ }
+
+ if($saved != $filetags_updated) {
+ set_pconfig($uid,'system','filetags', $filetags_updated);
+ }
+ return true;
+ }
+ else
+ if(strlen($file_new)) {
+ set_pconfig($uid,'system','filetags', $file_new);
+ }
+ return true;
+}
+
+function file_tag_save_file($uid,$item,$file) {
+ $result = false;
+ if(! intval($uid))
+ return false;
+ $r = q("select file from item where id = %d and uid = %d limit 1",
+ intval($item),
+ intval($uid)
+ );
+ if(count($r)) {
+ if(! stristr($r[0]['file'],'[' . file_tag_encode($file) . ']'))
+ q("update item set file = '%s' where id = %d and uid = %d limit 1",
+ dbesc($r[0]['file'] . '[' . file_tag_encode($file) . ']'),
+ intval($item),
+ intval($uid)
+ );
+ $saved = get_pconfig($uid,'system','filetags');
+ if((! strlen($saved)) || (! stristr($saved,'[' . file_tag_encode($file) . ']')))
+ set_pconfig($uid,'system','filetags',$saved . '[' . file_tag_encode($file) . ']');
+ info( t('Item filed') );
+ }
+ return true;
+}
+
+function file_tag_unsave_file($uid,$item,$file) {
+ $result = false;
+ if(! intval($uid))
+ return false;
+
+ $pattern = '[' . file_tag_encode($file) . ']' ;
+
+ $r = q("select file from item where id = %d and uid = %d limit 1",
+ intval($item),
+ intval($uid)
+ );
+ if(! count($r))
+ return false;
+
+ q("update item set file = '%s' where id = %d and uid = %d limit 1",
+ dbesc(str_replace($pattern,'',$r[0]['file'])),
+ intval($item),
+ intval($uid)
+ );
+
+ $r = q("select file from item where uid = %d " . file_tag_file_query('item',$file),
+ intval($uid)
+ );
+
+ if(! count($r)) {
+ $saved = get_pconfig($uid,'system','filetags');
+ set_pconfig($uid,'system','filetags',str_replace($pattern,'',$saved));
+ }
+ return true;
+}
+
+function normalise_openid($s) {
+ return trim(str_replace(array('http://','https://'),array('',''),$s),'/');
+}
+
+
+function undo_post_tagging($s) {
+ $matches = null;
+ $cnt = preg_match_all('/([@#])\[url=(.*?)\](.*?)\[\/url\]/ism',$s,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s);
+ }
+ }
+ return $s;
+}
diff --git a/index.php b/index.php
old mode 100755
new mode 100644
index 5f6d74adb9..e7227962f4
--- a/index.php
+++ b/index.php
@@ -93,6 +93,10 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) {
load_translation_table($lang);
}
+if(x($_GET,'zrl')) {
+ $_SESSION['my_url'] = $_GET['zrl'];
+ $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string);
+}
/**
*
@@ -240,6 +244,8 @@ if (file_exists($theme_info_file)){
if(! x($a->page,'content'))
$a->page['content'] = '';
+if(! $install)
+ call_hooks('page_content_top',$a->page['content']);
/**
* Call module functions
@@ -342,13 +348,13 @@ $profile = $a->profile;
header("Content-type: text/html; charset=utf-8");
-$template = 'view/' . $lang . '/'
+$template = 'view/' . current_theme() . '/'
. ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php';
if(file_exists($template))
require_once($template);
else
- require_once(str_replace($lang . '/', '', $template));
+ require_once(str_replace(current_theme() . '/', '', $template));
session_write_close();
exit;
diff --git a/js/acl.js b/js/acl.js
old mode 100755
new mode 100644
diff --git a/js/ajaxupload.js b/js/ajaxupload.js
old mode 100755
new mode 100644
diff --git a/js/country.js b/js/country.js
old mode 100755
new mode 100644
index b18a529d1c..1c75055801
--- a/js/country.js
+++ b/js/country.js
@@ -52,7 +52,7 @@ aStates[28]="|Central|Chobe|Francistown|Gaborone|Ghanzi|Kgalagadi|Kgatleng|Kwene
aStates[29]="|Acre|Alagoas|Amapa|Amazonas|Bahia|Ceara|Distrito Federal|Espirito Santo|Goias|Maranhao|Mato Grosso|Mato Grosso do Sul|Minas Gerais|Para|Paraiba|Parana|Pernambuco|Piaui|Rio de Janeiro|Rio Grande do Norte|Rio Grande do Sul|Rondonia|Roraima|Santa Catarina|Sao Paulo|Sergipe|Tocantins";
aStates[30]="|Anegada|Jost Van Dyke|Tortola|Virgin Gorda";
aStates[31]="|Belait|Brunei and Muara|Temburong|Tutong";
-aStates[32]="|Blagoevgrad|Burgas|Dobrich|Gabrovo|Khaskovo|Kurdzhali|Kyustendil|Lovech|Montana|Pazardzhik|Pernik|Pleven|Plovdiv|Razgrad|Ruse|Shumen|Silistra|Sliven|Smolyan|Sofiya|Sofiya-Grad|Stara Zagora|Turgovishte|Varna|Veliko Turnovo|Vidin|Vratsa|Yambol";
+aStates[32]="|Blagoevgrad|Burgas|Dobrich|Gabrovo|Haskovo|Kardzhali|Kyustendil|Lovech|Montana|Pazardzhik|Pernik|Pleven|Plovdiv|Razgrad|Rousse|Shumen|Silistra|Sliven|Smolyan|Sofia|Stara Zagora|Turgovishte|Varna|Veliko Turnovo|Vidin|Vratsa|Yambol";
aStates[33]="|Bale|Bam|Banwa|Bazega|Bougouriba|Boulgou|Boulkiemde|Comoe|Ganzourgou|Gnagna|Gourma|Houet|Ioba|Kadiogo|Kenedougou|Komandjari|Kompienga|Kossi|Koupelogo|Kouritenga|Kourweogo|Leraba|Loroum|Mouhoun|Nahouri|Namentenga|Naumbiel|Nayala|Oubritenga|Oudalan|Passore|Poni|Samentenga|Sanguie|Seno|Sissili|Soum|Sourou|Tapoa|Tuy|Yagha|Yatenga|Ziro|Zondomo|Zoundweogo";
aStates[34]="|Ayeyarwady|Bago|Chin State|Kachin State|Kayah State|Kayin State|Magway|Mandalay|Mon State|Rakhine State|Sagaing|Shan State|Tanintharyi|Yangon";
aStates[35]="|Bubanza|Bujumbura|Bururi|Cankuzo|Cibitoke|Gitega|Karuzi|Kayanza|Kirundo|Makamba|Muramvya|Muyinga|Mwaro|Ngozi|Rutana|Ruyigi";
@@ -105,7 +105,7 @@ aStates[79]="|Estuaire|Haut-Ogooue|Moyen-Ogooue|Ngounie|Nyanga|Ogooue-Ivindo|Ogo
aStates[80]="|Banjul|Central River|Lower River|North Bank|Upper River|Western";
aStates[81]="|Gaza Strip";
aStates[82]="|Abashis|Abkhazia or Ap'khazet'is Avtonomiuri Respublika (Sokhumi)|Adigenis|Ajaria or Acharis Avtonomiuri Respublika (Bat'umi)|Akhalgoris|Akhalk'alak'is|Akhalts'ikhis|Akhmetis|Ambrolauris|Aspindzis|Baghdat'is|Bolnisis|Borjomis|Ch'khorotsqus|Ch'okhatauris|Chiat'ura|Dedop'listsqaros|Dmanisis|Dushet'is|Gardabanis|Gori|Goris|Gurjaanis|Javis|K'arelis|K'ut'aisi|Kaspis|Kharagaulis|Khashuris|Khobis|Khonis|Lagodekhis|Lanch'khut'is|Lentekhis|Marneulis|Martvilis|Mestiis|Mts'khet'is|Ninotsmindis|Onis|Ozurget'is|P'ot'i|Qazbegis|Qvarlis|Rust'avi|Sach'kheris|Sagarejos|Samtrediis|Senakis|Sighnaghis|T'bilisi|T'elavis|T'erjolis|T'et'ritsqaros|T'ianet'is|Tqibuli|Ts'ageris|Tsalenjikhis|Tsalkis|Tsqaltubo|Vanis|Zestap'onis|Zugdidi|Zugdidis";
-aStates[83]="|Baden-Wuerttemberg|Bayern|Berlin|Brandenburg|Bremen|Hamburg|Hessen|Mecklenburg-Vorpommern|Niedersachsen|Nordrhein-Westfalen|Rheinland-Pfalz|Saarland|Sachsen|Sachsen-Anhalt|Schleswig-Holstein|Thueringen";
+aStates[83]="|Baden-Württemberg|Bayern|Berlin|Brandenburg|Bremen|Hamburg|Hessen|Mecklenburg-Vorpommern|Niedersachsen|Nordrhein-Westfalen|Rheinland-Pfalz|Saarland|Sachsen|Sachsen-Anhalt|Schleswig-Holstein|Thüringen";
aStates[84]="|Ashanti|Brong-Ahafo|Central|Eastern|Greater Accra|Northern|Upper East|Upper West|Volta|Western";
aStates[85]="|Gibraltar";
aStates[86]="|Ile du Lys|Ile Glorieuse";
@@ -131,8 +131,8 @@ aStates[105]="|Andaman and Nicobar Islands|Andhra Pradesh|Arunachal Pradesh|Assa
aStates[106]="|Aceh|Bali|Banten|Bengkulu|East Timor|Gorontalo|Irian Jaya|Jakarta Raya|Jambi|Jawa Barat|Jawa Tengah|Jawa Timur|Kalimantan Barat|Kalimantan Selatan|Kalimantan Tengah|Kalimantan Timur|Kepulauan Bangka Belitung|Lampung|Maluku|Maluku Utara|Nusa Tenggara Barat|Nusa Tenggara Timur|Riau|Sulawesi Selatan|Sulawesi Tengah|Sulawesi Tenggara|Sulawesi Utara|Sumatera Barat|Sumatera Selatan|Sumatera Utara|Yogyakarta";
aStates[107]="|Ardabil|Azarbayjan-e Gharbi|Azarbayjan-e Sharqi|Bushehr|Chahar Mahall va Bakhtiari|Esfahan|Fars|Gilan|Golestan|Hamadan|Hormozgan|Ilam|Kerman|Kermanshah|Khorasan|Khuzestan|Kohgiluyeh va Buyer Ahmad|Kordestan|Lorestan|Markazi|Mazandaran|Qazvin|Qom|Semnan|Sistan va Baluchestan|Tehran|Yazd|Zanjan";
aStates[108]="|Al Anbar|Al Basrah|Al Muthanna|Al Qadisiyah|An Najaf|Arbil|As Sulaymaniyah|At Ta'mim|Babil|Baghdad|Dahuk|Dhi Qar|Diyala|Karbala'|Maysan|Ninawa|Salah ad Din|Wasit";
-aStates[109]="|Carlow|Cavan|Clare|Cork|Donegal|Dublin|Galway|Kerry|Kildare|Kilkenny|Laois|Leitrim|Limerick|Longford|Louth|Mayo|Meath|Monaghan|Offaly|Roscommon|Sligo|Tipperary|Waterford|Westmeath|Wexford|Wicklow";
-aStates[110]="|Antrim|Ards|Armagh|Ballymena|Ballymoney|Banbridge|Belfast|Carrickfergus|Castlereagh|Coleraine|Cookstown|Craigavon|Derry|Down|Dungannon|Fermanagh|Larne|Limavady|Lisburn|Magherafelt|Moyle|Newry and Mourne|Newtownabbey|North Down|Omagh|Strabane";
+aStates[109]="|Antrim|Armargh|Carlow|Cavan|Clare|Cork|Derry|Donegal|Down|Dún Laoghaire–Rathdown|Fermanagh|Dublin|Fingal|Galway|Kerry|Kildare|Kilkenny|Laois|Leitrim|Limerick|Longford|Louth|Mayo|Meath|Monaghan|Offaly|Roscommon|Sligo|Tipperary|Tyrone|Waterford|Westmeath|Wexford|Wicklow";
+aStates[110]="|Antrim|Armagh|Belfast|Down|Fermanagh|Londonderry|Tyrone";
aStates[111]="|Central|Haifa|Jerusalem|Northern|Southern|Tel Aviv";
aStates[112]="|Abruzzi|Basilicata|Calabria|Campania|Emilia-Romagna|Friuli-Venezia Giulia|Lazio|Liguria|Lombardia|Marche|Molise|Piemonte|Puglia|Sardegna|Sicilia|Toscana|Trentino-Alto Adige|Umbria|Valle d'Aosta|Veneto";
aStates[113]="|Clarendon|Hanover|Kingston|Manchester|Portland|Saint Andrew|Saint Ann|Saint Catherine|Saint Elizabeth|Saint James|Saint Mary|Saint Thomas|Trelawny|Westmoreland";
@@ -222,7 +222,7 @@ aStates[196]="|A'ana|Aiga-i-le-Tai|Atua|Fa'asaleleaga|Gaga'emauga|Gagaifomauga|P
aStates[197]="|Acquaviva|Borgo Maggiore|Chiesanuova|Domagnano|Faetano|Fiorentino|Monte Giardino|San Marino|Serravalle";
aStates[198]="|Principe|Sao Tome";
aStates[199]="|'Asir|Al Bahah|Al Hudud ash Shamaliyah|Al Jawf|Al Madinah|Al Qasim|Ar Riyad|Ash Sharqiyah (Eastern Province)|Ha'il|Jizan|Makkah|Najran|Tabuk";
-aStates[200]="|Aberdeen City|Aberdeenshire|Angus|Argyll and Bute|City of Edinburgh|Clackmannanshire|Dumfries and Galloway|Dundee City|East Ayrshire|East Dunbartonshire|East Lothian|East Renfrewshire|Eilean Siar (Western Isles)|Falkirk|Fife|Glasgow City|Highland|Inverclyde|Midlothian|Moray|North Ayrshire|North Lanarkshire|Orkney Islands|Perth and Kinross|Renfrewshire|Shetland Islands|South Ayrshire|South Lanarkshire|Stirling|The Scottish Borders|West Dunbartonshire|West Lothian";
+aStates[200]="|Aberdeenshire|Angus|Argyll|Ayrshire|Banffshire|Berwickshire|Bute|Caithness|Clackmannanshire|Cromartyshire|Dumfriesshire|Dunbartonshire|Dundee City|East Lothian|Edinburgh|Fife|Glasgow City|Inverness-shire|Kincardineshire|Kinross-shire|Kirkcudbrightshire|Lanarkshire|Midlothian|Moray|Nairnshire|Orkney Islands|Peeblesshire|Perthshire|Renfrewshire|Ross and Cromarty|Ross-shire|Roxburghshire|Selkirkshire|Shetland Islands|Stirlingshire|Sutherland|West Lothian|Wigtownshire";
aStates[201]="|Dakar|Diourbel|Fatick|Kaolack|Kolda|Louga|Saint-Louis|Tambacounda|Thies|Ziguinchor";
aStates[202]="|Anse aux Pins|Anse Boileau|Anse Etoile|Anse Louis|Anse Royale|Baie Lazare|Baie Sainte Anne|Beau Vallon|Bel Air|Bel Ombre|Cascade|Glacis|Grand' Anse (on Mahe)|Grand' Anse (on Praslin)|La Digue|La Riviere Anglaise|Mont Buxton|Mont Fleuri|Plaisance|Pointe La Rue|Port Glaud|Saint Louis|Takamaka";
aStates[203]="|Eastern|Northern|Southern|Western";
@@ -233,7 +233,7 @@ aStates[207]="|Bellona|Central|Choiseul (Lauru)|Guadalcanal|Honiara|Isabel|Makir
aStates[208]="|Awdal|Bakool|Banaadir|Bari|Bay|Galguduud|Gedo|Hiiraan|Jubbada Dhexe|Jubbada Hoose|Mudug|Nugaal|Sanaag|Shabeellaha Dhexe|Shabeellaha Hoose|Sool|Togdheer|Woqooyi Galbeed";
aStates[209]="|Eastern Cape|Free State|Gauteng|KwaZulu-Natal|Mpumalanga|North-West|Northern Cape|Northern Province|Western Cape";
aStates[210]="|Bird Island|Bristol Island|Clerke Rocks|Montagu Island|Saunders Island|South Georgia|Southern Thule|Traversay Islands";
-aStates[211]="|Andalucia|Aragon|Asturias|Baleares (Balearic Islands)|Canarias (Canary Islands)|Cantabria|Castilla y Leon|Castilla-La Mancha|Catalunya|Ceuta|Communidad Valencian|Extremadura|Galicia|Islas Chafarinas|La Rioja|Madrid|Melilla|Murcia|Navarra|Pais Vasco (Basque Country)|Penon de Alhucemas|Penon de Velez de la Gomera";
+aStates[211]="|Andalucia|Aragon|Asturias|Ceuta|Islas Baleares|Islas Chafarinas|Islas Canarias|Cantabria|Castilla y Leon|Castilla-La Mancha|Catalunya|Extremadura|Galicia|La Rioja|Madrid|Melilla|Murcia|Navarra|Pais Vasco|Peñón de Alhucemas|Peñón de Vélez de la Gomera|Valencia";
aStates[212]="|Spratly Islands";
aStates[213]="|Central|Eastern|North Central|North Eastern|North Western|Northern|Sabaragamuwa|Southern|Uva|Western";
aStates[214]="|A'ali an Nil|Al Bahr al Ahmar|Al Buhayrat|Al Jazirah|Al Khartum|Al Qadarif|Al Wahdah|An Nil al Abyad|An Nil al Azraq|Ash Shamaliyah|Bahr al Jabal|Gharb al Istiwa'iyah|Gharb Bahr al Ghazal|Gharb Darfur|Gharb Kurdufan|Janub Darfur|Janub Kurdufan|Junqali|Kassala|Nahr an Nil|Shamal Bahr al Ghazal|Shamal Darfur|Shamal Kurdufan|Sharq al Istiwa'iyah|Sinnar|Warab";
@@ -259,7 +259,7 @@ aStates[233]="|Tuvalu";
aStates[234]="|Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibale|Kiboga|Kisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungiri|Sembabule|Soroti|Tororo";
aStates[235]="|Avtonomna Respublika Krym (Simferopol')|Cherkas'ka (Cherkasy)|Chernihivs'ka (Chernihiv)|Chernivets'ka (Chernivtsi)|Dnipropetrovs'ka (Dnipropetrovs'k)|Donets'ka (Donets'k)|Ivano-Frankivs'ka (Ivano-Frankivs'k)|Kharkivs'ka (Kharkiv)|Khersons'ka (Kherson)|Khmel'nyts'ka (Khmel'nyts'kyy)|Kirovohrads'ka (Kirovohrad)|Kyyiv|Kyyivs'ka (Kiev)|L'vivs'ka (L'viv)|Luhans'ka (Luhans'k)|Mykolayivs'ka (Mykolayiv)|Odes'ka (Odesa)|Poltavs'ka (Poltava)|Rivnens'ka (Rivne)|Sevastopol'|Sums'ka (Sumy)|Ternopil's'ka (Ternopil')|Vinnyts'ka (Vinnytsya)|Volyns'ka (Luts'k)|Zakarpats'ka (Uzhhorod)|Zaporiz'ka (Zaporizhzhya)|Zhytomyrs'ka (Zhytomyr)"
aStates[236]="|'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn";
-aStates[237]="|Barking and Dagenham|Barnet|Barnsley|Bath and North East Somerset|Bedfordshire|Bexley|Birmingham|Blackburn with Darwen|Blackpool|Bolton|Bournemouth|Bracknell Forest|Bradford|Brent|Brighton and Hove|Bromley|Buckinghamshire|Bury|Calderdale|Cambridgeshire|Camden|Cheshire|City of Bristol|City of Kingston upon Hull|City of London|Cornwall|Coventry|Croydon|Cumbria|Darlington|Derby|Derbyshire|Devon|Doncaster|Dorset|Dudley|Durham|Ealing|East Riding of Yorkshire|East Sussex|Enfield|Essex|Gateshead|Gloucestershire|Greenwich|Hackney|Halton|Hammersmith and Fulham|Hampshire|Haringey|Harrow|Hartlepool|Havering|Herefordshire|Hertfordshire|Hillingdon|Hounslow|Isle of Wight|Islington|Kensington and Chelsea|Kent|Kingston upon Thames|Kirklees|Knowsley|Lambeth|Lancashire|Leeds|Leicester|Leicestershire|Lewisham|Lincolnshire|Liverpool|Luton|Manchester|Medway|Merton|Middlesbrough|Milton Keynes|Newcastle upon Tyne|Newham|Norfolk|North East Lincolnshire|North Lincolnshire|North Somerset|North Tyneside|North Yorkshire|Northamptonshire|Northumberland|Nottingham|Nottinghamshire|Oldham|Oxfordshire|Peterborough|Plymouth|Poole|Portsmouth|Reading|Redbridge|Redcar and Cleveland|Richmond upon Thames|Rochdale|Rotherham|Rutland|Salford|Sandwell|Sefton|Sheffield|Shropshire|Slough|Solihull|Somerset|South Gloucestershire|South Tyneside|Southampton|Southend-on-Sea|Southwark|St. Helens|Staffordshire|Stockport|Stockton-on-Tees|Stoke-on-Trent|Suffolk|Sunderland|Surrey|Sutton|Swindon|Tameside|Telford and Wrekin|Thurrock|Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham Forest|Wandsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and Maidenhead|Wirral|Wokingham|Wolverhampton|Worcestershire|York";
+aStates[237]="|Aberdeen|Aberdeenshire|Anglesey|Angus|Antrim|Argyl|Armagh|Avon|Ayrshire|Banffshire|Bedfordshire|Belfast|Berwickshire|Brecknockshire|Bristol|Buckinghamshire|Bute|Caernarfonshire|Cardiganshire|Caithness|Cambridgeshire|Carmarthenshire|Chesire|Clackmannashire|Cleveland|Clwyd|Cornwall|Cromartyshire|Cumberland|Cumbria|Denbighshire|Derbyshire|Devon|Dfyed|Dorset|Down|Dumfriesshire|Dunbartonshire|Dundee|Durham|East Lothian|East Suffolk|Derry|East Sussex|Edinburgh|Essex|Fermanagh|Fife|Flintshire|Glasgow|Glamorgan|Gloucestershire|Greater London|Greater Manchester|Gwent|Gwynedd|Hampshire|Hereford and Worcester|Herefordshire|Inverness-shire|Hertfordshire|Humberside|Huntingdon and Peterborough|Huntingdonshire|Isle of Ely|Isle of Wight|Kent|Kincardineshire|Kincross-shire|Kirkcudbrightshire|Lanarkshire|Lancashire|Leicestershire|Lincolnshire|London|Londonderry|Merionethshire|Merseyside|Middlesex|Mid Glamorgan|Midlothian|Monmouthshire|Montgomeryshire|Moray|Nairnshire|Norfolk|Northamptonshire|Northumberland|North Humberside|North Yorkshire|Nottinghamshire|Orkney|Oxfordshire|Peeblesshire|Pembrokeshire|Perthshire|Powys|Radnorshire|Renfrewshire|Ross And Cromarty|Ross-shire|Roxburghshire|Selkirkshire|Shetland|Stirlingshire|Sutherland|Soke of Peterborough|Rutland|Shropshire|Somerset|South Glamorgan|South Humberside|South Yorkshire|Staffordshite|Suffolk|Surrey|Sussex|Tyne and Wear|Tyrone|Warwickshire|West Glamorgan|West Lothian|West Midlands|Westmorland|West Suffolk|West Sussex|West Yorkshire|Wigtownshire|Wiltshire|Worcestershire|Yorkshire";
aStates[238]="|Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandu|Rio Negro|Rivera|Rocha|Salto|San Jose|Soriano|Tacuarembo|Treinta y Tres";
aStates[239]="|Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming";
aStates[240]="|Andijon Wiloyati|Bukhoro Wiloyati|Farghona Wiloyati|Jizzakh Wiloyati|Khorazm Wiloyati (Urganch)|Namangan Wiloyati|Nawoiy Wiloyati|Qashqadaryo Wiloyati (Qarshi)|Qoraqalpoghiston (Nukus)|Samarqand Wiloyati|Sirdaryo Wiloyati (Guliston)|Surkhondaryo Wiloyati (Termiz)|Toshkent Shahri|Toshkent Wiloyati";
@@ -267,7 +267,7 @@ aStates[241]="|Malampa|Penama|Sanma|Shefa|Tafea|Torba";
aStates[242]="|Amazonas|Anzoategui|Apure|Aragua|Barinas|Bolivar|Carabobo|Cojedes|Delta Amacuro|Dependencias Federales|Distrito Federal|Falcon|Guarico|Lara|Merida|Miranda|Monagas|Nueva Esparta|Portuguesa|Sucre|Tachira|Trujillo|Vargas|Yaracuy|Zulia";
aStates[243]="|An Giang|Ba Ria-Vung Tau|Bac Giang|Bac Kan|Bac Lieu|Bac Ninh|Ben Tre|Binh Dinh|Binh Duong|Binh Phuoc|Binh Thuan|Ca Mau|Can Tho|Cao Bang|Da Nang|Dac Lak|Dong Nai|Dong Thap|Gia Lai|Ha Giang|Ha Nam|Ha Noi|Ha Tay|Ha Tinh|Hai Duong|Hai Phong|Ho Chi Minh|Hoa Binh|Hung Yen|Khanh Hoa|Kien Giang|Kon Tum|Lai Chau|Lam Dong|Lang Son|Lao Cai|Long An|Nam Dinh|Nghe An|Ninh Binh|Ninh Thuan|Phu Tho|Phu Yen|Quang Binh|Quang Nam|Quang Ngai|Quang Ninh|Quang Tri|Soc Trang|Son La|Tay Ninh|Thai Binh|Thai Nguyen|Thanh Hoa|Thua Thien-Hue|Tien Giang|Tra Vinh|Tuyen Quang|Vinh Long|Vinh Phuc|Yen Bai";
aStates[244]="|Saint Croix|Saint John|Saint Thomas";
-aStates[245]="|Blaenau Gwent|Bridgend|Caerphilly|Cardiff|Carmarthenshire|Ceredigion|Conwy|Denbighshire|Flintshire|Gwynedd|Isle of Anglesey|Merthyr Tydfil|Monmouthshire|Neath Port Talbot|Newport|Pembrokeshire|Powys|Rhondda Cynon Taff|Swansea|The Vale of Glamorgan|Torfaen|Wrexham";
+aStates[245]="|Anglesey|Brecknockshire|Caernfonshire|Cardiganshire|Carmarthenshire|Clwyd|Denbighshire|Dyfed|Flintshire|Glamorgan|Gwent|Gwynedd|Merionethshire|Mid Glamorgan|Monmouthsire|Montgomeryshire|Pembrokeshire|Powys|Radnorshire|South Glamorgan|West Glamorgan";
aStates[246]="|Alo|Sigave|Wallis";
aStates[247]="|West Bank";
aStates[248]="|Western Sahara";
diff --git a/js/fk.autocomplete.js b/js/fk.autocomplete.js
old mode 100755
new mode 100644
index 509466bd98..b1db92c414
--- a/js/fk.autocomplete.js
+++ b/js/fk.autocomplete.js
@@ -14,22 +14,22 @@ function ACPopup(elm,backend_url){
this.kp_timer = false;
this.url = backend_url;
+ var w = 530;
+ var h = 130;
+
+
if(typeof elm.editorId == "undefined") {
style = $(elm).offset();
w = $(elm).width();
h = $(elm).height();
}
else {
- style = $(elm.container).offset();
- w = elm.container.offsetWidth;
- h = elm.container.offsetHeight;
- // Quick fix for chrome until I get a tool to inspect the dom
- // Chrome returns 0x0
- if(! w)
- w = 530;
- if(! h)
- h = 130;
-
+ var container = elm.getContainer();
+ if(typeof container != "undefined") {
+ style = $(container).offset();
+ w = $(container).width();
+ h = $(container).height();
+ }
}
style.top=style.top+h;
@@ -103,6 +103,7 @@ ACPopup.prototype._search = function(){
}
else {
txt = tinyMCE.activeEditor.getContent();
+ // alert(that.searchText + ':' + t);
newtxt = txt.replace(that.searchText,t+' ');
tinyMCE.activeEditor.setContent(newtxt);
tinyMCE.activeEditor.focus();
diff --git a/js/jquery.htmlstream.js b/js/jquery.htmlstream.js
old mode 100755
new mode 100644
diff --git a/js/jquery.js b/js/jquery.js
old mode 100755
new mode 100644
diff --git a/js/jquery.textinputs.js b/js/jquery.textinputs.js
old mode 100755
new mode 100644
diff --git a/js/main.js b/js/main.js
index c20455ad14..7f0428b5b5 100755
--- a/js/main.js
+++ b/js/main.js
@@ -16,6 +16,7 @@
document.getElementById(theID).style.display = "none"
}
+
var src = null;
var prev = null;
var livetime = null;
@@ -28,13 +29,15 @@
var in_progress = false;
var langSelect = false;
var commentBusy = false;
+ var last_popup_menu = null;
+ var last_popup_button = null;
$(function() {
$.ajaxSetup({cache: false});
msie = $.browser.msie ;
- /* setup tooltips */
+ /* setup tooltips *//*
$("a,.tt").each(function(){
var e = $(this);
var pos="bottom";
@@ -43,7 +46,7 @@
if (e.hasClass("ttleft")) pos="left";
if (e.hasClass("ttright")) pos="right";
e.tipTip({defaultPosition: pos, edgeOffset: 8});
- });
+ });*/
@@ -76,8 +79,23 @@
if (menu.attr('popup')=="false") return false;
$(this).parent().toggleClass("selected");
menu.toggle();
+ if (menu.css("display") == "none") {
+ last_popup_menu = null;
+ last_popup_button = null;
+ } else {
+ last_popup_menu = menu;
+ last_popup_button = $(this).parent();
+ }
return false;
});
+ $('html').click(function() {
+ if(last_popup_menu) {
+ last_popup_menu.hide();
+ last_popup_button.removeClass("selected");
+ last_popup_menu = null;
+ last_popup_button = null;
+ }
+ });
// fancyboxes
$("a.popupbox").fancybox({
@@ -101,9 +119,7 @@
var home = $(data).find('home').text();
if(home == 0) { home = ''; $('#home-update').removeClass('show') } else { $('#home-update').addClass('show') }
$('#home-update').html(home);
-
-
-
+
var intro = $(data).find('intro').text();
if(intro == 0) { intro = ''; $('#intro-update').removeClass('show') } else { $('#intro-update').addClass('show') }
$('#intro-update').html(intro);
@@ -111,6 +127,14 @@
var mail = $(data).find('mail').text();
if(mail == 0) { mail = ''; $('#mail-update').removeClass('show') } else { $('#mail-update').addClass('show') }
$('#mail-update').html(mail);
+
+ var intro = $(data).find('intro').text();
+ if(intro == 0) { intro = ''; $('#intro-update-li').removeClass('show') } else { $('#intro-update-li').addClass('show') }
+ $('#intro-update-li').html(intro);
+
+ var mail = $(data).find('mail').text();
+ if(mail == 0) { mail = ''; $('#mail-update-li').removeClass('show') } else { $('#mail-update-li').addClass('show') }
+ $('#mail-update-li').html(mail);
var eNotif = $(data).find('notif')
notif = eNotif.attr('count');
@@ -151,6 +175,12 @@
NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key
$(document).keydown(function(event) {
+ if(event.keyCode == '8') {
+ var target = event.target || event.srcElement;
+ if (!/input|textarea/i.test(target.nodeName)) {
+ return false;
+ }
+ }
if(event.keyCode == '19' || (event.ctrlKey && event.which == '32')) {
event.preventDefault();
if(stopped == false) {
@@ -486,9 +516,9 @@
return a.join('');
}
- function groupChangeMember(gid,cid) {
+ function groupChangeMember(gid, cid, sec_token) {
$('body .fakelink').css('cursor', 'wait');
- $.get('group/' + gid + '/' + cid, function(data) {
+ $.get('group/' + gid + '/' + cid + "?t=" + sec_token, function(data) {
$('#group-update-wrapper').html(data);
$('body .fakelink').css('cursor', 'auto');
});
@@ -573,3 +603,10 @@ Array.prototype.remove = function(item) {
return this.push.apply(this, rest);
};
+function previewTheme(elm) {
+ theme = $(elm).val();
+ $.getJSON('pretheme?f=&theme=' + theme,function(data) {
+ $('#theme-preview').html('' + data.desc + '
');
+ });
+
+}
\ No newline at end of file
diff --git a/js/webtoolkit.base64.js b/js/webtoolkit.base64.js
old mode 100755
new mode 100644
diff --git a/library/ASNValue.class.php b/library/ASNValue.class.php
old mode 100755
new mode 100644
diff --git a/library/HTML5/Data.php b/library/HTML5/Data.php
old mode 100755
new mode 100644
diff --git a/library/HTML5/InputStream.php b/library/HTML5/InputStream.php
old mode 100755
new mode 100644
diff --git a/library/HTML5/Parser.php b/library/HTML5/Parser.php
old mode 100755
new mode 100644
diff --git a/library/HTML5/Tokenizer.php b/library/HTML5/Tokenizer.php
old mode 100755
new mode 100644
diff --git a/library/HTML5/TreeBuilder.php b/library/HTML5/TreeBuilder.php
old mode 100755
new mode 100644
diff --git a/library/HTML5/named-character-references.ser b/library/HTML5/named-character-references.ser
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier.auto.php b/library/HTMLPurifier.auto.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier.autoload.php b/library/HTMLPurifier.autoload.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier.func.php b/library/HTMLPurifier.func.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier.includes.php b/library/HTMLPurifier.includes.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier.kses.php b/library/HTMLPurifier.kses.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier.path.php b/library/HTMLPurifier.path.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier.php b/library/HTMLPurifier.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier.safe-includes.php b/library/HTMLPurifier.safe-includes.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrCollections.php b/library/HTMLPurifier/AttrCollections.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef.php b/library/HTMLPurifier/AttrDef.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS.php b/library/HTMLPurifier/AttrDef/CSS.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php b/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Background.php b/library/HTMLPurifier/AttrDef/CSS/Background.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php b/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Border.php b/library/HTMLPurifier/AttrDef/CSS/Border.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Color.php b/library/HTMLPurifier/AttrDef/CSS/Color.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Composite.php b/library/HTMLPurifier/AttrDef/CSS/Composite.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php b/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Filter.php b/library/HTMLPurifier/AttrDef/CSS/Filter.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Font.php b/library/HTMLPurifier/AttrDef/CSS/Font.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/FontFamily.php b/library/HTMLPurifier/AttrDef/CSS/FontFamily.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php b/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Length.php b/library/HTMLPurifier/AttrDef/CSS/Length.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/ListStyle.php b/library/HTMLPurifier/AttrDef/CSS/ListStyle.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Multiple.php b/library/HTMLPurifier/AttrDef/CSS/Multiple.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Number.php b/library/HTMLPurifier/AttrDef/CSS/Number.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/Percentage.php b/library/HTMLPurifier/AttrDef/CSS/Percentage.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php b/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/CSS/URI.php b/library/HTMLPurifier/AttrDef/CSS/URI.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/Enum.php b/library/HTMLPurifier/AttrDef/Enum.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/Bool.php b/library/HTMLPurifier/AttrDef/HTML/Bool.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/Class.php b/library/HTMLPurifier/AttrDef/HTML/Class.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/Color.php b/library/HTMLPurifier/AttrDef/HTML/Color.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php b/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/ID.php b/library/HTMLPurifier/AttrDef/HTML/ID.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/Length.php b/library/HTMLPurifier/AttrDef/HTML/Length.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php b/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/MultiLength.php b/library/HTMLPurifier/AttrDef/HTML/MultiLength.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php b/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/HTML/Pixels.php b/library/HTMLPurifier/AttrDef/HTML/Pixels.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/Integer.php b/library/HTMLPurifier/AttrDef/Integer.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/Lang.php b/library/HTMLPurifier/AttrDef/Lang.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/Switch.php b/library/HTMLPurifier/AttrDef/Switch.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/Text.php b/library/HTMLPurifier/AttrDef/Text.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/URI.php b/library/HTMLPurifier/AttrDef/URI.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/URI/Email.php b/library/HTMLPurifier/AttrDef/URI/Email.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php b/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/URI/Host.php b/library/HTMLPurifier/AttrDef/URI/Host.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/URI/IPv4.php b/library/HTMLPurifier/AttrDef/URI/IPv4.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrDef/URI/IPv6.php b/library/HTMLPurifier/AttrDef/URI/IPv6.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform.php b/library/HTMLPurifier/AttrTransform.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/Background.php b/library/HTMLPurifier/AttrTransform/Background.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/BdoDir.php b/library/HTMLPurifier/AttrTransform/BdoDir.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/BgColor.php b/library/HTMLPurifier/AttrTransform/BgColor.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/BoolToCSS.php b/library/HTMLPurifier/AttrTransform/BoolToCSS.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/Border.php b/library/HTMLPurifier/AttrTransform/Border.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/EnumToCSS.php b/library/HTMLPurifier/AttrTransform/EnumToCSS.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/ImgRequired.php b/library/HTMLPurifier/AttrTransform/ImgRequired.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/ImgSpace.php b/library/HTMLPurifier/AttrTransform/ImgSpace.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/Input.php b/library/HTMLPurifier/AttrTransform/Input.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/Lang.php b/library/HTMLPurifier/AttrTransform/Lang.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/Length.php b/library/HTMLPurifier/AttrTransform/Length.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/Name.php b/library/HTMLPurifier/AttrTransform/Name.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/NameSync.php b/library/HTMLPurifier/AttrTransform/NameSync.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/SafeEmbed.php b/library/HTMLPurifier/AttrTransform/SafeEmbed.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/SafeObject.php b/library/HTMLPurifier/AttrTransform/SafeObject.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/SafeParam.php b/library/HTMLPurifier/AttrTransform/SafeParam.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/ScriptRequired.php b/library/HTMLPurifier/AttrTransform/ScriptRequired.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTransform/Textarea.php b/library/HTMLPurifier/AttrTransform/Textarea.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrTypes.php b/library/HTMLPurifier/AttrTypes.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/AttrValidator.php b/library/HTMLPurifier/AttrValidator.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Bootstrap.php b/library/HTMLPurifier/Bootstrap.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/CSSDefinition.php b/library/HTMLPurifier/CSSDefinition.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ChildDef.php b/library/HTMLPurifier/ChildDef.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ChildDef/Chameleon.php b/library/HTMLPurifier/ChildDef/Chameleon.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ChildDef/Custom.php b/library/HTMLPurifier/ChildDef/Custom.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ChildDef/Empty.php b/library/HTMLPurifier/ChildDef/Empty.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ChildDef/Optional.php b/library/HTMLPurifier/ChildDef/Optional.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ChildDef/Required.php b/library/HTMLPurifier/ChildDef/Required.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ChildDef/StrictBlockquote.php b/library/HTMLPurifier/ChildDef/StrictBlockquote.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ChildDef/Table.php b/library/HTMLPurifier/ChildDef/Table.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Config.php b/library/HTMLPurifier/Config.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema.php b/library/HTMLPurifier/ConfigSchema.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php b/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/Builder/Xml.php b/library/HTMLPurifier/ConfigSchema/Builder/Xml.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/Exception.php b/library/HTMLPurifier/ConfigSchema/Exception.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/Interchange.php b/library/HTMLPurifier/ConfigSchema/Interchange.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php b/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/Interchange/Id.php b/library/HTMLPurifier/ConfigSchema/Interchange/Id.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php b/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/Validator.php b/library/HTMLPurifier/ConfigSchema/Validator.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php b/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema.ser b/library/HTMLPurifier/ConfigSchema/schema.ser
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt b/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt b/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt b/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt b/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt b/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt b/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt b/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt b/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt b/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt b/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt b/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt b/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt b/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt b/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt b/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt b/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt b/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt b/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt b/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt b/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt b/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt b/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt b/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt b/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt b/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ConfigSchema/schema/info.ini b/library/HTMLPurifier/ConfigSchema/schema/info.ini
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ContentSets.php b/library/HTMLPurifier/ContentSets.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Context.php b/library/HTMLPurifier/Context.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Definition.php b/library/HTMLPurifier/Definition.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DefinitionCache.php b/library/HTMLPurifier/DefinitionCache.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DefinitionCache/Decorator.php b/library/HTMLPurifier/DefinitionCache/Decorator.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php b/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php b/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in b/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DefinitionCache/Null.php b/library/HTMLPurifier/DefinitionCache/Null.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DefinitionCache/Serializer.php b/library/HTMLPurifier/DefinitionCache/Serializer.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DefinitionCache/Serializer/README b/library/HTMLPurifier/DefinitionCache/Serializer/README
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DefinitionCacheFactory.php b/library/HTMLPurifier/DefinitionCacheFactory.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Doctype.php b/library/HTMLPurifier/Doctype.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/DoctypeRegistry.php b/library/HTMLPurifier/DoctypeRegistry.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ElementDef.php b/library/HTMLPurifier/ElementDef.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Encoder.php b/library/HTMLPurifier/Encoder.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/EntityLookup.php b/library/HTMLPurifier/EntityLookup.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/EntityLookup/entities.ser b/library/HTMLPurifier/EntityLookup/entities.ser
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/EntityParser.php b/library/HTMLPurifier/EntityParser.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ErrorCollector.php b/library/HTMLPurifier/ErrorCollector.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/ErrorStruct.php b/library/HTMLPurifier/ErrorStruct.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Exception.php b/library/HTMLPurifier/Exception.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Filter.php b/library/HTMLPurifier/Filter.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Filter/ExtractStyleBlocks.php b/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Filter/YouTube.php b/library/HTMLPurifier/Filter/YouTube.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Generator.php b/library/HTMLPurifier/Generator.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLDefinition.php b/library/HTMLPurifier/HTMLDefinition.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule.php b/library/HTMLPurifier/HTMLModule.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Bdo.php b/library/HTMLPurifier/HTMLModule/Bdo.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/CommonAttributes.php b/library/HTMLPurifier/HTMLModule/CommonAttributes.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Edit.php b/library/HTMLPurifier/HTMLModule/Edit.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Forms.php b/library/HTMLPurifier/HTMLModule/Forms.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Hypertext.php b/library/HTMLPurifier/HTMLModule/Hypertext.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Image.php b/library/HTMLPurifier/HTMLModule/Image.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Legacy.php b/library/HTMLPurifier/HTMLModule/Legacy.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/List.php b/library/HTMLPurifier/HTMLModule/List.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Name.php b/library/HTMLPurifier/HTMLModule/Name.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php b/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Object.php b/library/HTMLPurifier/HTMLModule/Object.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Presentation.php b/library/HTMLPurifier/HTMLModule/Presentation.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Proprietary.php b/library/HTMLPurifier/HTMLModule/Proprietary.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Ruby.php b/library/HTMLPurifier/HTMLModule/Ruby.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/SafeEmbed.php b/library/HTMLPurifier/HTMLModule/SafeEmbed.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/SafeObject.php b/library/HTMLPurifier/HTMLModule/SafeObject.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Scripting.php b/library/HTMLPurifier/HTMLModule/Scripting.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/StyleAttribute.php b/library/HTMLPurifier/HTMLModule/StyleAttribute.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Tables.php b/library/HTMLPurifier/HTMLModule/Tables.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Target.php b/library/HTMLPurifier/HTMLModule/Target.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Text.php b/library/HTMLPurifier/HTMLModule/Text.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Tidy.php b/library/HTMLPurifier/HTMLModule/Tidy.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Tidy/Name.php b/library/HTMLPurifier/HTMLModule/Tidy/Name.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php b/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Tidy/Strict.php b/library/HTMLPurifier/HTMLModule/Tidy/Strict.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php b/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php b/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php b/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php b/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/HTMLModuleManager.php b/library/HTMLPurifier/HTMLModuleManager.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/IDAccumulator.php b/library/HTMLPurifier/IDAccumulator.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Injector.php b/library/HTMLPurifier/Injector.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Injector/AutoParagraph.php b/library/HTMLPurifier/Injector/AutoParagraph.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Injector/DisplayLinkURI.php b/library/HTMLPurifier/Injector/DisplayLinkURI.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Injector/Linkify.php b/library/HTMLPurifier/Injector/Linkify.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Injector/PurifierLinkify.php b/library/HTMLPurifier/Injector/PurifierLinkify.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Injector/RemoveEmpty.php b/library/HTMLPurifier/Injector/RemoveEmpty.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php b/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Injector/SafeObject.php b/library/HTMLPurifier/Injector/SafeObject.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Language.php b/library/HTMLPurifier/Language.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Language/classes/en-x-test.php b/library/HTMLPurifier/Language/classes/en-x-test.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Language/messages/en-x-test.php b/library/HTMLPurifier/Language/messages/en-x-test.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Language/messages/en-x-testmini.php b/library/HTMLPurifier/Language/messages/en-x-testmini.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Language/messages/en.php b/library/HTMLPurifier/Language/messages/en.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/LanguageFactory.php b/library/HTMLPurifier/LanguageFactory.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Length.php b/library/HTMLPurifier/Length.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Lexer.php b/library/HTMLPurifier/Lexer.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Lexer/DOMLex.php b/library/HTMLPurifier/Lexer/DOMLex.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Lexer/DirectLex.php b/library/HTMLPurifier/Lexer/DirectLex.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Lexer/PEARSax3.php b/library/HTMLPurifier/Lexer/PEARSax3.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Lexer/PH5P.php b/library/HTMLPurifier/Lexer/PH5P.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/PercentEncoder.php b/library/HTMLPurifier/PercentEncoder.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Printer.php b/library/HTMLPurifier/Printer.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Printer/CSSDefinition.php b/library/HTMLPurifier/Printer/CSSDefinition.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Printer/ConfigForm.css b/library/HTMLPurifier/Printer/ConfigForm.css
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Printer/ConfigForm.js b/library/HTMLPurifier/Printer/ConfigForm.js
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Printer/ConfigForm.php b/library/HTMLPurifier/Printer/ConfigForm.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Printer/HTMLDefinition.php b/library/HTMLPurifier/Printer/HTMLDefinition.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/PropertyList.php b/library/HTMLPurifier/PropertyList.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/PropertyListIterator.php b/library/HTMLPurifier/PropertyListIterator.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Strategy.php b/library/HTMLPurifier/Strategy.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Strategy/Composite.php b/library/HTMLPurifier/Strategy/Composite.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Strategy/Core.php b/library/HTMLPurifier/Strategy/Core.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Strategy/FixNesting.php b/library/HTMLPurifier/Strategy/FixNesting.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Strategy/MakeWellFormed.php b/library/HTMLPurifier/Strategy/MakeWellFormed.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Strategy/RemoveForeignElements.php b/library/HTMLPurifier/Strategy/RemoveForeignElements.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Strategy/ValidateAttributes.php b/library/HTMLPurifier/Strategy/ValidateAttributes.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/StringHash.php b/library/HTMLPurifier/StringHash.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/StringHashParser.php b/library/HTMLPurifier/StringHashParser.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/TagTransform.php b/library/HTMLPurifier/TagTransform.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/TagTransform/Font.php b/library/HTMLPurifier/TagTransform/Font.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/TagTransform/Simple.php b/library/HTMLPurifier/TagTransform/Simple.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Token.php b/library/HTMLPurifier/Token.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Token/Comment.php b/library/HTMLPurifier/Token/Comment.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Token/Empty.php b/library/HTMLPurifier/Token/Empty.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Token/End.php b/library/HTMLPurifier/Token/End.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Token/Start.php b/library/HTMLPurifier/Token/Start.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Token/Tag.php b/library/HTMLPurifier/Token/Tag.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/Token/Text.php b/library/HTMLPurifier/Token/Text.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/TokenFactory.php b/library/HTMLPurifier/TokenFactory.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URI.php b/library/HTMLPurifier/URI.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIDefinition.php b/library/HTMLPurifier/URIDefinition.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIFilter.php b/library/HTMLPurifier/URIFilter.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIFilter/DisableExternal.php b/library/HTMLPurifier/URIFilter/DisableExternal.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIFilter/DisableExternalResources.php b/library/HTMLPurifier/URIFilter/DisableExternalResources.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIFilter/HostBlacklist.php b/library/HTMLPurifier/URIFilter/HostBlacklist.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIFilter/MakeAbsolute.php b/library/HTMLPurifier/URIFilter/MakeAbsolute.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIFilter/Munge.php b/library/HTMLPurifier/URIFilter/Munge.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIParser.php b/library/HTMLPurifier/URIParser.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIScheme.php b/library/HTMLPurifier/URIScheme.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIScheme/data.php b/library/HTMLPurifier/URIScheme/data.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIScheme/ftp.php b/library/HTMLPurifier/URIScheme/ftp.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIScheme/http.php b/library/HTMLPurifier/URIScheme/http.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIScheme/https.php b/library/HTMLPurifier/URIScheme/https.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIScheme/mailto.php b/library/HTMLPurifier/URIScheme/mailto.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIScheme/news.php b/library/HTMLPurifier/URIScheme/news.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URIScheme/nntp.php b/library/HTMLPurifier/URIScheme/nntp.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/URISchemeRegistry.php b/library/HTMLPurifier/URISchemeRegistry.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/UnitConverter.php b/library/HTMLPurifier/UnitConverter.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/VarParser.php b/library/HTMLPurifier/VarParser.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/VarParser/Flexible.php b/library/HTMLPurifier/VarParser/Flexible.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/VarParser/Native.php b/library/HTMLPurifier/VarParser/Native.php
old mode 100755
new mode 100644
diff --git a/library/HTMLPurifier/VarParserException.php b/library/HTMLPurifier/VarParserException.php
old mode 100755
new mode 100644
diff --git a/library/OAuth1.php b/library/OAuth1.php
old mode 100755
new mode 100644
diff --git a/library/asn1.php b/library/asn1.php
old mode 100755
new mode 100644
diff --git a/library/cropper/cropper.css b/library/cropper/cropper.css
old mode 100755
new mode 100644
diff --git a/library/cropper/cropper.html b/library/cropper/cropper.html
old mode 100755
new mode 100644
diff --git a/library/cropper/cropper.js b/library/cropper/cropper.js
old mode 100755
new mode 100644
diff --git a/library/cropper/cropper.uncompressed.js b/library/cropper/cropper.uncompressed.js
old mode 100755
new mode 100644
diff --git a/library/cropper/lib/builder.js b/library/cropper/lib/builder.js
old mode 100755
new mode 100644
diff --git a/library/cropper/lib/controls.js b/library/cropper/lib/controls.js
old mode 100755
new mode 100644
diff --git a/library/cropper/lib/dragdrop.js b/library/cropper/lib/dragdrop.js
old mode 100755
new mode 100644
diff --git a/library/cropper/lib/effects.js b/library/cropper/lib/effects.js
old mode 100755
new mode 100644
diff --git a/library/cropper/lib/prototype.js b/library/cropper/lib/prototype.js
old mode 100755
new mode 100644
diff --git a/library/cropper/lib/scriptaculous.js b/library/cropper/lib/scriptaculous.js
old mode 100755
new mode 100644
diff --git a/library/cropper/lib/slider.js b/library/cropper/lib/slider.js
old mode 100755
new mode 100644
diff --git a/library/cropper/lib/unittest.js b/library/cropper/lib/unittest.js
old mode 100755
new mode 100644
diff --git a/library/cropper/licence.txt b/library/cropper/licence.txt
old mode 100755
new mode 100644
diff --git a/library/cropper/marqueeHoriz.gif b/library/cropper/marqueeHoriz.gif
old mode 100755
new mode 100644
diff --git a/library/cropper/marqueeVert.gif b/library/cropper/marqueeVert.gif
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/castle.jpg b/library/cropper/tests/castle.jpg
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/castleMed.jpg b/library/cropper/tests/castleMed.jpg
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-Basic.htm b/library/cropper/tests/example-Basic.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-CSS-Absolute.htm b/library/cropper/tests/example-CSS-Absolute.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-CSS-Float.htm b/library/cropper/tests/example-CSS-Float.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-CSS-Relative.htm b/library/cropper/tests/example-CSS-Relative.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-CoordsOnLoad.htm b/library/cropper/tests/example-CoordsOnLoad.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-CoordsOnLoadWithRatio.htm b/library/cropper/tests/example-CoordsOnLoadWithRatio.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-Dimensions.htm b/library/cropper/tests/example-Dimensions.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-DynamicImage.htm b/library/cropper/tests/example-DynamicImage.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-FixedRatio.htm b/library/cropper/tests/example-FixedRatio.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-MinimumDimensions.htm b/library/cropper/tests/example-MinimumDimensions.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-MinimumWidth.htm b/library/cropper/tests/example-MinimumWidth.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/example-Preview.htm b/library/cropper/tests/example-Preview.htm
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/poppy.jpg b/library/cropper/tests/poppy.jpg
old mode 100755
new mode 100644
diff --git a/library/cropper/tests/staticHTMLStructure.htm b/library/cropper/tests/staticHTMLStructure.htm
old mode 100755
new mode 100644
diff --git a/library/facebook.php b/library/facebook.php
old mode 100755
new mode 100644
diff --git a/library/fancybox/blank.gif b/library/fancybox/blank.gif
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_close.png b/library/fancybox/fancy_close.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_loading.png b/library/fancybox/fancy_loading.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_nav_left.png b/library/fancybox/fancy_nav_left.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_nav_right.png b/library/fancybox/fancy_nav_right.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_shadow_e.png b/library/fancybox/fancy_shadow_e.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_shadow_n.png b/library/fancybox/fancy_shadow_n.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_shadow_ne.png b/library/fancybox/fancy_shadow_ne.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_shadow_nw.png b/library/fancybox/fancy_shadow_nw.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_shadow_s.png b/library/fancybox/fancy_shadow_s.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_shadow_se.png b/library/fancybox/fancy_shadow_se.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_shadow_sw.png b/library/fancybox/fancy_shadow_sw.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_shadow_w.png b/library/fancybox/fancy_shadow_w.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_title_left.png b/library/fancybox/fancy_title_left.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_title_main.png b/library/fancybox/fancy_title_main.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_title_over.png b/library/fancybox/fancy_title_over.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancy_title_right.png b/library/fancybox/fancy_title_right.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancybox-x.png b/library/fancybox/fancybox-x.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancybox-y.png b/library/fancybox/fancybox-y.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/fancybox.png b/library/fancybox/fancybox.png
old mode 100755
new mode 100644
diff --git a/library/fancybox/jquery.easing-1.3.pack.js b/library/fancybox/jquery.easing-1.3.pack.js
old mode 100755
new mode 100644
diff --git a/library/fancybox/jquery.fancybox-1.3.4.css b/library/fancybox/jquery.fancybox-1.3.4.css
old mode 100755
new mode 100644
diff --git a/library/fancybox/jquery.fancybox-1.3.4.js b/library/fancybox/jquery.fancybox-1.3.4.js
old mode 100755
new mode 100644
diff --git a/library/fancybox/jquery.fancybox-1.3.4.pack.js b/library/fancybox/jquery.fancybox-1.3.4.pack.js
old mode 100755
new mode 100644
diff --git a/library/fancybox/jquery.mousewheel-3.0.4.pack.js b/library/fancybox/jquery.mousewheel-3.0.4.pack.js
old mode 100755
new mode 100644
diff --git a/library/jgrowl/README b/library/jgrowl/README
old mode 100755
new mode 100644
diff --git a/library/jgrowl/jquery.jgrowl.css b/library/jgrowl/jquery.jgrowl.css
old mode 100755
new mode 100644
diff --git a/library/jgrowl/jquery.jgrowl_minimized.js b/library/jgrowl/jquery.jgrowl_minimized.js
old mode 100755
new mode 100644
diff --git a/library/mcefixes/README b/library/mcefixes/README
new file mode 100644
index 0000000000..578163a9d7
--- /dev/null
+++ b/library/mcefixes/README
@@ -0,0 +1,8 @@
+In order to make TinyMCE work smoothly with Friendica, the files in this directory are those few files we've changed in TinyMCE. We will attempt to keep them current, but if you decide to upgrade tinymce, it is best to save current copies of the files in question from the active tinymce tree and replace them or merge them after upgrade.
+
+Except for some simple theming, the primary changes are the advanced theme icon set, which we changed the "html" icon to "[]" to represent BBcode, and major changes have been made to the bbcode plugin.
+
+
+in TinyMCE 3.5b2 it appears that we are getting double linefeeds. Code has been put in place in mod/item.php and mod/message.php to reduce the duplicates.
+
+
diff --git a/library/mcefixes/plugins.bbcode.editor_plugin_src.js b/library/mcefixes/plugins.bbcode.editor_plugin_src.js
new file mode 100644
index 0000000000..a2829a21c1
--- /dev/null
+++ b/library/mcefixes/plugins.bbcode.editor_plugin_src.js
@@ -0,0 +1,258 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */
+
+(function() {
+ tinymce.create('tinymce.plugins.BBCodePlugin', {
+ init : function(ed, url) {
+ var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').toLowerCase();
+
+ ed.onBeforeSetContent.add(function(ed, o) {
+ o.content = t['_' + dialect + '_bbcode2html'](o.content);
+ });
+
+ ed.onPostProcess.add(function(ed, o) {
+ if (o.set)
+ o.content = t['_' + dialect + '_bbcode2html'](o.content);
+
+ if (o.get)
+ o.content = t['_' + dialect + '_html2bbcode'](o.content);
+ });
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'BBCode Plugin',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ },
+
+ // Private methods
+
+ // HTML -> BBCode in DFRN dialect
+ _dfrn_html2bbcode : function(s) {
+ s = tinymce.trim(s);
+
+ function rep(re, str) {
+
+ //modify code to keep stuff intact within [code][/code] blocks
+ //Waitman Gobble NO WARRANTY
+
+
+ var o = new Array();
+ var x = s.split("[code]");
+ var i = 0;
+
+ var si = "";
+ si = x.shift();
+ si = si.replace(re,str);
+ o.push(si);
+
+ for (i = 0; i < x.length; i++) {
+ var no = new Array();
+ var j = x.shift();
+ var g = j.split("[/code]");
+ no.push(g.shift());
+ si = g.shift();
+ si = si.replace(re,str);
+ no.push(si);
+ o.push(no.join("[/code]"));
+ }
+
+ s = o.join("[code]");
+
+ };
+
+
+
+
+ /* oembed */
+ function _h2b_cb(match) {
+ /*
+ function s_h2b(data) {
+ match = data;
+ }
+ $.ajax({
+ type:"POST",
+ url: 'oembed/h2b',
+ data: {text: match},
+ async: false,
+ success: s_h2b,
+ dataType: 'html'
+ });
+ */
+
+ var f, g, tof = [], tor = [];
+ var find_spanc = /]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;
+ while (f = find_spanc.exec(match)) {
+ var find_a = /]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;
+ if (g = find_a.exec(f[1])) {
+ var find_href = /href=[\"']([^\"']*)[\"']/ig;
+ var m2 = find_href.exec(g[1]);
+ if (m2[1]) {
+ tof.push(f[0]);
+ tor.push("[EMBED]" + m2[1] + "[/EMBED]");
+ }
+ }
+ }
+ for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);
+
+ return match;
+ }
+ if (s.indexOf('class="oembed')>=0){
+ //alert("request oembed html2bbcode");
+ s = _h2b_cb(s);
+ }
+
+ /* /oembed */
+
+
+ // example: to [b]
+ rep(/(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");
+ rep(/ (.*?)<\/a>/gi,"[url=$1]$2[/url]");
+ rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");
+ rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");
+ rep(/(.*?)<\/font>/gi,"$1");
+ rep(/ /gi,"[img=$1x$2]$3[/img]");
+ rep(/ /gi,"[img=$2x$1]$3[/img]");
+ rep(/ /gi,"[img=$3x$2]$1[/img]");
+ rep(/ /gi,"[img=$2x$3]$1[/img]");
+ rep(/ /gi,"[img]$1[/img]");
+
+ rep(/(.*?)<\/ul>/gi,"[list]$1[/list]");
+ rep(/(.*?)<\/ul>/gi,"[list=]$1[/list]");
+ rep(/(.*?)<\/ul>/gi,"[list=1]$1[/list]");
+ rep(/(.*?)<\/ul>/gi,"[list=i]$1[/list]");
+ rep(/(.*?)<\/ul>/gi,"[list=I]$1[/list]");
+ rep(/(.*?)<\/ul>/gi,"[list=a]$1[/list]");
+ rep(/(.*?)<\/ul>/gi,"[list=A]$1[/list]");
+ rep(/(.*?)<\/li>/gi,'[li]$1[/li]');
+
+ rep(/(.*?)<\/code>/gi,"[code]$1[/code]");
+ rep(/<\/(strong|b)>/gi,"[/b]");
+ rep(/<(strong|b)>/gi,"[b]");
+ rep(/<\/(em|i)>/gi,"[/i]");
+ rep(/<(em|i)>/gi,"[i]");
+ rep(/<\/u>/gi,"[/u]");
+ rep(/(.*?)<\/span>/gi,"[u]$1[/u]");
+ rep(//gi,"[u]");
+ rep(/]*>/gi,"[quote]");
+ rep(/<\/blockquote>/gi,"[/quote]");
+ rep(/ /gi,"[hr]");
+ rep(/ /gi,"\n\n");
+ rep(/ /gi,"\n\n");
+ rep(/ /gi,"\n");
+ rep(//gi,"");
+ rep(/<\/p>/gi,"\n");
+ rep(/ /gi," ");
+ rep(/"/gi,"\"");
+ rep(/</gi,"<");
+ rep(/>/gi,">");
+ rep(/&/gi,"&");
+
+ return s;
+ },
+
+ // BBCode -> HTML from DFRN dialect
+ _dfrn_bbcode2html : function(s) {
+ s = tinymce.trim(s);
+
+
+ function rep(re, str) {
+
+ //modify code to keep stuff intact within [code][/code] blocks
+ //Waitman Gobble NO WARRANTY
+
+
+ var o = new Array();
+ var x = s.split("[code]");
+ var i = 0;
+
+ var si = "";
+ si = x.shift();
+ si = si.replace(re,str);
+ o.push(si);
+
+ for (i = 0; i < x.length; i++) {
+ var no = new Array();
+ var j = x.shift();
+ var g = j.split("[/code]");
+ no.push(g.shift());
+ si = g.shift();
+ si = si.replace(re,str);
+ no.push(si);
+ o.push(no.join("[/code]"));
+ }
+
+ s = o.join("[code]");
+
+ };
+
+
+
+
+
+ // example: [b] to
+ rep(/\n/gi," ");
+ rep(/\[b\]/gi,"");
+ rep(/\[\/b\]/gi," ");
+ rep(/\[i\]/gi,"");
+ rep(/\[\/i\]/gi," ");
+ rep(/\[u\]/gi,"");
+ rep(/\[\/u\]/gi," ");
+ rep(/\[hr\]/gi," ");
+ rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"$2 ");
+ rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2 ");
+ rep(/\[url\](.*?)\[\/url\]/gi,"$1 ");
+ rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi," ");
+ rep(/\[img\](.*?)\[\/img\]/gi," ");
+
+ rep(/\[list\](.*?)\[\/list\]/gi, '');
+ rep(/\[list=\](.*?)\[\/list\]/gi, '');
+ rep(/\[list=1\](.*?)\[\/list\]/gi, '');
+ rep(/\[list=i\](.*?)\[\/list\]/gi,'');
+ rep(/\[list=I\](.*?)\[\/list\]/gi, '');
+ rep(/\[list=a\](.*?)\[\/list\]/gi, '');
+ rep(/\[list=A\](.*?)\[\/list\]/gi, '');
+ rep(/\[li\](.*?)\[\/li\]/gi, '$1 ');
+ rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2 ");
+ rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"$2 ");
+ rep(/\[code\](.*?)\[\/code\]/gi,"$1
");
+ rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 ");
+
+ /* oembed */
+ function _b2h_cb(match, url) {
+ url = bin2hex(url);
+ function s_b2h(data) {
+ match = data;
+ }
+ $.ajax({
+ url: 'oembed/b2h?url=' + url,
+ async: false,
+ success: s_b2h,
+ dataType: 'html'
+ });
+ return match;
+ }
+ s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
+
+ /* /oembed */
+
+ return s;
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
+})();
diff --git a/library/mcefixes/themes.advanced.img.icons.gif b/library/mcefixes/themes.advanced.img.icons.gif
new file mode 100644
index 0000000000..efb356c417
Binary files /dev/null and b/library/mcefixes/themes.advanced.img.icons.gif differ
diff --git a/library/mcefixes/themes.advanced.skins.default.dialog.css b/library/mcefixes/themes.advanced.skins.default.dialog.css
new file mode 100644
index 0000000000..f01222650e
--- /dev/null
+++ b/library/mcefixes/themes.advanced.skins.default.dialog.css
@@ -0,0 +1,117 @@
+/* Generic */
+body {
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
+scrollbar-3dlight-color:#F0F0EE;
+scrollbar-arrow-color:#676662;
+scrollbar-base-color:#F0F0EE;
+scrollbar-darkshadow-color:#DDDDDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+background:#F0F0EE;
+padding:0;
+margin:8px 8px 0 8px;
+}
+
+html {background:#F0F0EE;}
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+textarea {resize:none;outline:none;}
+a:link, a:visited {color:black;}
+a:hover {color:#2B6FB6;}
+.nowrap {white-space: nowrap}
+
+/* Forms */
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
+legend {color:#2B6FB6; font-weight:bold;}
+label.msg {display:none;}
+label.invalid {color:#EE0000; display:inline;}
+input.invalid {border:1px solid #EE0000;}
+input {background:#FFF; border:1px solid #CCC;}
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+input, select, textarea {border:1px solid #808080;}
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
+.input_noborder {border:0;}
+
+/* Buttons */
+#insert, #cancel, input.button, .updateButton {
+border:0; margin:0; padding:0;
+font-weight:bold;
+width:94px; height:26px;
+background:url(img/buttons.png) 0 -26px;
+cursor:pointer;
+padding-bottom:2px;
+float:left;
+}
+
+#insert {background:url(img/buttons.png) 0 -52px}
+#cancel {background:url(img/buttons.png) 0 0; float:right}
+
+/* Browse */
+a.pickcolor, a.browse {text-decoration:none}
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
+.mceOldBoxModel a.browse span {width:22px; height:20px;}
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
+a.pickcolor:hover span {background-color:#B2BBD0;}
+a.pickcolor:hover span.disabled {}
+
+/* Charmap */
+table.charmap {border:1px solid #AAA; text-align:center}
+td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
+#charmap a {display:block; color:#000; text-decoration:none; border:0}
+#charmap a:hover {background:#CCC;color:#2B6FB6}
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
+
+/* Source */
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
+.mceActionPanel {margin-top:5px;}
+
+/* Tabs classes */
+.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}
+.tabs ul {margin:0; padding:0; list-style:none;}
+.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
+.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
+.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
+.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
+
+/* Panels */
+.panel_wrapper div.panel {display:none;}
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
+
+/* Columns */
+.column {float:left;}
+.properties {width:100%;}
+.properties .column1 {}
+.properties .column2 {text-align:left;}
+
+/* Titles */
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
+h3 {font-size:14px;}
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
+
+/* Dialog specific */
+#link .panel_wrapper, #link div.current {height:125px;}
+#image .panel_wrapper, #image div.current {height:200px;}
+#plugintable thead {font-weight:bold; background:#DDD;}
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}
+#plugintable {width:96%; margin-top:10px;}
+#pluginscontainer {height:290px; overflow:auto;}
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
+#colorpicker #light div {overflow:hidden;}
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
+#colorpicker .panel_wrapper div.current {height:175px;}
+#colorpicker #namedcolors {width:150px;}
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
+#colorpicker #colornamecontainer {margin-top:5px;}
+#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
diff --git a/library/mcefixes/themes.advanced.skins.default.ui.css b/library/mcefixes/themes.advanced.skins.default.ui.css
new file mode 100644
index 0000000000..5f1f96448c
--- /dev/null
+++ b/library/mcefixes/themes.advanced.skins.default.ui.css
@@ -0,0 +1,213 @@
+/* Reset */
+.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
+.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
+.defaultSkin table td {vertical-align:middle}
+
+/* Containers */
+.defaultSkin table {direction:ltr; background:#FFF}
+.defaultSkin iframe {display:block; background:#FFF}
+.defaultSkin .mceToolbar {height:26px}
+.defaultSkin .mceLeft {text-align:left}
+.defaultSkin .mceRight {text-align:right}
+
+/* External */
+.defaultSkin .mceExternalToolbar {position:absolute; border:2px solid #CCC; border-bottom:0; display:none;}
+.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
+.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
+
+/* Layout */
+.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC}
+.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}
+.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}
+.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}
+.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}
+.defaultSkin .mceIframeContainer { /*border-top:1px solid #CCC; border-bottom:1px solid #CCC */ border: none;}
+.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
+.defaultSkin .mceStatusbar div {float:left; margin:2px}
+.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
+.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
+.defaultSkin table.mceToolbar {margin-left:3px}
+.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}
+.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
+.defaultSkin td.mceCenter {text-align:center;}
+.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;}
+.defaultSkin td.mceRight table {margin:0 0 0 auto;}
+
+/* Button */
+.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:10px}
+.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
+.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}
+.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+.defaultSkin .mceButtonLabeled {width:auto}
+.defaultSkin .mceButtonLabeled span.mceIcon {float:left}
+.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}
+.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888}
+
+/* Separator */
+.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
+
+/* ListBox */
+.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
+.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
+.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
+.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF}
+.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0}
+.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;}
+.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
+.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px}
+.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;}
+.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}
+
+/* SplitButton */
+.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}
+.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}
+.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}
+.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}
+.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}
+.defaultSkin .mceSplitButton span.mceOpen {display:none}
+.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}
+.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;}
+.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0}
+.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;}
+
+/* ColorSplitButton */
+.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
+.defaultSkin .mceColorSplitMenu td {padding:2px}
+.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
+.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
+.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
+.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
+.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}
+.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a}
+.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}
+
+/* Menu */
+.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}
+.defaultSkin .mceNoIcons span.mceIcon {width:0;}
+.defaultSkin .mceNoIcons a .mceText {padding-left:10px}
+.defaultSkin .mceMenu table {background:#FFF}
+.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}
+.defaultSkin .mceMenu td {height:20px}
+.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}
+.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
+.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px}
+.defaultSkin .mceMenu pre.mceText {font-family:Monospace}
+.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}
+.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
+.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}
+.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}
+.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}
+.defaultSkin .mceMenuItemDisabled .mceText {color:#888}
+.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)}
+.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
+.defaultSkin .mceMenu span.mceMenuLine {display:none}
+.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
+
+/* Progress,Resize */
+.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}
+.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
+
+/* Formats */
+.defaultSkin .mce_formatPreview a {font-size:10px}
+.defaultSkin .mce_p span.mceText {}
+.defaultSkin .mce_address span.mceText {font-style:italic}
+.defaultSkin .mce_pre span.mceText {font-family:monospace}
+.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
+.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
+.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
+.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
+.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
+.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
+
+/* Theme */
+.defaultSkin span.mce_bold {background-position:0 0}
+.defaultSkin span.mce_italic {background-position:-60px 0}
+.defaultSkin span.mce_underline {background-position:-140px 0}
+.defaultSkin span.mce_strikethrough {background-position:-120px 0}
+.defaultSkin span.mce_undo {background-position:-160px 0}
+.defaultSkin span.mce_redo {background-position:-100px 0}
+.defaultSkin span.mce_cleanup {background-position:-40px 0}
+.defaultSkin span.mce_bullist {background-position:-20px 0}
+.defaultSkin span.mce_numlist {background-position:-80px 0}
+.defaultSkin span.mce_justifyleft {background-position:-460px 0}
+.defaultSkin span.mce_justifyright {background-position:-480px 0}
+.defaultSkin span.mce_justifycenter {background-position:-420px 0}
+.defaultSkin span.mce_justifyfull {background-position:-440px 0}
+.defaultSkin span.mce_anchor {background-position:-200px 0}
+.defaultSkin span.mce_indent {background-position:-400px 0}
+.defaultSkin span.mce_outdent {background-position:-540px 0}
+.defaultSkin span.mce_link {background-position:-500px 0}
+.defaultSkin span.mce_unlink {background-position:-640px 0}
+.defaultSkin span.mce_sub {background-position:-600px 0}
+.defaultSkin span.mce_sup {background-position:-620px 0}
+.defaultSkin span.mce_removeformat {background-position:-580px 0}
+.defaultSkin span.mce_newdocument {background-position:-520px 0}
+.defaultSkin span.mce_image {background-position:-380px 0}
+.defaultSkin span.mce_help {background-position:-340px 0}
+.defaultSkin span.mce_code {background-position:-260px 0}
+.defaultSkin span.mce_hr {background-position:-360px 0}
+.defaultSkin span.mce_visualaid {background-position:-660px 0}
+.defaultSkin span.mce_charmap {background-position:-240px 0}
+.defaultSkin span.mce_paste {background-position:-560px 0}
+.defaultSkin span.mce_copy {background-position:-700px 0}
+.defaultSkin span.mce_cut {background-position:-680px 0}
+.defaultSkin span.mce_blockquote {background-position:-220px 0}
+.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0}
+.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0}
+.defaultSkin span.mce_forecolorpicker {background-position:-720px 0}
+.defaultSkin span.mce_backcolorpicker {background-position:-760px 0}
+
+/* Plugins */
+.defaultSkin span.mce_advhr {background-position:-0px -20px}
+.defaultSkin span.mce_ltr {background-position:-20px -20px}
+.defaultSkin span.mce_rtl {background-position:-40px -20px}
+.defaultSkin span.mce_emotions {background-position:-60px -20px}
+.defaultSkin span.mce_fullpage {background-position:-80px -20px}
+.defaultSkin span.mce_fullscreen {background-position:-100px -20px}
+.defaultSkin span.mce_iespell {background-position:-120px -20px}
+.defaultSkin span.mce_insertdate {background-position:-140px -20px}
+.defaultSkin span.mce_inserttime {background-position:-160px -20px}
+.defaultSkin span.mce_absolute {background-position:-180px -20px}
+.defaultSkin span.mce_backward {background-position:-200px -20px}
+.defaultSkin span.mce_forward {background-position:-220px -20px}
+.defaultSkin span.mce_insert_layer {background-position:-240px -20px}
+.defaultSkin span.mce_insertlayer {background-position:-260px -20px}
+.defaultSkin span.mce_movebackward {background-position:-280px -20px}
+.defaultSkin span.mce_moveforward {background-position:-300px -20px}
+.defaultSkin span.mce_media {background-position:-320px -20px}
+.defaultSkin span.mce_nonbreaking {background-position:-340px -20px}
+.defaultSkin span.mce_pastetext {background-position:-360px -20px}
+.defaultSkin span.mce_pasteword {background-position:-380px -20px}
+.defaultSkin span.mce_selectall {background-position:-400px -20px}
+.defaultSkin span.mce_preview {background-position:-420px -20px}
+.defaultSkin span.mce_print {background-position:-440px -20px}
+.defaultSkin span.mce_cancel {background-position:-460px -20px}
+.defaultSkin span.mce_save {background-position:-480px -20px}
+.defaultSkin span.mce_replace {background-position:-500px -20px}
+.defaultSkin span.mce_search {background-position:-520px -20px}
+.defaultSkin span.mce_styleprops {background-position:-560px -20px}
+.defaultSkin span.mce_table {background-position:-580px -20px}
+.defaultSkin span.mce_cell_props {background-position:-600px -20px}
+.defaultSkin span.mce_delete_table {background-position:-620px -20px}
+.defaultSkin span.mce_delete_col {background-position:-640px -20px}
+.defaultSkin span.mce_delete_row {background-position:-660px -20px}
+.defaultSkin span.mce_col_after {background-position:-680px -20px}
+.defaultSkin span.mce_col_before {background-position:-700px -20px}
+.defaultSkin span.mce_row_after {background-position:-720px -20px}
+.defaultSkin span.mce_row_before {background-position:-740px -20px}
+.defaultSkin span.mce_merge_cells {background-position:-760px -20px}
+.defaultSkin span.mce_table_props {background-position:-980px -20px}
+.defaultSkin span.mce_row_props {background-position:-780px -20px}
+.defaultSkin span.mce_split_cells {background-position:-800px -20px}
+.defaultSkin span.mce_template {background-position:-820px -20px}
+.defaultSkin span.mce_visualchars {background-position:-840px -20px}
+.defaultSkin span.mce_abbr {background-position:-860px -20px}
+.defaultSkin span.mce_acronym {background-position:-880px -20px}
+.defaultSkin span.mce_attribs {background-position:-900px -20px}
+.defaultSkin span.mce_cite {background-position:-920px -20px}
+.defaultSkin span.mce_del {background-position:-940px -20px}
+.defaultSkin span.mce_ins {background-position:-960px -20px}
+.defaultSkin span.mce_pagebreak {background-position:0 -40px}
+.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
+.defaultSkin span.mce_spellchecker {background-position:-540px -20px}
diff --git a/library/oauth.php b/library/oauth.php
old mode 100755
new mode 100644
diff --git a/library/oauth2-php/CHANGELOG.txt b/library/oauth2-php/CHANGELOG.txt
old mode 100755
new mode 100644
diff --git a/library/oauth2-php/LICENSE.txt b/library/oauth2-php/LICENSE.txt
old mode 100755
new mode 100644
diff --git a/library/oauth2-php/lib/OAuth2.inc b/library/oauth2-php/lib/OAuth2.inc
old mode 100755
new mode 100644
diff --git a/library/oauth2-php/lib/OAuth2Client.inc b/library/oauth2-php/lib/OAuth2Client.inc
old mode 100755
new mode 100644
diff --git a/library/oauth2-php/lib/OAuth2Exception.inc b/library/oauth2-php/lib/OAuth2Exception.inc
old mode 100755
new mode 100644
diff --git a/library/openid.php b/library/openid.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Crypt/AES.php b/library/phpsec/Crypt/AES.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Crypt/DES.php b/library/phpsec/Crypt/DES.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Crypt/Hash.php b/library/phpsec/Crypt/Hash.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Crypt/RC4.php b/library/phpsec/Crypt/RC4.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Crypt/RSA.php b/library/phpsec/Crypt/RSA.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Crypt/Random.php b/library/phpsec/Crypt/Random.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Crypt/Rijndael.php b/library/phpsec/Crypt/Rijndael.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Crypt/TripleDES.php b/library/phpsec/Crypt/TripleDES.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Math/BigInteger.php b/library/phpsec/Math/BigInteger.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Net/SFTP.php b/library/phpsec/Net/SFTP.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Net/SSH1.php b/library/phpsec/Net/SSH1.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/Net/SSH2.php b/library/phpsec/Net/SSH2.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/PHP/Compat/Function/array_fill.php b/library/phpsec/PHP/Compat/Function/array_fill.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/PHP/Compat/Function/bcpowmod.php b/library/phpsec/PHP/Compat/Function/bcpowmod.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/PHP/Compat/Function/str_split.php b/library/phpsec/PHP/Compat/Function/str_split.php
old mode 100755
new mode 100644
diff --git a/library/phpsec/crypt.html b/library/phpsec/crypt.html
old mode 100755
new mode 100644
diff --git a/library/phpsec/docbook.css b/library/phpsec/docbook.css
old mode 100755
new mode 100644
diff --git a/library/phpsec/index.html b/library/phpsec/index.html
old mode 100755
new mode 100644
diff --git a/library/phpsec/intro.html b/library/phpsec/intro.html
old mode 100755
new mode 100644
diff --git a/library/phpsec/math.html b/library/phpsec/math.html
old mode 100755
new mode 100644
diff --git a/library/phpsec/misc_crypt.html b/library/phpsec/misc_crypt.html
old mode 100755
new mode 100644
diff --git a/library/phpsec/net.html b/library/phpsec/net.html
old mode 100755
new mode 100644
diff --git a/library/phpsec/sym_crypt.html b/library/phpsec/sym_crypt.html
old mode 100755
new mode 100644
diff --git a/library/simplepie/LICENSE.txt b/library/simplepie/LICENSE.txt
old mode 100755
new mode 100644
diff --git a/library/simplepie/README.markdown b/library/simplepie/README.markdown
old mode 100755
new mode 100644
diff --git a/library/simplepie/compatibility_test/COMPATIBILITY README.txt b/library/simplepie/compatibility_test/COMPATIBILITY README.txt
old mode 100755
new mode 100644
diff --git a/library/simplepie/compatibility_test/sp_compatibility_test.php b/library/simplepie/compatibility_test/sp_compatibility_test.php
old mode 100755
new mode 100644
diff --git a/library/simplepie/create.php b/library/simplepie/create.php
old mode 100755
new mode 100644
diff --git a/library/simplepie/db.sql b/library/simplepie/db.sql
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/cli_test.php b/library/simplepie/demo/cli_test.php
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/alternate_favicon.png b/library/simplepie/demo/for_the_demo/alternate_favicon.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/background_blockquote.png b/library/simplepie/demo/for_the_demo/background_blockquote.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/background_menuitem.gif b/library/simplepie/demo/for_the_demo/background_menuitem.gif
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/background_menuitem_off.gif b/library/simplepie/demo/for_the_demo/background_menuitem_off.gif
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/background_menuitem_shadow.gif b/library/simplepie/demo/for_the_demo/background_menuitem_shadow.gif
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/alternate.png b/library/simplepie/demo/for_the_demo/favicons/alternate.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/blinklist.png b/library/simplepie/demo/for_the_demo/favicons/blinklist.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/blogmarks.png b/library/simplepie/demo/for_the_demo/favicons/blogmarks.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/delicious.png b/library/simplepie/demo/for_the_demo/favicons/delicious.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/digg.png b/library/simplepie/demo/for_the_demo/favicons/digg.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/magnolia.png b/library/simplepie/demo/for_the_demo/favicons/magnolia.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/myweb2.png b/library/simplepie/demo/for_the_demo/favicons/myweb2.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/newsvine.png b/library/simplepie/demo/for_the_demo/favicons/newsvine.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/reddit.png b/library/simplepie/demo/for_the_demo/favicons/reddit.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/segnalo.png b/library/simplepie/demo/for_the_demo/favicons/segnalo.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/simpy.png b/library/simplepie/demo/for_the_demo/favicons/simpy.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/spurl.png b/library/simplepie/demo/for_the_demo/favicons/spurl.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/technorati.png b/library/simplepie/demo/for_the_demo/favicons/technorati.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/favicons/wists.png b/library/simplepie/demo/for_the_demo/favicons/wists.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/feed.png b/library/simplepie/demo/for_the_demo/feed.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/logo_simplepie_demo.png b/library/simplepie/demo/for_the_demo/logo_simplepie_demo.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/lucida-grande-bold.swf b/library/simplepie/demo/for_the_demo/lucida-grande-bold.swf
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/mediaplayer.swf b/library/simplepie/demo/for_the_demo/mediaplayer.swf
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/mediaplayer_readme.htm b/library/simplepie/demo/for_the_demo/mediaplayer_readme.htm
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/mini_podcast.png b/library/simplepie/demo/for_the_demo/mini_podcast.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/place_audio.png b/library/simplepie/demo/for_the_demo/place_audio.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/place_video.png b/library/simplepie/demo/for_the_demo/place_video.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/sIFR-print.css b/library/simplepie/demo/for_the_demo/sIFR-print.css
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/sIFR-screen.css b/library/simplepie/demo/for_the_demo/sIFR-screen.css
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/sifr-config.js b/library/simplepie/demo/for_the_demo/sifr-config.js
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/sifr.js b/library/simplepie/demo/for_the_demo/sifr.js
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/simplepie.css b/library/simplepie/demo/for_the_demo/simplepie.css
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/sleight.js b/library/simplepie/demo/for_the_demo/sleight.js
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/source_files/place_audio_fireworksfile.png b/library/simplepie/demo/for_the_demo/source_files/place_audio_fireworksfile.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/source_files/place_video_fireworksfile.png b/library/simplepie/demo/for_the_demo/source_files/place_video_fireworksfile.png
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/SifrStyleSheet.as b/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/SifrStyleSheet.as
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/_README_.txt b/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/_README_.txt
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/options.as b/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/options.as
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/sIFR.as b/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/sIFR.as
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/sifr.fla b/library/simplepie/demo/for_the_demo/source_files/sIFR-r245/sifr.fla
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/top_gradient.gif b/library/simplepie/demo/for_the_demo/top_gradient.gif
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/verdana.swf b/library/simplepie/demo/for_the_demo/verdana.swf
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/for_the_demo/yanone-kaffeesatz-bold.swf b/library/simplepie/demo/for_the_demo/yanone-kaffeesatz-bold.swf
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/handler_image.php b/library/simplepie/demo/handler_image.php
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/index.php b/library/simplepie/demo/index.php
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/minimalistic.php b/library/simplepie/demo/minimalistic.php
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/multifeeds.php b/library/simplepie/demo/multifeeds.php
old mode 100755
new mode 100644
diff --git a/library/simplepie/demo/test.php b/library/simplepie/demo/test.php
old mode 100755
new mode 100644
diff --git a/library/simplepie/idn/LICENCE b/library/simplepie/idn/LICENCE
old mode 100755
new mode 100644
diff --git a/library/simplepie/idn/ReadMe.txt b/library/simplepie/idn/ReadMe.txt
old mode 100755
new mode 100644
diff --git a/library/simplepie/idn/idna_convert.class.php b/library/simplepie/idn/idna_convert.class.php
old mode 100755
new mode 100644
diff --git a/library/simplepie/idn/npdata.ser b/library/simplepie/idn/npdata.ser
old mode 100755
new mode 100644
diff --git a/library/simplepie/simplepie.inc b/library/simplepie/simplepie.inc
old mode 100755
new mode 100644
diff --git a/library/slinky.php b/library/slinky.php
old mode 100755
new mode 100644
diff --git a/library/spam/b8/storage/storage_frndc.php b/library/spam/b8/storage/storage_frndc.php
index 7702c108b3..62909d4715 100644
--- a/library/spam/b8/storage/storage_frndc.php
+++ b/library/spam/b8/storage/storage_frndc.php
@@ -174,20 +174,44 @@ class b8_storage_frndc extends b8_storage_base
array_push($where, $token);
}
- $where = 'token IN ("' . implode('", "', $where) . '")';
+ $where = 'term IN ("' . implode('", "', $where) . '")';
}
else {
$token = dbesc($token);
- $where = 'token = "' . $token . '"';
+ $where = 'term = "' . $token . '"';
}
# ... and fetch the data
$result = q('
- SELECT *
- FROM ' . $this->config['table_name'] . '
- WHERE ' . $where . ' AND uid = ' . $uid );
+ SELECT * FROM spam WHERE ' . $where . ' AND uid = ' . $uid );
+
+
+ $returned_tokens = array();
+ if(count($result)) {
+ foreach($result as $rr)
+ $returned_tokens[] = $rr['term'];
+ }
+ $to_create = array();
+
+ if(count($tokens) > 0) {
+ foreach($tokens as $token)
+ if(! in_array($token,$returned_tokens))
+ $to_create[] = str_tolower($token);
+ }
+ if(count($to_create)) {
+ $sql = '';
+ foreach($to_create as $term) {
+ if(strlen($sql))
+ $sql .= ',';
+ $sql .= sprintf("(term,datetime,uid) values('%s','%s',%d)",
+ dbesc(str_tolower($term))
+ dbesc(datetime_convert()),
+ intval($uid)
+ );
+ q("insert into spam " . $sql);
+ }
return $result;
diff --git a/library/tinymce/changelog.txt b/library/tinymce/changelog.txt
old mode 100755
new mode 100644
index bcd3f294c4..ec712077a1
--- a/library/tinymce/changelog.txt
+++ b/library/tinymce/changelog.txt
@@ -1,3 +1,456 @@
+Version 3.5b2 (2012-03-15)
+ Rewrote the enter key logic to normalize browser behavior.
+ Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option.
+ Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node.
+ Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls.
+ Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection.
+ Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string.
+ Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default.
+Version 3.5b1 (2012-03-08)
+ Added new event class that is faster and enables support for faking events.
+ Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema.
+ Added new schema option and support for the HTML5 schema.
+ Added new visualblocks plugin that shows html5 blocks with visual borders.
+ Added new types and selector options to make it easier to create editor instances with different configs.
+ Added new preview of formatting options in various listboxes.
+ Added new preview_styles option that enables control over what gets previewed.
+ Fixed bug where content css would be loaded twice into iframe.
+ Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed.
+ Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined.
+ Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting.
+ Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing.
+Version 3.4.9.x (2012-02-xx)
+ Improved behaviour of backspacing into a table to be consistant across browsers and disable backspace when cursor immediately follows a table.
+ Improved edit CSS style plugin for single and multiple block selection and provide option to apply style to only selected text.
+ Fixed bug in Chrome where moving caret down in table and pasting throws errors.
+ Corrected reference to TinyMCE trim function.
+ Fixed bug where Ignore All in IE did not remove the underline from the selected word.
+ Fixed bug in html source editor word wrap option not wrapping text in Webkit browsers.
+ Fixed bug where it was possible to insert an invalid colour in the color pop-up dialog.
+ Fixed bug in Webkit where if anchor is on last line by itself caret can not be placed after it.
+Version 3.4.9 (2012-02-23)
+ Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete.
+ Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents.
+ Fixed bug where pressing enter on end of list item with a heading would create a new item with heading.
+ Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled.
+ Fixed bug in Gecko where undo wasn't added when focus was lost.
+ Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line.
+ Fixed bug where right-click on formatted text in IE selected the entire line.
+ Fixed bug where text ending with space could not be unformatted in IE.
+ Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used.
+ Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts.
+ Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config.
+ Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser.
+ Fixed bug where content css files where loaded twice into the iframe.
+ Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse.
+Version 3.4.8 (2012-02-02)
+ Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text.
+ Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked.
+ Fixed bug where wrong text align buttons are active when multiple block elements are selected.
+ Fixed bug where selected link not showing in target field of link dialog in some selection cases.
+ Use settings for remove_trailing_br so this can be turned off instead of hard coding the value.
+ Fixed bug in IE where the media plugin displayed null text when some values aren't filled in.
+ Added API method 'onSetAttrib' that fires when the attribute value on a node changes.
+ Fix font size dropdown value not being updated when text already has a font size in the advanced template.
+ Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times.
+ Fixed bug where caret cannot be placed after table if table is at end of document in IE.
+ Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur.
+ Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly.
+ Fixed bug where a stranded bullet point would get created in WebKit.
+ Fixed bug where selecting text in a blockquote and pressing backspace toggles the style.
+ Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property.
+ Fix white space in between spans from being deleted.
+ Fixed bug where scrollbars where visible in the character map dialog on Gecko.
+ Fixed issue with missing translation for one of the emoticons.
+ Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev.
+ Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout.
+ Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace.
+ Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber.
+ Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu.
+Version 3.4.7 (2011-11-03)
+ Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office.
+ Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text.
+ Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row.
+ Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10.
+ Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph.
+ Fix new list items in IE8 not displayed on a new line when list contains nested list items.
+ Clear formatting in table cell breaks the cell.
+ Made media type list localisable.
+ Fix out of memory error when using prototype in media dialog.
+ Fixed bug where could not add a space in the middle of a th cell.
+ Fixed bug where adding a bullet between two existing bullets adds an extra one
+ Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in.
+ Fixed bug where pressing enter on an empty list item does not outdent properly in FF
+ Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell
+ Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox.
+ Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph.
+ Fixed bug where deleting part of the link text can cause a link with no destination to be saved.
+ Fixed bug where css style border widths wasn't handled correctly in table dialog.
+ Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop.
+ Fixed bug where scripts with custom script types wasn't properly passed though the editor.
+ Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled.
+ Made emoticons dialog use the keyboard naviation.
+ Added navigation instructions to the symbols dialog.
+ Added ability to set default values for the media plugin.
+ Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties.
+ Fixed bug where the symbols dialog was not accessible.
+ Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility.
+ Fixed bug where the advanced color picker wasn't working properly on FF 7.
+ Fixed issue where the advanced color picker was producing uppercase hex codes.
+ Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements.
+ Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit.
+ Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes.
+Version 3.4.6 (2011-09-29)
+ Fixed bug where list items were being created for empty divs.
+ Added support in Media plugin for audio media using the embed tag
+ Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read.
+ Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers)
+ Fixed bug where classid attribute was not being checked from embed objects.
+ Fixed bug in jsrobot tests with intermittently failing.
+ Fixed bug where anchors wasn't updated properly if you edited them using IE 8.
+ Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor.
+ Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them.
+ Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin.
+ Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin.
+ Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin.
+ Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko.
+ Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly.
+ Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers.
+Version 3.4.5 (2011-09-06)
+ Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes.
+ Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved.
+ Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats.
+ Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly.
+ Fixed bug in WebKit where console messages would be logged when deleting an empty document.
+ Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list
+ Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements.
+ Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases.
+ Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM.
+ Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized.
+ Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control.
+ Fixed bug where adjacent links would get merged on IE due to bugs in their link command.
+ Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe.
+ Fixed bug where floated images in WebKit wouldn't get properly linked.
+ Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode.
+ Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P.
+ Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit.
+ Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit.
+ Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7.
+ Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit.
+ Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents.
+ Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text.
+ Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled.
+ Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin.
+ Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped.
+Version 3.4.4 (2011-08-04)
+ Added new html5 audio support. Patch contributed by Ronald M. Clifford.
+ Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin.
+ Fixed selection to match visual selection before applying formatting changes.
+ Fixed browser specific bugs in lists for WebKit and IE.
+ Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel.
+ Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser.
+ Fixed bug where formatting change would be lost after pressing enter.
+ Fixed bug in WebKit where deleting across blocks would add extra styles.
+ Fixed bug where moving cursor vertically in tables in WebKit wasn't working.
+ Fixed bug in IE where deleting would cause error in console.
+ Fixed bug where the formatter was not applying formats across list elements.
+ Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed.
+ Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden.
+ Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko.
+ Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements.
+ Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event.
+ Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them.
+ Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog.
+ Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location.
+Version 3.4.3.2 (2011-06-30)
+ Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit.
+ Fixed bugs in tests in firefox5 and WebKit.
+ Fixed bug where selection of table cells would produce an exception on Gecko.
+ Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden.
+ Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup.
+ Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection.
+ Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes.
+ Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document.
+ Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them.
+ Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed.
+ Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element.
+ Fixed performance issue with the noneditable plugin where it would enable/disable controls to often.
+Version 3.4.3.1 (2011-06-16)
+ Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin.
+ Fixed bug where custom buttons were not being rendered correctly when in high contrast mode.
+ Added support for iOS 5 that now supporting contentEditable in it's latest beta.
+ Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output.
+ Fixed bug where custom_elements option wasn't working properly on IE browsers.
+ Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements.
+ Fixed bug where attributes with > wasn't properly encoded as XML entities.
+Version 3.4.3 (2011-06-09)
+ Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location.
+ Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly.
+ Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8.
+ Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs.
+ Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied.
+ Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page.
+ Fixed bug where applying a heading style to a list item would cascade style to children list items.
+ Fixed bug where Editor loses focus when backspacing and changing styles in WebKit.
+ Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided.
+ Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari.
+ Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk.
+ Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded.
+ Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ).
+ Added possibility to change properties of all table cells in a column.
+ Added external_image_list option to get images list from user-defined variable or function.
+ Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome.
+ Fixed bug where table size inputs were to small for values with size units.
+ Fixed bug where table cell/row size input values were not validated.
+ Fixed bug where menu item line-height would be set to wrong value by external styles.
+ Fixed bug where hasUndo() would return wrong answer.
+ Fixed bug where page title would be set to undefined by fullpage plugin.
+ Fixed bug where HTML5 video properties were not updated in embedded media settings.
+ Fixed bug where HTML comment on the first line would cause an error.
+ Fixed bug where spellchecker menu was positioned incorrectly on IE.
+ Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list.
+ Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped.
+ Fixed bug where numeric entities with leading zeros would produce incorrect decoding.
+ Fixed bug where hexadecimal entities wasn't properly decoded.
+ Fixed bug where bookmarks wasn't properly stored/restored on undo/redo.
+ Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents.
+ Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements.
+ Fixed so contentEditable is used for the body of the editor if it's supported.
+ Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null.
+ Fixed performance issue with mceInsertCommand and inserting very simple contents.
+ Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic.
+ Fixed performance issue with table plugin where it checked for selected cells to often.
+ Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers.
+ Fixed bug where Gecko would remove single paragraphs if there where contents before/after it.
+ Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin.
+Version 3.4.2 (2011-04-07)
+ Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text.
+ Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz.
+ Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers.
+ Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser.
+ Fixed bug where blocks containing a single anchor element would be treated as empty.
+ Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed.
+ Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed.
+ Fixed bug where image border color/style values were overwritten by advimage plugin.
+ Fixed bug where setting border in advimage plugin would throw error in IE.
+ Fixed bug where empty anchors list in link settings wasn't hidden.
+ Fixed bug where xhtmlextras popups were missing localized popup-size parameters.
+ Fixed bug where the context menu wouldn't select images on WebKit browsers.
+ Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior.
+ Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control.
+ Fixed bug where contextmenu wasn't disabled on noneditable elements.
+ Fixed bug where getStyle function would trigger error when called on element without style property.
+ Fixed bug where editor fail to load if Javascript Compressor was used.
+ Fixed bug where list-style-type=lower-greek would produce errors in IE<8.
+ Fixed bug where spellchecker plugin would produce errors on IE6-7.
+ Fixed bug where theme_advanced_containers configuration option causes error.
+ Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value.
+ Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size.
+ Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog.
+Version 3.4.1 (2011-03-24)
+ Added significantly improved list handling via the new 'lists' plugin.
+ Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default.
+ Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color.
+ Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour.
+ Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled.
+ Fixed bug where selection locations on undo/redo didn't work correctly on specific contents.
+ Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe.
+ Fixed bug where some ascii numeric entities wasn't properly decoded.
+ Fixed bug where some non western language codes wasn't properly decoded/encoded.
+ Fixed bug where undo levels wasn't created when deleting contents on IE.
+ Fixed bug where the initial undo levels bookmark wasn't updated correctly.
+ Fixed bug where search/replace wouldn't be scoped to editor instances on IE8.
+ Fixed bug where IE9 would produce two br elements after block elements when pasting.
+ Fixed bug where IE would place the caret at an incorrect position after a paste operation.
+ Fixed bug where a paste operation using the keyboard would add an extra undo level.
+ Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted.
+ Fixed bug where the table plugin couldn't correctly handle invalid table structures.
+ Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin.
+ Fixed bug where toggle states on some of the list boxes didn't update correctly.
+ Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10.
+ Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin.
+ Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid.
+ Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme.
+ Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome.
+ Fixed bug with references to non-existing images in css of fullpage plugin.
+ Fixed bug where item could be unselected in spellchecker's language selector.
+ Fixed bug where some mispelled words could be not highlighted using spellchecker plugin.
+ Fixed bug where spellchecking would merge some words on IE.
+ Fixed bug where spellchecker context menu was not always positioned correctly.
+ Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled.
+ Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents.
+ Fixed bug where selecting the whole table would enable table tools for cells and rows.
+ Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin.
+ Fixed bug where setting text color in fullpage plugin doesn't work.
+ Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly.
+ Fixed bug where black spade suit character was not included in special character selector.
+ Fixed bug where setting invalid values for table cell size would throw an error in IE.
+ Fixed bug where spellchecking would remove whitespace characters from PRE block in IE.
+ Fixed bug where HR was inserted inside P elements instead of splitting them.
+ Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes.
+ Fixed bug where bullet lists weren't always detected correctly.
+ Fixed bug where deleting some paragraphs on IE would cause an exception.
+ Fixed bug where the json encoder logic wouldn't properly encode \ characters.
+ Fixed bug where the onChange event would be fired when the editor was first initialized.
+ Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class.
+ Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences.
+ Fixed issue where styles were not included when using the full page plugin.
+ Fixed issue where drag/drop operations wasn't properly added to the undo levels.
+ Fixed issue where colors wasn't correctly applied to elements with underline decoration.
+ Fixed issue where deleting some paragraphs on IE would cause an exception.
+Version 3.4 (2011-03-10)
+ Added accessibility example with various accessibility options contributed by Ephox.
+ Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin.
+ Fixed bug where the image.htm had some strange td artifacts probably due to auto merging.
+ Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method.
+ Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent.
+ Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode.
+ Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode.
+ Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode.
+ Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox.
+ Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme.
+ Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x.
+ Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right.
+ Fixed bug where the formatter would align images when the selection range was collapsed.
+ Fixed bug where the image button would be active when the selection range was collapsed.
+ Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic.
+ Fixed bug where the table cell/row dialogs would produce empty attributes.
+ Fixed bug where the tfoot wouldn't be added to the top of the table.
+ Fixed bug where the formatter would merge siblings with white space between them.
+ Fixed bug where pasting headers and paragraphs would produce an extra paragraph.
+ Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color.
+ Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting.
+ Fixed bug where multiple BR elements at end of block elements where removed.
+ Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages.
+ Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode.
+ Fixed bug where the search/replace plugin wouldn't work correctly on IE 9.
+ Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox.
+ Fixed so the values entered in the color picker are forced to hex values.
+ Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade.
+ Removed obsolete calls in various plugins to the mceBeginUndoLevel command.
+Version 3.4b3 (2011-02-10)
+ Added WAI-ARIA support for the main UI and dialogs this feature was contributed by Ephox.
+ Added iframe support to media plugin in order to handle the new YouTube HTML5 video formats.
+ Fixed bug where anchors would wrap the text contents after it due to a bug in the DomParser logic.
+ Fixed bug where the selected state wouldn't be removed on ListBox controls when a menu item was selected.
+ Fixed bug where IE could throw an unspecified error exception when the getBookmark logic was executed.
+ Fixed bug where IE would throw an invalid argument error when focus was applied to an empty editor instance.
+ Fixed bug where applying inline format wouldn't work if the start cell in the selection was empty.
+ Fixed bug where auto detection logic for YouTube and Google Video wouldn't work in the new media plugin.
+ Fixed bug where td elements would get a colspan/rowspan of 1 when created by the table plugin.
+ Fixed bug where removal/padding of empty elements wasn't handled correctly.
+ Fixed bug where internal elements would show up in element path.
+ Fixed bug where internal elements would get serialized as valid output.
+ Fixed bug where color wasn't correctly applied to anchor elements.
+ Fixed bug where float option in the style plugin dialog wouldn't be handled correctly on WebKit.
+ Fixed bug where the tinymce.dom.TreeWalker prev function wouldn't walk the DOM correctly.
+ Fixed bug where mceInsertContent command could produce empty block elements after the inserted content.
+ Fixed bug where mceInsertContent command wouldn't apply visual aids on tables and similar elements.
+ Fixed bug where empty block elements would get double br bogus elements in them.
+ Fixed bug where the color menu wouldn't apply the color correctly on IE when the viewport was to small.
+ Fixed bug where right clicking out side the body element of the editor iframe would prevent paste from working on IE.
+ Fixed bug where the onContextMenu event wouldn't fire correctly on IE if you clicked out side the body element.
+ Fixed bug where the onContextMenu event wouldn't fire correctly on modern Opera versions that now support it by default.
+ Fixed bug where legacy content wasn't converted correctly when inserted using mceInsertContent or through the source dialog.
+ Fixed bug where resizing images or tables wouldn't update the style attribute correctly or leave data-mce prefixed attributes.
+ Fixed bug where adding links wouldn't work correctly when using TinyMCE jQuery version with jQuery 1.5.
+ Fixed bug where single quotes inside param elements wasn't treated correctly by the media plugin.
+ Fixed bug where pasting plain text in WebKit wouldn't work correctly. It will now auto detect the WebKit bug and use plain text mode.
+ Fixed bug where the DomParser would fail to move out invalid elements within invalid elements on complex contents.
+ Fixed bug where paste as plain text would not decode html entities properly.
+ Fixed bug where large paragraphs would cause incorrect scrolling behavior if you would split them using enter.
+ Fixed bug where the SaxParser wouldn't properly parse some specific short ended elements.
+ Fixed so mceReplaceContent supports caret position and makes sure that the contents inserted gets validated.
+ Fixed so unnecessary traling br elements in blocks gets removed on Gecko/WebKit when using mceInsertContent command.
+ Moved some plugin css contents into the skin content css files to reduce the number of http requests.
+ Moved some plugin specific images into the theme img directory since they can then be shared.
+Version 3.4b2 (2011-01-13)
+ Added new custom flash player, this player supports mp4 and flv and has skin support.
+ Fixed so mceInsertContent handles context correctly to enforce valid nesting of elements.
+ Fixed bug where scrolling would become jerky on IE on some contents.
+ Fixed bug where paste as plain text would throw exception of missing entities setting.
+ Fixed bug where anchor nodes where removed by the new serializer engine.
+ Fixed bug where IE would crash if when backspace where used on some specific contents.
+ Fixed bug where pasting of plain text in WebKit would result in merging of text lines.
+ Fixed bug where it wasn't possible to delete images or tables using backspace on IE9.
+ Fixed bug where urls in styles would generate a JS error due to incorrect scope.
+ Fixed bug where copy paste from Java applications would produce extra contents in FF on Mac.
+ Fixed bug where the verify_html option wouldn't allow all elements and attributes.
+Version 3.4b1 (2010-12-20)
+ Added new serialization engine that increases performance and enforces valid output according to the specified schema settings.
+ Added new HTML parser logic used by the serialization engine and can handle malformed html contents.
+ Added new valid_children config option, enables more fine grain control of elements can be inside other elements.
+ Added new entities encoding logic boost performance and will only encode entities based on context i.e. attributes/text nodes.
+ Added new protect setting that enables users to protect template items from being removed by the serializer logic.
+ Added new {$caret} marker for the mceInsertContent command. Makes it possible to move the caret to a specific position when inserting contents.
+ Added new validation of anchor names. Only valid W3C names will be accepted.
+ Replaced the internal _mce_ prefixed attributes to the more standard HTML5 data-mce- prefix. This will also resolve future browser santiaztion issues.
+ Fixed bug where the paste plugin wouldn't convert Word lists with more than 9 items to real ol lists. Patch contributed by Mike (yogaboy).
+ Fixed bug where clicking on a format title would produce errors if the current selection didn't have any formats.
+ Fixed bug where paste of simple texts wouldn't work correctly in Gecko using the paste plugin since it keeps block formatting.
+ Fixed bug where confirm dialogs didn't display correctly due to resent IE9 fixes.
+ Fixed bug where spaces in URLs wouldn't be properly encoded to %20 if the user entered them in the link dialogs. Patch contributed by Ephox.
+ Fixed bug where the image alignment buttons wouldn't reposition the resize handles on FF due to a browser issue. Patch contributed by Ephox.
+ Fixed bug where the compareBoundaryPoints method of the IE Range class didn't work correctly. Patch contributed by Ephox.
+ Fixed bug where selection of elements using double click wouldn't select the clicked element but rather the parent node on FF. Patch contributed by Ephox.
+ Fixed bug where IE would scroll the user to the current selection causing parent document to scroll as well. Patch contributed by Ephox.
+ Fixed bug where style compression would incorrectly compress items with different values. It now only compresses if the values are the same. Patch contributed by Ephox.
+ Fixed bug where FF would add non breaking spaces outside TD elements if formatting was applied to table cells. Patch contributed by Ephox.
+ Fixed bug where the caret position would be lost on WebKit browsers if you pasted images multiple times. Patch contributed by Ephox.
+ Fixed bug where non word contents like * would be counted as words in the wordcount pluging. Patch contributed by David Balatero.
+ Fixed bug where the toggle absolute button in the layer plugin wouldn't remove the existing internal style attribute first.
+ Fixed bug where the autosave plugin would generate an exception on IE if the user had disabled userdata persistence.
+ Fixed bug where the paste plugin would remove dashed classes on IE since the regexps didn't include that character.
+ Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance.
+ Fixed bug where applying block formats to empty elements wouldn't render correctly on IE.
+ Fixed bug where the searchreplace plugin would add a f or r character when shortcuts where used on IE while using default dialogs.
+ Fixed bug where Opera wouldn't load scripts correctly since the onreadystate would fire even though the script wasn't loaded.
+ Fixed issue where wouldn't be handled correctly in the bbcode plugin if entity_encoding was set to raw.
+ Fixed issue where contents would flicker since the content css files where asynchronously loaded.
+ Fixed bug where WebKit wouldn't create links on images with a float style.
+Version 3.3.9.3 (2010-12-20)
+ Fixed issue where WebKit wouldn't correctly apply ins/del in xhtmlxtras plugin.
+ Fixed bug where paste as plaintext on WebKit wouldn't produce br and p elements correctly.
+ Fixed bug where the confirm dialog texts would be incorrectly placed due to recent IE 9 workarounds in the window.css.
+ Fixed bug where applying text color would not add spans inside link elements. This is needed due to CSS style inheritance.
+Version 3.3.9.2 (2010-09-29)
+ Fixed bug where placing the caret in IE 9 beta 1 would not work correctly if you clicked out side the document body element.
+ Fixed bug where IE 9 beta 1 wouldn't resize the editor correctly since the events didn't fire as previous versions did.
+ Fixed bug where FF would produce an error message when being rendered inside a hidden div element.
+ Fixed bug where resize logic could produce a cookie with a width/height less than the size of the container.
+ Fixed bug where content_css wouldn't populate the styles dropdown correctly.
+Version 3.3.9.1 (2010-09-23)
+ Fixed bug where WebKit browsers wouldn't activate the image button when images where selected.
+ Fixed bug where Opera Presto 10.60 deletes elements when restoring bookmarks.
+ Fixed bug where IE9 beta1 doesn't handle regexp replacement values correctly.
+ Fixed bug where IE9 beta1 didn't render the inline dialogs correctly due to a bug with CSS clip.
+ Fixed bug where IE9 beta1 would produce error messages on load since they removed the document.recalc method.
+ Fixed bug where IE9 beta1 would produce since they haven't implemented document.implementation.createDocument correctly.
+ Fixed bug where IE9 beta1 would searchreplace doesn't work since their native DOM Range doesn't have a find method.
+ Fixed bug where IE9 beta1 would render the source view incorrectly due to incorrect viewport size measurements.
+ Fixed bug where IE9 beta1 would crash when running the basic functionality unit tests.
+ Fixed bug where IE9 beta1 would wrap elements in blocks correctly due to changes to the selection object.
+ Fixed bug where IE9 beta1 would fail to insert contents since they havn't implemented the createContextualFragment method in their DOM Range.
+ Fixed bug where IE9 beta1 would fail to handle image selection since they currently doesn't support control selections in their DOM Range.
+ Fixed bug where IE9 beta1 would fail to load scripts since they fire the onload event before the scripts are parsed and executed.
+Version 3.3.9 (2010-09-08)
+ Fixed bug where inserting table rows into a table with subtable would produce an incorrect column count.
+ Fixed bug where the selection of cells in a table with subtables could produce invalid selections.
+ Fixed bug where the table plugin would produce a script error if you tried to move the caret before a first child table.
+ Fixed bug where the keep_styles feature on IE would move the caret to an incorrect location at the end of list blocks.
+ Fixed so attributes from legacy elements such as font gets retained when they get converted to spans.
+ Fixed minor issue where the select boxes wouldn't be set the not set by default in the table dialog.
+Version 3.3.8 (2010-06-30)
+ On IE8+ and FireFox 3.5+, dragging an image now correctly adds an undo
+ event.
+ Fixed bug where WebKit would not move the caret to a correct position after a paste operation.
+ Fixed bug where WebKit would produce a div wrapper element when pasting some contents.
+ Fixed bug where the visual chars and nonbreaking plugin wouldn't show nbsp elements correctly.
+ Fixed bug where the format states would be enabled even after the format was removed.
+ Fixed bug where the delete key would move the caret to an incorrect position.
+ Fixed bug where it wasn't possible to toggle of the current font size/family/style by clicking the title item.
+ Fixed bug where the abbr element wouldn't get serialized correctly on IE6.
+ Fixed so that the examples checks if they are executed from the local file system since that might not work properly.
Version 3.3.7 (2010-06-10)
Fixed bug where context menu would produce an error on IE if you right clicked twice and left clicked once.
Fixed bug where resizing of the window on WebKit browsers in fullscreen mode wouldn't position the statusbar correctly.
diff --git a/library/tinymce/examples/accessibility.html b/library/tinymce/examples/accessibility.html
new file mode 100644
index 0000000000..69059403cc
--- /dev/null
+++ b/library/tinymce/examples/accessibility.html
@@ -0,0 +1,101 @@
+
+
+
+Full featured example
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/library/tinymce/examples/css/content.css b/library/tinymce/examples/css/content.css
old mode 100755
new mode 100644
diff --git a/library/tinymce/examples/css/word.css b/library/tinymce/examples/css/word.css
old mode 100755
new mode 100644
diff --git a/library/tinymce/examples/custom_formats.html b/library/tinymce/examples/custom_formats.html
old mode 100755
new mode 100644
index 7c475b19b1..ba9d1eb0c7
--- a/library/tinymce/examples/custom_formats.html
+++ b/library/tinymce/examples/custom_formats.html
@@ -10,7 +10,7 @@
// General options
mode : "textareas",
theme : "advanced",
- plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
+ plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
@@ -102,6 +102,10 @@
-
+