From: tobiasd <tobias.diekershoff@gmx.net>
Date: Sun, 18 May 2014 18:01:29 +0000 (+0200)
Subject: Merge pull request #983 from annando/master
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d3db9365cb76d6d174123056536423028c060311;p=friendica.git

Merge pull request #983 from annando/master

"red"-bookmarks and better plaintext export
---

d3db9365cb76d6d174123056536423028c060311
diff --cc include/items.php
index 2f03818a76,94285e61ba..76bcbc7b24
--- a/include/items.php
+++ b/include/items.php
@@@ -989,27 -989,10 +989,27 @@@ function item_store($arr,$force_parent 
  	if(! x($arr,'type'))
  		$arr['type']      = 'remote';
  
 +
 +
 +	/* check for create  date and expire time */
 +	$uid = intval($arr['uid']);
 +	$r = q("SELECT expire FROM user WHERE uid = %d", $uid);
 +	if(count($r)) {
 +		$expire_interval = $r[0]['expire'];
 +		if ($expire_interval>0) {
 +			$expire_date =  new DateTime( '- '.$expire_interval.' days', new DateTimeZone('UTC'));
 +			$created_date = new DateTime($arr['created'], new DateTimeZone('UTC'));
 +			if ($created_date < $expire_date) {
 +				logger('item-store: item created ('.$arr['created'].') before expiration time ('.$expire_date->format(DateTime::W3C).'). ignored. ' . print_r($arr,true), LOGGER_DEBUG);
 +				return 0;
 +			}
 +		}
 +	}
 +
  	// Shouldn't happen but we want to make absolutely sure it doesn't leak from a plugin.
- 
- 	if((strpos($arr['body'],'<') !== false) || (strpos($arr['body'],'>') !== false))
- 		$arr['body'] = strip_tags($arr['body']);
+ 	// Deactivated, since the bbcode parser can handle with it - and it destroys posts with some smileys that contain "<"
+ 	//if((strpos($arr['body'],'<') !== false) || (strpos($arr['body'],'>') !== false))
+ 	//	$arr['body'] = strip_tags($arr['body']);
  
  
  	if (version_compare(PHP_VERSION, '5.3.0', '>=')) {