aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-06-23 08:11:35 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-06-23 08:11:35 +0530
commit6e4760dd9c512147309b5e4a98d25216610f81da (patch)
treecd1ea2edf6b257e52ab8fd10c781ba600d884506 /include/text.php
parent11974b4d948ae5d9b9fb53970838463bd88bb9f6 (diff)
parent4e7eb36dd1e65bf481ffe30614565674cbef4fe5 (diff)
downloadvolse-hubzilla-6e4760dd9c512147309b5e4a98d25216610f81da.tar.gz
volse-hubzilla-6e4760dd9c512147309b5e4a98d25216610f81da.tar.bz2
volse-hubzilla-6e4760dd9c512147309b5e4a98d25216610f81da.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/include/text.php b/include/text.php
index d4a4d5580..cc4bee268 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1059,7 +1059,7 @@ function feed_salmonlinks($nick) {
if(! function_exists('get_plink')) {
function get_plink($item) {
$a = get_app();
- if (x($item,'plink') && (! $item['private'])){
+ if (x($item,'plink') && ((! $item['private']) || ($item['network'] === NETWORK_FEED))){
return array(
'href' => $item['plink'],
'title' => t('link to source'),
@@ -1255,13 +1255,13 @@ function bb_translate_video($s) {
function html2bb_video($s) {
- $s = preg_replace('#<object[^>]+>(.*?)https+://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+)(.*?)</object>#ism',
+ $s = preg_replace('#<object[^>]+>(.*?)https?://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+)(.*?)</object>#ism',
'[youtube]$2[/youtube]', $s);
- $s = preg_replace('#<iframe[^>](.*?)https+://www.youtube.com/embed/([A-Za-z0-9\-_=]+)(.*?)</iframe>#ism',
+ $s = preg_replace('#<iframe[^>](.*?)https?://www.youtube.com/embed/([A-Za-z0-9\-_=]+)(.*?)</iframe>#ism',
'[youtube]$2[/youtube]', $s);
- $s = preg_replace('#<iframe[^>](.*?)https+://player.vimeo.com/video/([0-9]+)(.*?)</iframe>#ism',
+ $s = preg_replace('#<iframe[^>](.*?)https?://player.vimeo.com/video/([0-9]+)(.*?)</iframe>#ism',
'[vimeo]$2[/vimeo]', $s);
return $s;
@@ -1541,3 +1541,16 @@ function protect_sprintf($s) {
return(str_replace('%','%%',$s));
}
+
+function is_a_date_arg($s) {
+ $i = intval($s);
+ if($i > 1900) {
+ $y = date('Y');
+ if($i <= $y+1 && strpos($s,'-') == 4) {
+ $m = intval(substr($s,5));
+ if($m > 0 && $m <= 12)
+ return true;
+ }
+ }
+ return false;
+}