mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-17 05:48:49 +00:00
Continued:
- x() is deprecated, use proper isset()/empty() (MrPetovan) Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
parent
d05a92370a
commit
3a9a5fcde8
4 changed files with 14 additions and 9 deletions
|
@ -26,8 +26,9 @@ function geocoordinates_uninstall()
|
|||
|
||||
function geocoordinates_resolve_item(&$item)
|
||||
{
|
||||
if((!x($item, 'coord')) || (x($item, 'location')))
|
||||
if (!isset($item['coord']) || isset($item['location'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$key = Config::get("geocoordinates", "api_key");
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ function googlemaps_location(App $a, array &$item)
|
|||
return;
|
||||
}
|
||||
|
||||
if (x($item, 'coord')) {
|
||||
if (isset($item['coord']) {
|
||||
$target = "http://maps.google.com/?q=".urlencode($item['coord']);
|
||||
} else {
|
||||
$target = "http://maps.google.com/?q=".urlencode($item['location']);
|
||||
}
|
||||
|
||||
if (x($item, 'location')) {
|
||||
if (isset($item['location'])) {
|
||||
$title = $item['location'];
|
||||
} else {
|
||||
$title = $item['coord'];
|
||||
|
|
|
@ -104,7 +104,7 @@ function mailstream_post_hook(App $a, array &$item) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!x($item, 'uid') || !x($item, 'contact-id') || !x($item, 'uri')) {
|
||||
if (!isset($item['uid']) || !isset($item['contact-id']) || !isset($item['uri'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -223,9 +223,10 @@ function mailstream_decode_subject($subject) {
|
|||
}
|
||||
|
||||
function mailstream_subject(array $item) {
|
||||
if (x($item, 'title')) {
|
||||
if (isset($item['title'])) {
|
||||
return mailstream_decode_subject($item['title']);
|
||||
}
|
||||
|
||||
$parent = $item['thr-parent'];
|
||||
// Don't look more than 100 levels deep for a subject, in case of loops
|
||||
for ($i = 0; ($i < 100) && $parent; $i++) {
|
||||
|
@ -267,13 +268,16 @@ function mailstream_subject(array $item) {
|
|||
}
|
||||
|
||||
function mailstream_send(App $a, $message_id, array $item, $user) {
|
||||
if (!x($item, 'visible')) {
|
||||
if (!isset($item['visible'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$message_id) {
|
||||
return;
|
||||
}
|
||||
require_once(dirname(__file__).'/phpmailer/class.phpmailer.php');
|
||||
|
||||
// @TODO Isn't there a better way?
|
||||
require_once dirname(__FILE__) . '/phpmailer/class.phpmailer.php';
|
||||
|
||||
$attachments = [];
|
||||
mailstream_do_images($a, $item, $attachments);
|
||||
|
|
|
@ -90,7 +90,7 @@ function openstreetmap_location($a, &$item)
|
|||
$nomserver = OSM_NOM;
|
||||
}
|
||||
|
||||
if (x($item, 'coord')) {
|
||||
if (isset($item['coord'])) {
|
||||
$coords = explode(' ', $item['coord']);
|
||||
if (count($coords) > 1) {
|
||||
$lat = urlencode(round($coords[0], 5));
|
||||
|
@ -107,7 +107,7 @@ function openstreetmap_location($a, &$item)
|
|||
$target = $nomserver.'?q='.urlencode($item['location']);
|
||||
}
|
||||
|
||||
if (x($item, 'location')) {
|
||||
if (isset($item['location'])) {
|
||||
$title = $item['location'];
|
||||
} else {
|
||||
$title = $item['coord'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue