[wp-trac] Re: [WordPress Trac] #7870: gears-manifest.php might be
included on administration page, when it should not be
WordPress Trac
wp-trac at lists.automattic.com
Sun Oct 12 11:57:01 GMT 2008
#7870: gears-manifest.php might be included on administration page, when it should
not be
-------------------------------------+--------------------------------------
Reporter: impleri | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.8
Component: Administration | Version: 2.6.1
Severity: normal | Resolution:
Keywords: gears reporter-feedback |
-------------------------------------+--------------------------------------
Comment (by impleri):
Here is my plugin which I am working on:
{{{
#!php
<?php
/*
Plugin Name: Widgets Directory
Plugin URI: http://impleri.net/
Description: Loads all widgets in the current directory
Version: 1.0
Author: impleri
Author URI: http://impleri.net/
*/
$me = basename(__FILE__);
$here = dirname($me);
// make a directory object and iterate through its contents
function _load_the_modules($where)
{
global $me;
static $files=array();
static $done = false;
if($done)
{
return $files;
}
$done = true;
$dir = dir($where);
while($it = $dir->read())
{
if (($it != $me) && ($it != '.') && ($it != '..'))
{
include($dir->path . '/' . $it);
$files[] = $it;
}
}
$dir->close();
// put all included files into a string
$files = (empty($files)) ? 'None' : implode(', ', $files);
return $files;
}
_load_the_modules($here);
?>
}}}
The file is located in a subdirectory under plugins (currently "widgets")
with a number of widgets that work fine one their own (I just hate having
to activate/deactivate 12 widgets when it can be a single plugin instead).
The other plugin which threw this error once (then mysteriously worked) is
the Organize Series plugin.
--
Ticket URL: <http://trac.wordpress.org/ticket/7870#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list