Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
val unescaped with dibi::unescape is unusuable, use db decoding instead
Browse files Browse the repository at this point in the history
  • Loading branch information
lucmil committed Nov 18, 2014
1 parent 18b881f commit d49c936
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions core/src/plugins/conf.sql/class.AJXP_SqlUser.php
Expand Up @@ -361,15 +361,11 @@ public function load()
$this->setHidden(true);
}

$result_prefs = dibi::query('SELECT [name], [val] FROM [ajxp_user_prefs] WHERE [login] = %s', $this->getId());
$this->prefs = $result_prefs->fetchPairs('name', 'val');
if ("postgre" == $this->storage->sqlDriver["driver"]) {
$unescaped = array();
foreach($this->prefs as $name => $val) {
$unescaped[$name] = unserialize($val);
}
$this->prefs = $unescaped;
dibi::nativeQuery('SET bytea_output = escape');
}
$result_prefs = dibi::query('SELECT [name], [val] FROM [ajxp_user_prefs] WHERE [login] = %s', $this->getId());
$this->prefs = $result_prefs->fetchPairs('name', 'val');

$result_bookmarks = dibi::query('SELECT [repo_uuid], [path], [title] FROM [ajxp_user_bookmarks] WHERE [login] = %s', $this->getId());
$all_bookmarks = $result_bookmarks->fetchAll();
Expand Down

0 comments on commit d49c936

Please sign in to comment.