function contacts_batch_actions(App $a)
{
- $contacts_id = $_POST['contact_batch'];
- if (!is_array($contacts_id)) {
+ if (empty($_POST['contact_batch']) || !is_array($_POST['contact_batch'])) {
return;
}
+ $contacts_id = $_POST['contact_batch'];
+
$orig_records = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND `uid` = %d AND `self` = 0",
implode(",", $contacts_id),
intval(local_user())
$direct_cache = false;
}
+ if (empty($_REQUEST['url'])) {
+ System::httpExit(400, ["title" => L10n::t('Bad Request.')]);
+ }
+
if (!$direct_cache) {
$urlhash = 'pic:' . sha1($_REQUEST['url']);
try {
if (function_exists("getimagesizefromstring")) {
- $data = getimagesizefromstring($img_str);
+ $data = @getimagesizefromstring($img_str);
} else {
$tempfile = tempnam(get_temppath(), "cache");
break;
case "enclosure":
$enclosure = $href;
- if (strlen($item["attach"])) {
+
+ if (!empty($item["attach"])) {
$item["attach"] .= ",";
+ } else {
+ $item["attach"] = "";
}
$item["attach"] .= '[attach]href="' . $href . '" length="' . $length . '" type="' . $type . '" title="' . $title . '"[/attach]';