﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
22634	Plugin Editor ignores &plugin= variable	ZjanPreijde		"When a plugin is chosen and subsequently a file belonging to that plugin, a link is followed with the ?file=xx/zz&plugin=xx variables.
The plugin has the following code:
{{{
if ( isset($_REQUEST['file']) )
	$plugin = stripslashes($_REQUEST['file']);

if ( empty($plugin) ) {
	$plugin = array_keys($plugins);
	$plugin = $plugin[0];
}

$plugin_files = get_plugin_files($plugin);

if ( empty($file) )
	$file = $plugin_files[0];
else
	$file = stripslashes($file);
}}}
The result is :
a. The plugin select box is reset to the first plugin
b. The '(active)'/'(inactive)' text does not correspond to the chosen plugin any more.
I think the code should be changed into the following:
{{{
if ( isset($_REQUEST['plugin']) )
	$plugin = stripslashes($_REQUEST['plugin']);

if ( isset($_REQUEST['file']) )
	$file = stripslashes($_REQUEST['file']);

if ( empty($plugin) || !in_array($plugin, array_keys($plugins)) ) {
	$plugin = array_keys($plugins);
	$plugin = $plugin[0];
	$file = """";
}

$plugin_files = get_plugin_files($plugin);

if ( empty($file) || !in_array($file, $plugin_files) )
	$file = $plugin_files[0];
}}}
I'd attach a diff, if I'd only know how to create one :-)"	defect (bug)	closed	normal		Plugins	3.4.2	minor	duplicate		
