aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php8
-rwxr-xr-xinclude/oembed.php6
-rw-r--r--include/text.php23
3 files changed, 32 insertions, 5 deletions
diff --git a/include/items.php b/include/items.php
index 2cee376d0..b2c288b75 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4629,10 +4629,10 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body,
if(! stristr($image,z_root() . '/photo/'))
continue;
$image_uri = substr($image,strrpos($image,'/') + 1);
- if(strpos($image_uri,'-') !== false)
- $image_uri = substr($image_uri,0, strpos($image_uri,'-'));
- if(strpos($image_uri,'.') !== false)
- $image_uri = substr($image_uri,0, strpos($image_uri,'.'));
+ if(strrpos($image_uri,'-') !== false)
+ $image_uri = substr($image_uri,0, strrpos($image_uri,'-'));
+ if(strrpos($image_uri,'.') !== false)
+ $image_uri = substr($image_uri,0, strrpos($image_uri,'.'));
if(! strlen($image_uri))
continue;
$srch = '<' . $xchan_hash . '>';
diff --git a/include/oembed.php b/include/oembed.php
index e5557dc11..426197c5f 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -221,7 +221,11 @@ function oembed_fetch_url($embedurl){
if(strpos(strtolower($embedurl),'.pdf') !== false) {
$action = 'allow';
- $j = [ 'html' => '<object data="' . $embedurl . '" type="application/pdf" width="500" height="720">' . '<a href="' . $embedurl . '">' . t('View PDF') . '</a></object>', 'width' => 500, 'height' => 720, 'type' => 'pdf' ];
+ $j = [
+ 'html' => '<object data="' . $embedurl . '" type="application/pdf" style="width: 100%; height: 300px;"></object>',
+ 'title' => t('View PDF'),
+ 'type' => 'pdf'
+ ];
}
diff --git a/include/text.php b/include/text.php
index 7f6e87d3b..cce8a6ed5 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3477,6 +3477,28 @@ function print_val($v) {
}
+function array_path_exists($str,$arr) {
+
+ $ptr = $arr;
+ $search = explode('/', $str);
+
+ if($search) {
+ foreach($search as $s) {
+ if(array_key_exists($s,$ptr)) {
+ $ptr = $ptr[$s];
+ }
+ else {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ return false;
+
+}
+
+
/**
* @brief Generate a unique ID.
*
@@ -3492,3 +3514,4 @@ function new_uuid() {
return $hash;
}
+