annotate plugins/libcalendaring/lib/Sabre/VObject/Reader.php @ 4:888e774ee983

libcalendar plugin as distributed
author Charlie Root
date Sat, 13 Jan 2018 08:57:56 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
1 <?php
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
2
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
4
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
5 /**
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
6 * VCALENDAR/VCARD reader
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
7 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
8 * This class reads the vobject file, and returns a full element tree.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
9 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
10 * TODO: this class currently completely works 'statically'. This is pointless,
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
11 * and defeats OOP principals. Needs refactoring in a future version.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
12 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
13 * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/).
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
14 * @author Evert Pot (http://evertpot.com/)
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
15 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
16 */
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
17 class Reader {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
18
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
19 /**
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
20 * If this option is passed to the reader, it will be less strict about the
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
21 * validity of the lines.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
22 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
23 * Currently using this option just means, that it will accept underscores
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
24 * in property names.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
25 */
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
26 const OPTION_FORGIVING = 1;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
27
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
28 /**
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
29 * If this option is turned on, any lines we cannot parse will be ignored
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
30 * by the reader.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
31 */
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
32 const OPTION_IGNORE_INVALID_LINES = 2;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
33
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
34 /**
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
35 * Parses the file and returns the top component
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
36 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
37 * The options argument is a bitfield. Pass any of the OPTIONS constant to
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
38 * alter the parsers' behaviour.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
39 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
40 * @param string $data
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
41 * @param int $options
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
42 * @return Node
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
43 */
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
44 static function read($data, $options = 0) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
45
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
46 // Normalizing newlines
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
47 $data = str_replace(array("\r","\n\n"), array("\n","\n"), $data);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
48
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
49 $lines = explode("\n", $data);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
50
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
51 // Unfolding lines
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
52 $lines2 = array();
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
53 foreach($lines as $line) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
54
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
55 // Skipping empty lines
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
56 if (!$line) continue;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
57
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
58 if ($line[0]===" " || $line[0]==="\t") {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
59 $lines2[count($lines2)-1].=substr($line,1);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
60 } else {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
61 $lines2[] = $line;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
62 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
63
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
64 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
65
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
66 unset($lines);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
67
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
68 reset($lines2);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
69
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
70 return self::readLine($lines2, $options);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
71
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
72 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
73
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
74 /**
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
75 * Reads and parses a single line.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
76 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
77 * This method receives the full array of lines. The array pointer is used
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
78 * to traverse.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
79 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
80 * This method returns null if an invalid line was encountered, and the
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
81 * IGNORE_INVALID_LINES option was turned on.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
82 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
83 * @param array $lines
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
84 * @param int $options See the OPTIONS constants.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
85 * @return Node
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
86 */
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
87 static private function readLine(&$lines, $options = 0) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
88
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
89 $line = current($lines);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
90 $lineNr = key($lines);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
91 next($lines);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
92
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
93 // Components
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
94 if (strtoupper(substr($line,0,6)) === "BEGIN:") {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
95
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
96 $componentName = strtoupper(substr($line,6));
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
97 $obj = Component::create($componentName);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
98
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
99 $nextLine = current($lines);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
100
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
101 while(strtoupper(substr($nextLine,0,4))!=="END:") {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
102
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
103 $parsedLine = self::readLine($lines, $options);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
104 $nextLine = current($lines);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
105
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
106 if (is_null($parsedLine)) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
107 continue;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
108 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
109 $obj->add($parsedLine);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
110
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
111 if ($nextLine===false)
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
112 throw new ParseException('Invalid VObject. Document ended prematurely.');
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
113
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
114 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
115
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
116 // Checking component name of the 'END:' line.
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
117 if (substr($nextLine,4)!==$obj->name) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
118 throw new ParseException('Invalid VObject, expected: "END:' . $obj->name . '" got: "' . $nextLine . '"');
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
119 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
120 next($lines);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
121
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
122 return $obj;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
123
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
124 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
125
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
126 // Properties
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
127 //$result = preg_match('/(?P<name>[A-Z0-9-]+)(?:;(?P<parameters>^(?<!:):))(.*)$/',$line,$matches);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
128
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
129 if ($options & self::OPTION_FORGIVING) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
130 $token = '[A-Z0-9-\._]+';
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
131 } else {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
132 $token = '[A-Z0-9-\.]+';
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
133 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
134 $parameters = "(?:;(?P<parameters>([^:^\"]|\"([^\"]*)\")*))?";
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
135 $regex = "/^(?P<name>$token)$parameters:(?P<value>.*)$/i";
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
136
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
137 $result = preg_match($regex,$line,$matches);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
138
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
139 if (!$result) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
140 if ($options & self::OPTION_IGNORE_INVALID_LINES) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
141 return null;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
142 } else {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
143 throw new ParseException('Invalid VObject, line ' . ($lineNr+1) . ' did not follow the icalendar/vcard format');
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
144 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
145 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
146
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
147 $propertyName = strtoupper($matches['name']);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
148 $propertyValue = preg_replace_callback('#(\\\\(\\\\|N|n))#',function($matches) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
149 if ($matches[2]==='n' || $matches[2]==='N') {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
150 return "\n";
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
151 } else {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
152 return $matches[2];
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
153 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
154 }, $matches['value']);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
155
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
156 $obj = Property::create($propertyName, $propertyValue);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
157
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
158 if ($matches['parameters']) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
159
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
160 foreach(self::readParameters($matches['parameters']) as $param) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
161 $obj->add($param);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
162 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
163
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
164 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
165
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
166 return $obj;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
167
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
168
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
169 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
170
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
171 /**
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
172 * Reads a parameter list from a property
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
173 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
174 * This method returns an array of Parameter
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
175 *
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
176 * @param string $parameters
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
177 * @return array
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
178 */
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
179 static private function readParameters($parameters) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
180
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
181 $token = '[A-Z0-9-]+';
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
182
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
183 $paramValue = '(?P<paramValue>[^\"^;]*|"[^"]*")';
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
184
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
185 $regex = "/(?<=^|;)(?P<paramName>$token)(=$paramValue(?=$|;))?/i";
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
186 preg_match_all($regex, $parameters, $matches, PREG_SET_ORDER);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
187
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
188 $params = array();
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
189 foreach($matches as $match) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
190
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
191 if (!isset($match['paramValue'])) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
192
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
193 $value = null;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
194
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
195 } else {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
196
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
197 $value = $match['paramValue'];
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
198
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
199 if (isset($value[0]) && $value[0]==='"') {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
200 // Stripping quotes, if needed
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
201 $value = substr($value,1,strlen($value)-2);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
202 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
203
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
204 $value = preg_replace_callback('#(\\\\(\\\\|N|n|;|,))#',function($matches) {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
205 if ($matches[2]==='n' || $matches[2]==='N') {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
206 return "\n";
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
207 } else {
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
208 return $matches[2];
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
209 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
210 }, $value);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
211
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
212 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
213
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
214 $params[] = new Parameter($match['paramName'], $value);
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
215
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
216 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
217
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
218 return $params;
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
219
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
220 }
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
221
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
222
888e774ee983 libcalendar plugin as distributed
Charlie Root
parents:
diff changeset
223 }