aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-26 15:56:41 +0000
committerMario <mario@mariovavti.com>2022-10-26 15:56:41 +0000
commit9c117ffa0546d6131310ae175e16e5ebf63992a1 (patch)
tree45d9e0f02c45ce487bce53be9140c8b7a293b218
parent9e95f189ed3d5b228b8133f04f66aca6de75b1ab (diff)
downloadvolse-hubzilla-9c117ffa0546d6131310ae175e16e5ebf63992a1.tar.gz
volse-hubzilla-9c117ffa0546d6131310ae175e16e5ebf63992a1.tar.bz2
volse-hubzilla-9c117ffa0546d6131310ae175e16e5ebf63992a1.zip
fix php warnings
-rw-r--r--Zotlabs/Lib/Libzotdir.php3
-rw-r--r--Zotlabs/Module/Cdav.php12
2 files changed, 8 insertions, 7 deletions
diff --git a/Zotlabs/Lib/Libzotdir.php b/Zotlabs/Lib/Libzotdir.php
index 3ee5c429a..fa691080f 100644
--- a/Zotlabs/Lib/Libzotdir.php
+++ b/Zotlabs/Lib/Libzotdir.php
@@ -457,12 +457,13 @@ class Libzotdir {
$arr['xprof_hash'] = $hash;
$arr['xprof_dob'] = '0000-00-00';
+
if (isset($profile['birthday'])) {
$arr['xprof_dob'] = (($profile['birthday'] === '0000-00-00')
? $profile['birthday']
: datetime_convert('', '', $profile['birthday'], 'Y-m-d')); // !!!! check this for 0000 year
}
- $arr['xprof_dob'] = ((isset($profile['birthday']) && $profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('','',$profile['birthday'],'Y-m-d')); // !!!! check this for 0000 year
+
$arr['xprof_age'] = ((isset($profile['age']) && $profile['age']) ? intval($profile['age']) : 0);
$arr['xprof_desc'] = ((isset($profile['description']) && $profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_gender'] = ((isset($profile['gender']) && $profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT,'UTF-8',false) : '');
diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php
index 6c168b2c9..e68b2e5b4 100644
--- a/Zotlabs/Module/Cdav.php
+++ b/Zotlabs/Module/Cdav.php
@@ -200,7 +200,7 @@ class Cdav extends Controller {
$etag = (isset($_SERVER['HTTP_IF_MATCH']) ? $_SERVER['HTTP_IF_MATCH'] : false);
// delete
- if($httpmethod === 'DELETE' && $cdavdata['etag'] == $etag) {
+ if($httpmethod === 'DELETE' && $etag && isset($cdavdata['etag']) && $cdavdata['etag'] == $etag) {
Libsync::build_sync_packet($channel['channel_id'], [
$sync => [
'action' => 'delete_card',
@@ -210,7 +210,7 @@ class Cdav extends Controller {
]);
}
else {
- if($etag && $cdavdata['etag'] !== $etag) {
+ if($etag && isset($cdavdata['etag']) && $cdavdata['etag'] !== $etag) {
// update
Libsync::build_sync_packet($channel['channel_id'], [
$sync => [
@@ -317,7 +317,7 @@ class Cdav extends Controller {
$calendars = $caldavBackend->getCalendarsForUser($principalUri);
//create new calendar
- if($_REQUEST['{DAV:}displayname'] && $_REQUEST['create']) {
+ if((isset($_REQUEST['{DAV:}displayname']) && $_REQUEST['{DAV:}displayname']) && (isset($_REQUEST['create']) && $_REQUEST['create'])) {
do {
$duplicate = false;
$calendarUri = random_string(40);
@@ -352,7 +352,7 @@ class Cdav extends Controller {
}
//create new calendar object via ajax request
- if($_REQUEST['submit'] === 'create_event' && $_REQUEST['title'] && $_REQUEST['target'] && $_REQUEST['dtstart']) {
+ if((isset($_REQUEST['submit']) && $_REQUEST['submit'] === 'create_event') && $_REQUEST['title'] && $_REQUEST['target'] && $_REQUEST['dtstart']) {
$id = explode(':', $_REQUEST['target']);
@@ -431,7 +431,7 @@ class Cdav extends Controller {
}
//edit calendar name and color
- if($_REQUEST['{DAV:}displayname'] && $_REQUEST['edit'] && $_REQUEST['id']) {
+ if((isset($_REQUEST['{DAV:}displayname']) && $_REQUEST['{DAV:}displayname']) && $_REQUEST['edit'] && $_REQUEST['id']) {
$id = explode(':', $_REQUEST['id']);
@@ -459,7 +459,7 @@ class Cdav extends Controller {
}
//edit calendar object via ajax request
- if($_REQUEST['submit'] === 'update_event' && $_REQUEST['uri'] && $_REQUEST['title'] && $_REQUEST['target'] && $_REQUEST['dtstart']) {
+ if((isset($_REQUEST['submit']) && $_REQUEST['submit'] === 'update_event') && $_REQUEST['uri'] && $_REQUEST['title'] && $_REQUEST['target'] && $_REQUEST['dtstart']) {
$id = explode(':', $_REQUEST['target']);