debugging the plugin logic, couple of issues found
This commit is contained in:
parent
cd073f94f8
commit
a1a838f69e
1 changed files with 11 additions and 2 deletions
13
boot.php
13
boot.php
|
@ -1199,11 +1199,12 @@ function set_pconfig($uid,$family,$key,$value) {
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
$ret = q("UPDATE `pconfig` SET `v` = '%s' WHERE `uid` = %d AND `cat` = '%s' AND `k` = '%s' LIMIT 1",
|
$ret = q("UPDATE `pconfig` SET `v` = '%s' WHERE `uid` = %d AND `cat` = '%s' AND `k` = '%s' LIMIT 1",
|
||||||
intval($uid),
|
|
||||||
dbesc($value),
|
dbesc($value),
|
||||||
|
intval($uid),
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
dbesc($key)
|
dbesc($key)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($ret)
|
if($ret)
|
||||||
return $value;
|
return $value;
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -2046,6 +2047,14 @@ function profile_sidebar($profile) {
|
||||||
if(! function_exists('register_hook')) {
|
if(! function_exists('register_hook')) {
|
||||||
function register_hook($hook,$file,$function) {
|
function register_hook($hook,$file,$function) {
|
||||||
|
|
||||||
|
$r = q("SELECT FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' LIMIT 1",
|
||||||
|
dbesc($hook),
|
||||||
|
dbesc($file),
|
||||||
|
dbesc($function)
|
||||||
|
);
|
||||||
|
if(count($r))
|
||||||
|
return true;
|
||||||
|
|
||||||
$r = q("INSERT INTO `hook` (`hook`, `file`, `function`) VALUES ( '%s', '%s', '%s' ) ",
|
$r = q("INSERT INTO `hook` (`hook`, `file`, `function`) VALUES ( '%s', '%s', '%s' ) ",
|
||||||
dbesc($hook),
|
dbesc($hook),
|
||||||
dbesc($file),
|
dbesc($file),
|
||||||
|
@ -2079,7 +2088,7 @@ function load_hooks() {
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('call_hooks')) {
|
if(! function_exists('call_hooks')) {
|
||||||
function call_hooks($name, $data = null) {
|
function call_hooks($name, &$data = null) {
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
if(count($a->hooks)) {
|
if(count($a->hooks)) {
|
||||||
|
|
Loading…
Reference in a new issue