diff options
-rw-r--r-- | README | 8 | ||||
-rw-r--r-- | boot.php | 2 | ||||
-rw-r--r-- | database.sql | 14 | ||||
-rw-r--r-- | include/items.php | 18 | ||||
-rw-r--r-- | update.php | 16 |
5 files changed, 44 insertions, 14 deletions
@@ -3,7 +3,7 @@ * Friendika * ************* - Distributed Social Network + Social Communications Platform http://friendika.com @@ -40,8 +40,8 @@ interaction you've grown to love, *and* was free to use, *and* was open source, *and* where your privacy is always under your control? And what if this social network could scale to encompass the entire -internet, and *not* require a central organisation to provide servers? -(In exchange for peddling your private information behind your back.) +internet, and *not* require a central organisation - whose core business model +is to sell information it can discover about you for profit? Look no further. @@ -53,7 +53,7 @@ Status.Net and many other sites and social networks *today*. Welcome to the federated social web. If you choose not to use Friendika (though we think you'd be foolish not to), you can choose any of 20-30 other -providers of federated social networking software and still be a part of this +providers of federated social communications software and still be a part of this vast new social network. This is going to be bigger than Facebook. Much bigger. @@ -4,7 +4,7 @@ set_time_limit(0); define ( 'FRIENDIKA_VERSION', '2.1.947' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); -define ( 'DB_UPDATE_VERSION', 1050 ); +define ( 'DB_UPDATE_VERSION', 1051 ); define ( 'EOL', "<br />\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 2fd289d74..b88e5e5ff 100644 --- a/database.sql +++ b/database.sql @@ -514,3 +514,17 @@ CREATE TABLE IF NOT EXISTS `mailacct` ( `last_check` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE = MYISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `attach` ( +`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`uid` INT NOT NULL , +`filetype` CHAR( 64 ) NOT NULL , +`filesize` INT NOT NULL , +`data` LONGBLOB NOT NULL , +`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', +`edited` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', +`allow_cid` MEDIUMTEXT NOT NULL , +`allow_gid` MEDIUMTEXT NOT NULL , +`deny_cid` MEDIUMTEXT NOT NULL , +`deny_gid` MEDIUMTEXT NOT NULL +) ENGINE = MYISAM DEFAULT CHARSET=utf8; + diff --git a/include/items.php b/include/items.php index 86579512e..82752e168 100644 --- a/include/items.php +++ b/include/items.php @@ -477,10 +477,12 @@ function get_atom_elements($feed,$item) { if($attach) { $att_arr = array(); foreach($attach as $att) { - $len = intval($att->get_length()); - $link = str_replace(',','%2D', notags(trim($att->get_link()))); - $title = str_replace(',','%2D',notags(trim($att->get_title()))); - $type = notags(trim($att->get_type())); + $len = intval($att->get_length()); + $link = str_replace(array(',','"'),array('%2D','%22'),notags(trim(unxmlify($att->get_link())))); + $title = str_replace(array(',','"'),array('%2D','%22'),notags(trim(unxmlify($att->get_title())))); + $type = str_replace(array(',','"'),array('%2D','%22'),notags(trim(unxmlify($att->get_type())))); + if(strpos($type,';')) + $type = substr($type,0,strpos($type,';')); if((! $link) || (strpos($link,'http') !== 0)) continue; @@ -489,9 +491,7 @@ function get_atom_elements($feed,$item) { if(! $type) $type = 'application/octet-stream'; - // this isn't legal html - there is no size in an 'a' tag, remember to strip it before display - - $att_arr[] = '<a href="' . $link . '" size="' . $len . '" type="' . $type . '">' . $title . '</a>'; + $att_arr[] = '[attach]href="' . $link . '" size="' . $len . '" type="' . $type . '" title="' . $title . '"[/attach]'; } $res['attach'] = implode(',', $att_arr); } @@ -1588,13 +1588,13 @@ function item_getfeedattach($item) { if(count($arr)) { foreach($arr as $r) { $matches = false; - $cnt = preg_match('|\<a href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" >(.+?)</a>|',$r,$matches); + $cnt = preg_match('|\[attach\]href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" title=\"(.+?)\"\[\/attach\]|',$r,$matches); if($cnt) { $ret .= '<link rel="enclosure" href="' . xmlify($matches[1]) . '" type="' . xmlify($matches[3]) . '" '; if(intval($matches[2])) $ret .= 'size="' . intval($matches[2]) . '" '; if($matches[4] !== ' ') - $ret .= 'title="' . xmlify($matches[4]) . '" '; + $ret .= 'title="' . xmlify(trim($matches[4])) . '" '; $ret .= ' />' . "\r\n"; } } diff --git a/update.php b/update.php index bb4536ae9..763b8f267 100644 --- a/update.php +++ b/update.php @@ -444,3 +444,19 @@ function update_1049() { ) ENGINE = MYISAM "); } +function update_1050() { + q("CREATE TABLE `attach` ( + `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , + `uid` INT NOT NULL , + `filetype` CHAR( 64 ) NOT NULL , + `filesize` INT NOT NULL , + `data` LONGBLOB NOT NULL , + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `edited` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `allow_cid` MEDIUMTEXT NOT NULL , + `allow_gid` MEDIUMTEXT NOT NULL , + `deny_cid` MEDIUMTEXT NOT NULL , + `deny_gid` MEDIUMTEXT NOT NULL + ) ENGINE = MYISAM "); + +} |