Error on plugin detection

Teal 03 Apr, 2008
Your plugin detection fails if project is under version control because it belivies that .svn-folder is one plugin. I think you should ignore also all hidden files (starting with dot) not only . and ..


$directory = JPATH_SITE.'/components/com_chronocontact/plugins/';
			$results = array();
			$handler = opendir($directory);
			while ($file = readdir($handler)) {
				if ($file != '.' && $file != '..')
					$results[] = str_replace(".php","", $file);
			}
GreyHead 03 Apr, 2008
Hi Teal,

Yes, I found the same thing (or very similar). Here's the fix I used:

I made a modified version of a the Joomla plugin and renamed the old one to ...php.old in case I needed to switch back. This broke the admin because it tries to load all files in the plugin folder.

I fixed it by changing

if ( $file != '.' && $file != '..' )

to

if ( $file != '.' && $file != '..' && substr($file, -4) == '.php' )

Occurs in three places I think toolbar.html, admin, admin.html

Bob
This topic is locked and no more replies can be posted.