Lines Matching defs:input

355      * @param string $input
358 protected function remove_dot_segments($input)
361 while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') {
362 // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise,
363 if (strpos($input, '../') === 0) {
364 $input = substr($input, 3);
365 } elseif (strpos($input, './') === 0) {
366 $input = substr($input, 2);
368 // 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,
369 elseif (strpos($input, '/./') === 0) {
370 $input = substr($input, 2);
371 } elseif ($input === '/.') {
372 $input = '/';
374 // 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,
375 elseif (strpos($input, '/../') === 0) {
376 $input = substr($input, 3);
378 } elseif ($input === '/..') {
379 $input = '/';
382 // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise,
383 elseif ($input === '.' || $input === '..') {
384 $input = '';
386 // 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
387 elseif (($pos = strpos($input, '/', 1)) !== false) {
388 $output .= substr($input, 0, $pos);
389 $input = substr_replace($input, '', 0, $pos);
391 $output .= $input;
392 $input = '';
395 return $output . $input;