Project

General

Profile

« Previous | Next » 

Revision f0c5b768

Added by Marcos M 9 months ago

Fix parsing for ACB change reason. Fix #15711

Fix it by delimiting on the last occurrence of the delimiter.

View differences:

src/usr/local/www/services_acb.php
261 261
	$data_split = explode("\n", $data);
262 262

  
263 263
	foreach ($data_split as $ds) {
264
		$ds_split = explode($exp_sep, $ds);
264
		$ds_split = [];
265
		preg_match("/^(.*?){$oper_sep}(.*){$oper_sep}(.*)/", $ds, $ds_split);
265 266
		$tmp_array = array();
266
		$tmp_array['username'] = $ds_split[0];
267
		$tmp_array['reason'] = $ds_split[1];
268
		$tmp_array['time'] = $ds_split[2];
267
		$tmp_array['username'] = $ds_split[1];
268
		$tmp_array['reason'] = $ds_split[2];
269
		$tmp_array['time'] = $ds_split[3];
269 270

  
270 271
		/* Convert the time from server time to local. See #5250 */
271 272
		$budate = new DateTime($tmp_array['time'], $acbtz);
272 273
		$budate->setTimezone($mytz);
273 274
		$tmp_array['localtime'] = $budate->format(DATE_RFC2822);
274 275

  
275
		if ($ds_split[2] && $ds_split[0]) {
276
		if ($ds_split[3] && $ds_split[1]) {
276 277
			$confvers[] = $tmp_array;
277 278
		}
278 279
	}

Also available in: Unified diff