Revision: 10032
http://sourceforge.net/p/phpwiki/code/10032
Author: vargenau
Date: 2017-08-10 15:47:27 +0000 (Thu, 10 Aug 2017)
Log Message:
-----------
Align PDO code with Pear
Modified Paths:
--------------
trunk/lib/WikiUser/PdoDb.php
Modified: trunk/lib/WikiUser/PdoDb.php
===================================================================
--- trunk/lib/WikiUser/PdoDb.php 2017-08-10 15:46:30 UTC (rev 10031)
+++ trunk/lib/WikiUser/PdoDb.php 2017-08-10 15:47:27 UTC (rev 10032)
@@ -45,11 +45,13 @@
global $request;
if (!$this->_prefs and is_a($this, "_PdoDbPassUser")) {
- if ($prefs) $this->_prefs = $prefs;
+ if ($prefs) {
+ $this->_prefs = $prefs;
+ }
}
- if (!isset($this->_prefs->_method))
+ if (!isset($this->_prefs->_method)) {
_PassUser::__construct($UserName);
- elseif (!$this->isValidName($UserName)) {
+ } elseif (!$this->isValidName($UserName)) {
trigger_error(_("Invalid username."), E_USER_WARNING);
return false;
}
@@ -67,7 +69,7 @@
_AnonUser::getPreferences();
$this->getAuthDbh();
if (isset($this->_prefs->_select)) {
- $dbh =& $this->_auth_dbi;
+ $dbh = &$this->_auth_dbi;
$db_result = $dbh->query(sprintf($this->_prefs->_select, $dbh->quote($this->_userid)));
// patched by fre...@pa...
$prefs = $db_result->fetch(PDO::FETCH_BOTH);
@@ -77,7 +79,7 @@
return $this->_prefs;
}
}
- if ($this->_HomePagehandle) {
+ if (isset($this->_HomePagehandle) && $this->_HomePagehandle) {
if ($restored_from_page = $this->_prefs->retrieve
($this->_HomePagehandle->get('pref'))
) {
@@ -106,11 +108,11 @@
return false;
}
//delete pageprefs:
- if ($this->_HomePagehandle and $this->_HomePagehandle->get('pref'))
+ if (isset($this->_HomePagehandle) && $this->_HomePagehandle and $this->_HomePagehandle->get('pref'))
$this->_HomePagehandle->set('pref', '');
} else {
//store prefs in homepage, not in cookie
- if ($this->_HomePagehandle and !$id_only)
+ if (isset($this->_HomePagehandle) && $this->_HomePagehandle and !$id_only)
$this->_HomePagehandle->set('pref', $packed);
}
return $count;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|