Use dirname() instead of pathinfo(..., PATHINFO_DIRNAME)

System version 0.501.2+build-509
modules:
Blogs 0.091.0+build-91
Comments 0.026
Cron 0.008
Deferred tasks 0.1.2+build-5
Disqus 1.0.1+build-3
Feedback 0.008
HybridAuth 2.1.1-cs40
OAuth2 0.032
Photo_gallery 0.026.0
Plupload 2.1.1-cs3
Static_pages 0.043
plugins:
Admin_default_theme 0.005
Fotorama 4.5.1-cs1
SimpleImage 2.5.3-cs1
TinyMCE 4.0.20-cs1