Quick fix PHP notices in various files
- Remove unused variables - Fix variable name typos - Use x() and defaults() to fix undefined index - Add back uninitialized variables
This commit is contained in:
parent
861c4c7474
commit
9f04017e27
9 changed files with 41 additions and 35 deletions
|
@ -606,6 +606,7 @@ class Worker
|
|||
$exponent = 3;
|
||||
$slope = $maxworkers / pow($maxsysload, $exponent);
|
||||
$queues = ceil($slope * pow(max(0, $maxsysload - $load), $exponent));
|
||||
$processlist = '';
|
||||
|
||||
if (Config::get('system', 'worker_debug')) {
|
||||
// Create a list of queue entries grouped by their priority
|
||||
|
|
|
@ -662,7 +662,7 @@ class Contact extends BaseObject
|
|||
if (!DBM::is_result($contact)) {
|
||||
// The link could be provided as http although we stored it as https
|
||||
$ssl_url = str_replace('http://', 'https://', $url);
|
||||
$r = dba::select('contact', array('id', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
|
||||
$r = dba::select('contact', array('id', 'avatar', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
|
||||
$contact = dba::fetch($r);
|
||||
dba::close($r);
|
||||
}
|
||||
|
@ -674,7 +674,7 @@ class Contact extends BaseObject
|
|||
$update_contact = ($contact['avatar-date'] < datetime_convert('', '', 'now -7 days'));
|
||||
|
||||
// We force the update if the avatar is empty
|
||||
if ($contact['avatar'] == '') {
|
||||
if (!x($contact, 'avatar')) {
|
||||
$update_contact = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ class Probe
|
|||
$data["url"] = $uri;
|
||||
}
|
||||
|
||||
if ($data["photo"] != "") {
|
||||
if (x($data, "photo")) {
|
||||
$data["baseurl"] = matching_url(normalise_link($data["baseurl"]), normalise_link($data["photo"]));
|
||||
} else {
|
||||
$data["photo"] = System::baseUrl().'/images/person-175.jpg';
|
||||
|
@ -341,7 +341,7 @@ class Probe
|
|||
$data["name"] = $data["nick"];
|
||||
}
|
||||
|
||||
if ($data["name"] == "") {
|
||||
if (!x($data, "name")) {
|
||||
$data["name"] = $data["url"];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue