Code Duplication    Length = 16-16 lines in 2 locations

lib/stores/modules/sql_compiler.php 2 locations

@@ 310-325 (lines=16) @@
307
		}
308
		$value = '';
309
		$yych  = $YYBUFFER[$YYCURSOR];
310
		if ($this->_SCAN_AZ[$yych]) {
311
			$value .= $yych;
312
			$yych = $YYBUFFER[++$YYCURSOR];
313
			while (isset($this->_SCAN_AZ[$yych])) {
314
				$value .= $yych;
315
				$yych = $YYBUFFER[++$YYCURSOR];
316
			}
317
			$sort_type = strtoupper($value);
318
			if (!($sort_type == 'ASC' || $sort_type == 'DESC')) { // If sort type is anything else than ASC or DESC, it is not part of the order by.
319
				$sort_type = 'ASC';
320
				$YYCURSOR = $YYCURSOR - strlen($value);
321
				$value = '';
322
			}
323
		} else {
324
			$sort_type = 'ASC';
325
		}
326
		while (is_array($field)) {
327
			$result = array(
328
				'id' => 'orderbyfield',
@@ 349-364 (lines=16) @@
346
				}
347
				$value = '';
348
				$yych  = $YYBUFFER[$YYCURSOR];
349
				if ($this->_SCAN_AZ[$yych]) {
350
					$value .= $yych;
351
					$yych = $YYBUFFER[++$YYCURSOR];
352
					while (isset($this->_SCAN_AZ[$yych])) {
353
						$value .= $yych;
354
						$yych = $YYBUFFER[++$YYCURSOR];
355
					}
356
					$sort_type = strtoupper($value);
357
					if (!($sort_type == 'ASC' || $sort_type == 'DESC')) { // If sort type is anything else than ASC or DESC, it is not part of the order by.
358
						$sort_type = 'ASC';
359
						$YYCURSOR = $YYCURSOR - strlen($value);
360
						$value = '';
361
					}
362
				} else {
363
					$sort_type = 'ASC';
364
				}
365
			}
366
		}
367
		return $result;