Closed (fixed)
Project:
Google Plus One Button | Google+ Badge
Version:
6.x-1.0-rc4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2011 at 16:07 UTC
Updated:
21 Jul 2011 at 13:41 UTC
The google_plusone_link function does not check the google_plusone_node_types variable, nor does it check user_access('view google plusone'). Suggest...
function google_plusone_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
$view_mode = $teaser ? 'teaser' : 'full';
$locations = variable_get('google_plusone_node_location', array('full'));
if (in_array('link', $locations, TRUE)
&& $type === 'node'
&& in_array($node->type, variable_get('google_plusone_node_types', array()), TRUE)
&& user_access('view google plusone')) {
$default = array(
'count' => '', // true
'size' => '', // standard
'css' => 'margin: 0 1em 1em 1em;float:right;',
'syntax' => 'g:plusone',
);
$button_settings = variable_get('google_plusone_button_settings', $default) + array('node' => $node);
$links['google_plusone'] = array(
'title' => theme('google_plusone_button', $button_settings),
'html' => TRUE,
);
} // end if
return $links;
}
Comments
Comment #1
corbacho commentedTotally right, and your suggestion is the right fix.. committed and ready to download (rc5 version)
Thanks Joe!
Comment #2
corbacho commentedmarking as fixed