MDL-14589: strrpos is needed to check the last occurence MDL-15405: return the existing file in case one is found
MDL-14589: strrpos is needed to check the last occurence
MDL-15405: return the existing file in case one is found

dilawar/moodle