/** * Detects if provided path addresses resource contained in webspace. * * This method is checking if given pathname is subordinated to current * server's document root. On using aliasing/rewriting pathname might be * valid though failing here. In that case setting environment variable * to proper document root containing pathname is required. * * @param string $pathname pathname of resource to test * @return boolean true on resource contained in web folder */ public static function isInWebfolder($pathname) { return self::relativeToAnother(context::getDocumentRoot(), $pathname) !== false; }