*/
public final static boolean isPHPFileName(String name) {
+ //avoid handling a file without base name, e.g. ".php", which is a valid Eclipse resource name
+ File file=new File(name);
+ if (file.getName().startsWith(".")) {
+ return false;
+ }
IWorkbench workbench = PlatformUI.getWorkbench();
IEditorRegistry registry = workbench.getEditorRegistry();
IEditorDescriptor[] descriptors = registry.getEditors(name);
for (int i = 0; i < descriptors.length; i++) {
if (descriptors[i].getId().equals(PHPeclipsePlugin.EDITOR_ID)) {
- return true;
+ return true;
}
}
// String extension = getFileExtension(name);