Simplify the isSubDirectory() function
Simplify the isSubDirectory() function

isSubDirectory() checks if a specified $sub is a subdirectory of the
$parent, this is needed to prevent file inclusions.

Actually, the current code is more kind of a "hack" which I always
struggle over if browsing through source. So this should be a much
better implementation.

The implementation is really straightforward:
- [realpath()](http://php.net/manual/function.realpath.php) expands all
symbolic links and resolves references to '/./', '/../' and extra '/'
characters in the input path and return the canonicalized absolute
pathname.
- [strpos()](php.net/manual/function.strpos.php) returns FALSE if the
substring wasn't found.

Since this is an absolutely critical piece of code, I'd like to ensure
that this is absolutely safe!

sharidas/core,xx621998xx/server,phil-davis/core,lrytz/core,michaelletzgus/nextcloud-server,IljaN/core,nextcloud/server,endsguy/server,Ardinis/server,cernbox/core,pollopolea/core,whitekiba/server,sharidas/core,Ardinis/server,IljaN/core,andreas-p/nextcloud-server,IljaN/core,Ardinis/server,jbicha/server,pmattern/server,Ardinis/server,michaelletzgus/nextcloud-server,andreas-p/nextcloud-server,lrytz/core,bluelml/core,andreas-p/nextcloud-server,lrytz/core,pmattern/server,whitekiba/server,bluelml/core,endsguy/server,andreas-p/nextcloud-server,pollopolea/core,bluelml/core,pmattern/server,sharidas/core,endsguy/server,Ardinis/server,cernbox/core,owncloud/core,owncloud/core,pollopolea/core,cernbox/core,whitekiba/server,xx621998xx/server,endsguy/server,IljaN/core,pixelipo/server,pixelipo/server,cernbox/core,IljaN/core,sharidas/core,sharidas/core,michaelletzgus/nextcloud-server,owncloud/core,whitekiba/server,pixelipo/server,bluelml/core,xx621998xx/server,andreas-p/nextcloud-server,cernbox/core,jbicha/server,owncloud/core,nextcloud/server,jbicha/server,owncloud/core,pollopolea/core,bluelml/core,lrytz/core,nextcloud/server,xx621998xx/server,endsguy/server,jbicha/server,lrytz/core,pixelipo/server,pmattern/server,whitekiba/server,pixelipo/server,xx621998xx/server,nextcloud/server,pmattern/server,jbicha/server,michaelletzgus/nextcloud-server,pollopolea/core