private function isWithinPublicPath($testFor)
 {
     $testFor = realpath($testFor);
     $webroot = realpath($this->settings->get('app.webroot', 'public'));
     if (substr($testFor, 0, strlen($webroot)) == $webroot) {
         return file_exists($testFor);
     }
     return false;
 }
Example #2
0
 /**
  * BasePathStripper constructor.
  *
  * @param SettingsInterface $settings
  */
 public function __construct(SettingsInterface $settings)
 {
     $this->basePath = $settings->get('app.basePath', '');
 }