aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-03-23 10:41:55 -0400
committerSimon L'nu <simon.lnu@gmail.com>2012-03-23 10:41:55 -0400
commit803f79e0912c4a526a16fdda4809277d8ad3195d (patch)
tree61dd6d3a8fc5368ad86b5d38a5d177ae9cd2d9f8 /include
parent8e29669b81f8df724bb77e2e2b6eff330a17cbec (diff)
parentce8cfb7b0531e72fe28b3a6a6440016e482bd016 (diff)
downloadvolse-hubzilla-803f79e0912c4a526a16fdda4809277d8ad3195d.tar.gz
volse-hubzilla-803f79e0912c4a526a16fdda4809277d8ad3195d.tar.bz2
volse-hubzilla-803f79e0912c4a526a16fdda4809277d8ad3195d.zip
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: (25 commits) diabook: theme.php remove code duplication last photos check for user "hidewall" remove unneeded regex move js code to close popup in main.js (missing stop event propagation in popup links) user settings: don't show emoticons fix in css right_aside small fix fix 1024resolution add right_aside to theme diabook ability to change tags in edited posts normalise comparison link on delegation page quattro(-green) styling the 'filed under: remove' text it's only item.filer ;-) non static filer text new lines removed removed some new lines to cut down number of changed files removed unneccessary stuff removed problem from previous commit tests for the template engine adding filer functionality to quattro(-green) missing tooltip for "file as" prevent re-registrations using a deleted username - not an issue with Friendica but could create a serious privacy issue with federated platforms add file_as-option to diabook-derivates ... * master:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/Contact.php6
-rwxr-xr-xinclude/items.php14
-rw-r--r--include/text.php13
3 files changed, 28 insertions, 5 deletions
diff --git a/include/Contact.php b/include/Contact.php
index baccea305..d9949b1ef 100755
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -15,6 +15,12 @@ function user_remove($uid) {
call_hooks('remove_user',$r[0]);
+ // save username (actually the nickname as it is guaranteed
+ // unique), so it cannot be re-registered in the future.
+
+ q("insert into userd ( username ) values ( '%s' )",
+ $r[0]['nickname']
+ );
q("DELETE FROM `contact` WHERE `uid` = %d", intval($uid));
q("DELETE FROM `group` WHERE `uid` = %d", intval($uid));
diff --git a/include/items.php b/include/items.php
index 5a297c83e..b96f88566 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1582,9 +1582,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'])
@@ -1727,9 +1728,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'])
@@ -1800,7 +1802,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
// 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);
+ logger('consume_feed: Correcting item owner.', LOGGER_DEBUG);
$datarray['owner-name'] = $contact['name'];
$datarray['owner-link'] = $contact['url'];
$datarray['owner-avatar'] = $contact['thumb'];
@@ -2332,9 +2334,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'])
@@ -2497,9 +2500,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'])
diff --git a/include/text.php b/include/text.php
index 92a74eb49..6f66cef65 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1338,3 +1338,16 @@ function file_tag_unsave_file($uid,$item,$file) {
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;
+}
+