Request.php 678 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\MediaStorage\Model\File\Storage;
  7. use Magento\Framework\HTTP\PhpEnvironment\Request as HttpRequest;
  8. class Request
  9. {
  10. /**
  11. * Path info
  12. *
  13. * @var string
  14. */
  15. private $pathInfo;
  16. /**
  17. * @param HttpRequest $request
  18. */
  19. public function __construct(HttpRequest $request)
  20. {
  21. $this->pathInfo = str_replace('..', '', ltrim($request->getPathInfo(), '/'));
  22. }
  23. /**
  24. * Retrieve path info
  25. *
  26. * @return string
  27. */
  28. public function getPathInfo()
  29. {
  30. return $this->pathInfo;
  31. }
  32. }