Code Duplication    Length = 4-4 lines in 2 locations

plugin/buycourses/src/Requests/IRI.php 2 locations

@@ 382-385 (lines=4) @@
379
			// where ".." is a complete path segment, then replace that prefix
380
			// with "/" in the input buffer and remove the last segment and its
381
			// preceding "/" (if any) from the output buffer; otherwise,
382
			elseif (strpos($input, '/../') === 0) {
383
				$input = substr($input, 3);
384
				$output = substr_replace($output, '', strrpos($output, '/'));
385
			}
386
			elseif ($input === '/..') {
387
				$input = '/';
388
				$output = substr_replace($output, '', strrpos($output, '/'));
@@ 399-402 (lines=4) @@
396
			// the output buffer, including the initial "/" character (if any)
397
			// and any subsequent characters up to, but not including, the next
398
			// "/" character or the end of the input buffer
399
			elseif (($pos = strpos($input, '/', 1)) !== false) {
400
				$output .= substr($input, 0, $pos);
401
				$input = substr_replace($input, '', 0, $pos);
402
			}
403
			else {
404
				$output .= $input;
405
				$input = '';