Lines Matching refs:input

356      * @param string $input
359 protected function remove_dot_segments($input)
362 while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') {
363 // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise,
364 if (strpos($input, '../') === 0) {
365 $input = substr($input, 3);
366 } elseif (strpos($input, './') === 0) {
367 $input = substr($input, 2);
369 // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise,
370 elseif (strpos($input, '/./') === 0) {
371 $input = substr($input, 2);
372 } elseif ($input === '/.') {
373 $input = '/';
375 // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise,
376 elseif (strpos($input, '/../') === 0) {
377 $input = substr($input, 3);
379 } elseif ($input === '/..') {
380 $input = '/';
383 // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise,
384 elseif ($input === '.' || $input === '..') {
385 $input = '';
387 // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer
388 elseif (($pos = strpos($input, '/', 1)) !== false) {
389 $output .= substr($input, 0, $pos);
390 $input = substr_replace($input, '', 0, $pos);
392 $output .= $input;
393 $input = '';
396 return $output . $input;