mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-09 18:08:49 +00:00
[multiple] Rename dbesc to DBA::escape
This commit is contained in:
parent
d9ec1ef80d
commit
522e8e58c2
14 changed files with 109 additions and 96 deletions
|
@ -37,7 +37,7 @@ function like_widget_content(&$a, $conf){
|
|||
// count likes
|
||||
$r = q( $baseq . "AND `item`.`verb` = 'http://activitystrea.ms/schema/1.0/like'",
|
||||
intval($conf['uid']),
|
||||
dbesc($args[0])
|
||||
DBA::escape($args[0])
|
||||
);
|
||||
$likes = $r[0]['c'];
|
||||
$iid = $r[0]['id'];
|
||||
|
@ -45,7 +45,7 @@ function like_widget_content(&$a, $conf){
|
|||
// count dislikes
|
||||
$r = q( $baseq . "AND `item`.`verb` = 'http://purl.org/macgirvin/dfrn/1.0/dislike'",
|
||||
intval($conf['uid']),
|
||||
dbesc($args[0])
|
||||
DBA::escape($args[0])
|
||||
);
|
||||
$dislikes = $r[0]['c'];
|
||||
|
||||
|
|
|
@ -5,21 +5,23 @@
|
|||
* Version: 1.0
|
||||
* Author: Fabio Comuni <http://kirgroup.com/profile/fabrix/>
|
||||
*/
|
||||
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Database\DBA;
|
||||
|
||||
function widgets_install() {
|
||||
Addon::registerHook('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings');
|
||||
Addon::registerHook('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
|
||||
logger("installed widgets");
|
||||
}
|
||||
|
||||
function widgets_uninstall() {
|
||||
Addon::unregisterHook('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings');
|
||||
Addon::unregisterHook('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
|
||||
}
|
||||
|
||||
|
||||
function widgets_settings_post(){
|
||||
if(! local_user())
|
||||
return;
|
||||
|
@ -89,7 +91,7 @@ function widgets_content(&$a) {
|
|||
}
|
||||
|
||||
$r = q("SELECT * FROM pconfig WHERE uid IN (SELECT uid FROM pconfig WHERE v='%s')AND cat='widgets'",
|
||||
dbesc($_GET['k'])
|
||||
DBA::escape($_GET['k'])
|
||||
);
|
||||
if (!count($r)){
|
||||
if($a->argv[2]=="cb"){header('HTTP/1.0 400 Bad Request'); killme();}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue