Merge remote-tracking branch 'mike/master' into dev
This commit is contained in:
@@ -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 . '>';
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user