Merge remote-tracking branch 'mike/master' into dev

This commit is contained in:
Mario Vavti
2018-12-01 21:43:54 +01:00
7 changed files with 52 additions and 12 deletions

View File

@@ -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 . '>';

View File

@@ -3467,6 +3467,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.
*
@@ -3482,3 +3504,4 @@ function new_uuid() {
return $hash;
}