Skip to content

Commit

Permalink
Fixes #4056 - plugin menu detection path limits.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Nov 18, 2023
1 parent d9fc6d4 commit 6b7aa7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions e107_handlers/menumanager_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ function menuSetPreset()
/**
* @return void
*/
function menuScanMenus()
public function menuScanMenus()
{
global $sql2;
$sql = e107::getDb();
Expand All @@ -484,7 +484,7 @@ function menuScanMenus()
$efile->dirFilter = array('/', 'CVS', '.svn', 'languages');
$efile->fileFilter[] = '^e_menu\.php$';

$fileList = $efile->get_files(e_PLUGIN, "_menu\.php$", 'standard', 2);
$fileList = $efile->get_files(e_PLUGIN, "_menu\.php$", 'standard', 1);

// $this->menuAddMessage('Scanning for new menus', E_MESSAGE_DEBUG);

Expand Down Expand Up @@ -2901,7 +2901,7 @@ private function scanForNew()
{
$fl = e107::getFile();
$fl->dirFilter = array('/', 'CVS', '.svn', 'languages');
$files = $fl->get_files(e_PLUGIN,"_menu\.php$",'standard',2);
$files = $fl->get_files(e_PLUGIN,"_menu\.php$",'standard',1);

$data = array();

Expand Down
4 changes: 2 additions & 2 deletions e107_handlers/plugin_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3258,12 +3258,12 @@ private function addonUser($plug, $function, $opts=array())

unset($attrib['read'], $attrib['write'], $attrib['applicable'], $attrib['required'], $attrib['fieldType']);

$name = $this->ue_field_name($plug, EUF_ADDON, $field);
$name = $this->ue_field_name($plug, defset('EUF_ADDON'), $field);

$insert = array(
'name' => $name,
'text' => varset($attrib['title'], "None Specified"),
'type' => EUF_ADDON,
'type' => defset('EUF_ADDON'),
'parms' => $plug,
'values' => e107::serialize($attrib, 'json'),
'default' => null,
Expand Down
5 changes: 4 additions & 1 deletion e107_tests/tests/unit/pluginsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ public function testBlank()
{
// $this->_debugPlugin = '_blank';

$this->pluginInstall('_blank');
$result = $this->pluginInstall('_blank');

// print_r($result);
// $this->pluginUninstall('_blank');


Expand Down Expand Up @@ -578,6 +579,8 @@ private function pluginInstall($pluginDir)
{
$this->assertTrue($val, $key." list pref is missing for ".$pluginDir);
}

return $install;
}

private function pluginUninstall($pluginDir, $opts=array())
Expand Down

0 comments on commit 6b7aa7c

Please sign in to comment.