summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsten <stenmarsh938@gmail.com>2015-09-30 18:16:33 +0300
committersten <stenmarsh938@gmail.com>2015-09-30 18:16:33 +0300
commit5405b574ca2b283bb5dce19b939b9c54c3d5f4b3 (patch)
treea77ebad2ef4d6b8ab907729439d5d5da38456161
parent43a8def557f332af72dced3f139a46211a7d610f (diff)
downloadscheduler-helper-php-5405b574ca2b283bb5dce19b939b9c54c3d5f4b3.zip
scheduler-helper-php-5405b574ca2b283bb5dce19b939b9c54c3d5f4b3.tar.gz
scheduler-helper-php-5405b574ca2b283bb5dce19b939b9c54c3d5f4b3.tar.bz2
Fix notice showing after trying to get Rec events without "repeats".
-rw-r--r--RecurringType.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/RecurringType.php b/RecurringType.php
index b9a08af..e7e7b0f 100644
--- a/RecurringType.php
+++ b/RecurringType.php
@@ -161,14 +161,19 @@ class RecurringType {
$formatDaysListPartReg = "/,/";
$parsedData = array();
+ $parts = preg_split($formatPartsReg, $dataStr);
list(
$parsedData[self::FLD_REC_TYPE],
$parsedData[self::FLD_REC_TYPE_STEP],
$parsedData[self::FLD_WEEK_DAY],
$parsedData[self::FLD_WEEK_NUMBER],
- $parsedData[self::FLD_WEEK_DAYS_LIST],
- $parsedData[self::FLD_REPEAT]
- ) = preg_split($formatPartsReg, $dataStr);
+ $parsedData[self::FLD_WEEK_DAYS_LIST]
+ ) = $parts;
+
+ if(isset($parts[5]))
+ {
+ $parsedData[self::FLD_REPEAT] = $parts[5];
+ }
$parsedData[self::FLD_WEEK_DAYS_LIST] = ($parsedData[self::FLD_WEEK_DAYS_LIST]) ?
preg_split($formatDaysListPartReg, $parsedData[self::FLD_WEEK_DAYS_LIST]) : array();
@@ -379,4 +384,4 @@ class RecurringType {
return $maxEndDateStamp;
}
-}
+} \ No newline at end of file