summaryrefslogtreecommitdiff
path: root/plugins/libcalendaring
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-11-21 09:03:18 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-11-21 09:03:18 (GMT)
commitac4f6e75622c76e32d6a34fcbfb7b57ead18fd92 (patch)
tree7004e44eff67616b8cbc306c8652809f885b7b8d /plugins/libcalendaring
parent5738a7a7eca4256f39b279918d77f354cb9d4e28 (diff)
downloadroundcubemail-plugins-kolab-ac4f6e75622c76e32d6a34fcbfb7b57ead18fd92.tar.gz
Avoid unused variables (also fixed some bugs) found in static code analysis
Diffstat (limited to 'plugins/libcalendaring')
-rw-r--r--plugins/libcalendaring/lib/libcalendaring_itip.php2
-rw-r--r--plugins/libcalendaring/libvcalendar.php7
2 files changed, 5 insertions, 4 deletions
diff --git a/plugins/libcalendaring/lib/libcalendaring_itip.php b/plugins/libcalendaring/lib/libcalendaring_itip.php
index bd83f16..2ba1547 100644
--- a/plugins/libcalendaring/lib/libcalendaring_itip.php
+++ b/plugins/libcalendaring/lib/libcalendaring_itip.php
@@ -353,7 +353,7 @@ class libcalendaring_itip
if ($existing) {
$rsvp = $event['rsvp'];
$emails = $this->lib->get_user_emails();
- foreach ($existing['attendees'] as $i => $attendee) {
+ foreach ($existing['attendees'] as $attendee) {
if ($attendee['email'] && in_array(strtolower($attendee['email']), $emails)) {
$status = strtoupper($attendee['status']);
break;
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index 062ee7e..b94ceed 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -318,7 +318,7 @@ class libvcalendar implements Iterator
if (!$seen[$object['uid']]++) {
// parse recurrence exceptions
if ($object['recurrence']) {
- foreach ($vobject->children as $i => $component) {
+ foreach ($vobject->children as $component) {
if ($component->name == 'VEVENT' && isset($component->{'RECURRENCE-ID'})) {
$object['recurrence']['EXCEPTIONS'][] = $this->_to_array($component);
}
@@ -391,7 +391,6 @@ class libvcalendar implements Iterator
}
// map other attributes to internal fields
- $_attendees = array();
foreach ($ve->children as $prop) {
if (!($prop instanceof VObject\Property))
continue;
@@ -857,7 +856,6 @@ class libvcalendar implements Iterator
*/
public function export($objects, $method = null, $write = false, $get_attachment = false, $with_timezones = true)
{
- $memory_limit = parse_bytes(ini_get('memory_limit'));
$this->method = $method;
// encapsulate in VCALENDAR container
@@ -1095,10 +1093,13 @@ class libvcalendar implements Iterator
if ($event['comment'])
$ve->add('COMMENT', $event['comment']);
+ $memory_limit = parse_bytes(ini_get('memory_limit'));
+
// export attachments
if (!empty($event['attachments'])) {
foreach ((array)$event['attachments'] as $attach) {
// check available memory and skip attachment export if we can't buffer it
+ // @todo: use rcube_utils::mem_check()
if (is_callable($get_attachment) && $memory_limit > 0 && ($memory_used = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024)
&& $attach['size'] && $memory_used + $attach['size'] * 3 > $memory_limit) {
continue;