// It maybe is a rich content, but if it does have everything that a link has,
// then treat it that way
if (($data["type"] == "rich") && is_string($data["title"]) &&
- is_string($data["text"]) && (sizeof($data["images"]) > 0)) {
+ is_string($data["text"]) && !empty($data["images"])) {
$data["type"] = "link";
}
$text .= " title='".$data["title"]."'";
}
- if (sizeof($data["images"]) > 0) {
+ if (!empty($data["images"])) {
$preview = str_replace(["[", "]"], ["[", "]"], htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false));
// if the preview picture is larger than 500 pixels then show it in a larger mode
// But only, if the picture isn't higher than large (To prevent huge posts)
if (count($items)) {
foreach ($items as $item) {
- $owner = Item::deleteById($item);
+ $owner = Item::deleteForUser(['id' => $item], local_user());
if ($owner && !$uid)
$uid = $owner;
}
}
// delete the item
- Item::deleteById($item['id']);
+ Item::deleteForUser(['id' => $item['id']], local_user());
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
//NOTREACHED