diff --git a/htdocs/cmd.php b/htdocs/cmd.php
index 0ddf004..8a9d089 100644
--- a/htdocs/cmd.php
+++ b/htdocs/cmd.php
@@ -41,7 +41,7 @@ if (DEBUG_ENABLED)
$www['page'] = new page($app['server']->getIndex());
# See if we can render the command
-if (trim($www['cmd'])) {
+if ($www['cmd'] && trim($www['cmd'])) {
# If this is a READ-WRITE operation, the LDAP server must not be in READ-ONLY mode.
if ($app['server']->isReadOnly() && ! in_array(get_request('cmd','REQUEST'),$app['readwrite_cmds']))
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
diff --git a/htdocs/export_form.php b/htdocs/export_form.php
index d0a82b0..64d856f 100755
--- a/htdocs/export_form.php
+++ b/htdocs/export_form.php
@@ -13,7 +13,7 @@ require './common.php';
require LIBDIR.'export_functions.php';
$request = array();
-$request['dn'] = get_request('dn','GET');
+$request['dn'] = get_request('dn','GET',false,'');
$request['format'] = get_request('format','GET',false,get_line_end_format());
$request['scope'] = get_request('scope','GET',false,'base');
$request['exporter_id'] = get_request('exporter_id','GET',false,'LDIF');
diff --git a/htdocs/login.php b/htdocs/login.php
index 06b7fa1..988dbcf 100644
--- a/htdocs/login.php
+++ b/htdocs/login.php
@@ -19,8 +19,7 @@ if ($_SESSION[APPCONFIG]->getValue('session', 'reCAPTCHA-enable')) {
if ($pass) {
$user = array();
$user['login'] = get_request('login');
- $user['password'] = get_request('login_pass');
- $user['password'] = html_entity_decode($user['password'], ENT_QUOTES);
+ $user['password'] = get_request('login_pass', 'POST', false, '');
if ($user['login'] && !strlen($user['password'])) {
system_message(array(
diff --git a/htdocs/password_checker.php b/htdocs/password_checker.php
index c616e2e..ce0cf0d 100644
--- a/htdocs/password_checker.php
+++ b/htdocs/password_checker.php
@@ -15,8 +15,8 @@ $www['page'] = new page();
$request = array();
$request['componentid'] = get_request('componentid','REQUEST');
-$request['hash'] = get_request('hash','REQUEST');
-$request['password'] = get_request('check_password','REQUEST');
+$request['hash'] = get_request('hash','REQUEST',false,'');
+$request['password'] = get_request('check_password','REQUEST',false,'');
$request['action'] = get_request('action','REQUEST');
$request['attribute'] = get_request('attr','REQUEST');
diff --git a/htdocs/schema.php b/htdocs/schema.php
index aa4a749..e4ef14e 100644
--- a/htdocs/schema.php
+++ b/htdocs/schema.php
@@ -150,7 +150,7 @@ switch($entry['view']) {
foreach ($sattrs as $attr) {
if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$attr->getName())) {
- if ((! is_null($entry['value']) && $entry['value']==$attr->getName()) || ! trim($entry['value']))
+ if (!is_string($entry['value']) || $entry['value']==$attr->getName() || !trim($entry['value']))
$entry['viewed'] = true;
if (isAjaxEnabled() && $entry['value'])
@@ -380,7 +380,7 @@ switch($entry['view']) {
$desc = $rule->getName(false);
if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$rule->getName())) {
- if ((! is_null($entry['value']) && $entry['value']==$rule->getName()) || ! trim($entry['value']))
+ if (!is_string($entry['value']) || $entry['value']==$rule->getName() || !trim($entry['value']))
$entry['viewed'] = true;
if (null != $rule->getDescription())
@@ -468,7 +468,7 @@ switch($entry['view']) {
foreach ($socs as $name => $oclass) {
if (isAjaxEnabled() || (is_null($entry['value']) || ! trim($entry['value']) || $entry['value']==$oclass->getName())) {
- if ((! is_null($entry['value']) && $entry['value']==$oclass->getName()) || ! trim($entry['value']))
+ if (!is_string($entry['value']) || $entry['value']==$oclass->getName() || !trim($entry['value']))
$entry['viewed'] = true;
if (isAjaxEnabled() && $entry['value'])
diff --git a/lib/PLAAttribute.php b/lib/PLAAttribute.php
index 313b42a..a2f0091 100644
--- a/lib/PLAAttribute.php
+++ b/lib/PLAAttribute.php
@@ -258,14 +258,14 @@ class PLAAttribute {
}
}
- public function getValue($i) {
+ public function getValue($i, $default=null) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (isset($this->values[$i]))
return $this->values[$i];
else
- return null;
+ return $default;
}
public function getOldValue($i) {
diff --git a/lib/PageRender.php b/lib/PageRender.php
index 42626c6..2527b12 100644
--- a/lib/PageRender.php
+++ b/lib/PageRender.php
@@ -538,7 +538,7 @@ class PageRender extends Visitor {
final protected function drawHiddenValueAttribute($attribute,$i) {
if (DEBUGTMP) printf('%s
',__METHOD__);
- $val = $attribute->getValue($i);
+ $val = $attribute->getValue($i, '');
printf('',
htmlspecialchars($attribute->getName()),$i,htmlspecialchars($attribute->getName()),$i,
@@ -607,7 +607,7 @@ class PageRender extends Visitor {
protected function drawFormReadOnlyValueAttribute($attribute,$i) {
if (DEBUGTMP) printf('%s
',__METHOD__);
- $val = $attribute->getValue($i);
+ $val = $attribute->getValue($i, '');
printf('',
htmlspecialchars($attribute->getName()),$i,htmlspecialchars($attribute->getName()),$i,htmlspecialchars($val));
@@ -616,7 +616,7 @@ class PageRender extends Visitor {
protected function drawFormReadWriteValueAttribute($attribute,$i) {
if (DEBUGTMP) printf('%s
',__METHOD__);
- $val = $attribute->getValue($i);
+ $val = $attribute->getValue($i, '');
if ($attribute->getHelper() || $attribute->getVerify())
echo '
';
@@ -720,7 +720,7 @@ class PageRender extends Visitor {
protected function drawFormReadWriteValueDateAttribute($attribute,$i) {
if (DEBUGTMP) printf('%s ',__METHOD__); - $val = $attribute->getValue($i); + $val = $attribute->getValue($i, ''); echo ''; printf(' ', @@ -738,7 +738,7 @@ class PageRender extends Visitor { protected function drawFormReadWriteValueDnAttribute($attribute,$i) { if (DEBUGTMP) printf('%s ',__METHOD__); - $val = $attribute->getValue($i); + $val = $attribute->getValue($i, ''); if ($attribute->getHelper()) echo '
|