fixed bug #1416848 'Insert new row from Browse page'

This commit is contained in:
Sebastian Mendel
2006-02-13 12:19:51 +00:00
parent b8da992112
commit 43f74a9c2a
2 changed files with 37 additions and 31 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2006-02-13 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* libraries/common.lib.php:
- fixed bug #1416848 'Insert new row from Browse page'
2006-02-12 Marc Delisle <lem9@users.sourceforge.net>
* lang/english and hebrew: bug #1429769, typo
* tbl_change.php, tbl_replace.php: bug #1429074, "go back to this page"

View File

@@ -491,6 +491,39 @@ function PMA_arrayWalkRecursive(&$array, $function)
}
}
/**
* boolean phpMyAdmin.PMA_checkPageValidity(string &$page, array $whitelist)
*
* checks given given $page against given $whitelist and returns true if valid
* it ignores optionaly query paramters in $page (script.php?ignored)
*
* @uses in_array()
* @uses urldecode()
* @uses substr()
* @uses strpos()
* @param string &$page page to check
* @param array $whitelist whitelist to check page against
* @return boolean whether $page is valid or not (in $whitelist or not)
*/
function PMA_checkPageValidity(&$page, $whitelist)
{
if (! isset($page)) {
return false;
}
if (in_array($page, $whitelist)) {
return true;
} elseif (in_array(substr($page, 0, strpos($page . '?', '?')), $whitelist)) {
return true;
} else {
$_page = urldecode($page);
if (in_array(substr($_page, 0, strpos($_page . '?', '?')), $whitelist)) {
return true;
}
}
return false;
}
/**
* include here only libraries which contain only function definitions
* no code im main()!
@@ -2781,37 +2814,6 @@ $goto_whitelist = array(
'user_password.php',
);
/**
* boolean phpMyAdmin.PMA_checkPageValidity(string &$page, array $whitelist)
*
* checks given given $page against given $whitelist and returns true if valid
* it ignores optionaly query paramters in $page (script.php?ignored)
*
* @uses in_array()
* @uses urldecode()
* @uses substr()
* @uses strpos()
* @param string &$page page to check
* @param array $whitelist whitelist to check page against
* @return boolean whether $page is valid or not (in $whitelist or not)
*/
function PMA_checkPageValidity(&$page, $whitelist)
{
if (! isset($page)) {
return false;
}
if (in_array($page, $whitelist)) {
return true;
} else {
$page = urldecode($page);
if (in_array(substr($page, 0, strpos($page . '?', '?')), $whitelist)) {
return true;
}
}
return false;
}
/**
* check $__redirect against whitelist
*/