mirror of
https://github.com/e107inc/e107.git
synced 2025-07-09 09:13:25 +02:00
Plugin scanner checks e_xxx addons for no space round start/end tags - should help RSS problems
This commit is contained in:
@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/db.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/db.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:33:19 $
|
| $Date: 2007-02-14 21:17:03 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -153,8 +153,11 @@ function optimizesql($mySQLdefaultdb) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function plugin_viewscan()
|
function plugin_viewscan()
|
||||||
{
|
{
|
||||||
|
$error_messages = array(0 => DBLAN_31, 1 =>"<b>".DBLAN_32."</b>", 2 =>"<strong>".DBLAN_33."</strong>", 3 => DBLAN_34);
|
||||||
|
|
||||||
global $sql, $pref, $ns, $tp;
|
global $sql, $pref, $ns, $tp;
|
||||||
require_once(e_HANDLER."plugin_class.php");
|
require_once(e_HANDLER."plugin_class.php");
|
||||||
$ep = new e107plugin;
|
$ep = new e107plugin;
|
||||||
@ -167,15 +170,34 @@ function plugin_viewscan()
|
|||||||
<div style='text-align:center'> <table class='fborder' style='".ADMIN_WIDTH."'>
|
<div style='text-align:center'> <table class='fborder' style='".ADMIN_WIDTH."'>
|
||||||
<tr><td class='fcaption'>".DBLAN_24."</td>
|
<tr><td class='fcaption'>".DBLAN_24."</td>
|
||||||
<td class='fcaption'>".DBLAN_25."</td>
|
<td class='fcaption'>".DBLAN_25."</td>
|
||||||
<td class='fcaption'>".DBLAN_26."</td>
|
<td class='fcaption'>".DBLAN_26."<br />".DBLAN_30."</td>
|
||||||
<td class='fcaption'>".DBLAN_27."</td>";
|
<td class='fcaption'>".DBLAN_27."</td>";
|
||||||
|
|
||||||
$sql -> db_Select("plugin", "*", "plugin_id !='' order by plugin_path ASC"); // Must order by path to pick up duplicates. (plugin names may change).
|
$sql -> db_Select("plugin", "*", "plugin_id !='' order by plugin_path ASC"); // Must order by path to pick up duplicates. (plugin names may change).
|
||||||
while($row = $sql-> db_Fetch()){
|
while($row = $sql-> db_Fetch())
|
||||||
|
{
|
||||||
$text .= "<tr>
|
$text .= "<tr>
|
||||||
<td class='forumheader3'>".$tp->toHtml($row['plugin_name'],FALSE,"defs")."</td>
|
<td class='forumheader3'>".$tp->toHtml($row['plugin_name'],FALSE,"defs")."</td>
|
||||||
<td class='forumheader3'>".$row['plugin_path']."</td>
|
<td class='forumheader3'>".$row['plugin_path']."</td>
|
||||||
<td class='forumheader3'>".str_replace(",","<br />",$row['plugin_addons'])."</td>
|
<td class='forumheader3'>";
|
||||||
|
|
||||||
|
if (trim($row['plugin_addons']))
|
||||||
|
{
|
||||||
|
$nl_code = '';
|
||||||
|
foreach(explode(',',$row['plugin_addons']) as $this_addon)
|
||||||
|
{
|
||||||
|
$ret_code = 3; // Default to 'not checked
|
||||||
|
if (strpos($this_addon,'e_') === 0)
|
||||||
|
{
|
||||||
|
// echo "Checking: ".$row['plugin_path'].":".$this_addon."<br />";
|
||||||
|
$ret_code = $ep->checkAddon($row['plugin_path'],$this_addon); // See whether spaces before opening tag or after closing tag
|
||||||
|
}
|
||||||
|
$text .= $nl_code.$this_addon." - ".$error_messages[$ret_code]; // $ret_code - 0=OK, 1=content error, 2=access error
|
||||||
|
$nl_code = "<br />";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "</td>
|
||||||
<td class='forumheader3' style='text-align:center'>";
|
<td class='forumheader3' style='text-align:center'>";
|
||||||
if($previous == $row['plugin_path'])
|
if($previous == $row['plugin_path'])
|
||||||
{
|
{
|
||||||
@ -191,6 +213,7 @@ function plugin_viewscan()
|
|||||||
</tr>";
|
</tr>";
|
||||||
$previous = $row['plugin_path'];
|
$previous = $row['plugin_path'];
|
||||||
}
|
}
|
||||||
|
// $text .= "<tr><td colspan='4' class='forumheader3'>".DBLAN_30."</td></tr>";
|
||||||
$text .= "</table></div></form>";
|
$text .= "</table></div></form>";
|
||||||
$ns -> tablerender(ADLAN_CL_7, $text);
|
$ns -> tablerender(ADLAN_CL_7, $text);
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
||||||
| $Revision: 1.4 $
|
| $Revision: 1.5 $
|
||||||
| $Date: 2007-02-11 20:16:25 $
|
| $Date: 2007-02-14 21:17:03 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@ -656,7 +656,16 @@ class e107plugin
|
|||||||
return implode(",",$p_addons);
|
return implode(",",$p_addons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkAddon($plugin_path,$e_xxx)
|
||||||
|
{ // Return 0 = OK, 1 = Fail, 2 = inaccessible
|
||||||
|
if(is_readable(e_PLUGIN.$plugin_path."/".$e_xxx.".php"))
|
||||||
|
{
|
||||||
|
$file_text = file_get_contents(e_PLUGIN.$plugin_path."/".$e_xxx.".php");
|
||||||
|
if ((substr($file_text,0,5) != '<'.'?php') || (substr($file_text,-2,2) !='?>')) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
| e107 website system - Language File.
|
| e107 website system - Language File.
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_db.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_db.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:40 $
|
| $Date: 2007-02-14 21:17:15 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
define("DBLAN_1", "Core settings backed up in database.");
|
define("DBLAN_1", "Core settings backed up in database.");
|
||||||
@ -38,8 +38,11 @@ define("DBLAN_26", "Included add-ons");
|
|||||||
define("DBLAN_27", "Installed");
|
define("DBLAN_27", "Installed");
|
||||||
define("DBLAN_28", "Click button to scan plugin directories for changes");
|
define("DBLAN_28", "Click button to scan plugin directories for changes");
|
||||||
define("DBLAN_29", "Scan plugin directories");
|
define("DBLAN_29", "Scan plugin directories");
|
||||||
|
define("DBLAN_30", " (If an addon shows an error, check for characters outside the PHP opening/closing tags)");
|
||||||
|
define("DBLAN_31", "Pass");
|
||||||
|
define("DBLAN_32", "Error");
|
||||||
|
define("DBLAN_33", "Inaccessible");
|
||||||
|
define("DBLAN_34", "Not checked");
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user