REPOSITORY MDL-24205, added more check of path and files