<commit_before><?php
App::import(array('Security', 'Validation'));

/**
 * CakePHP Gravatar Helper
 *
 * A CakePHP View Helper for the display of Gravatar images (http://www.gravatar.com)
 *
 * @copyright Copyright 2009-2010, <NAME> (http://grahamweldon.com)
 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package goodies
 * @subpackage goodies.views.helpers
 */
class GravatarHelper extends AppHelper {

/**
 * Gravatar avatar image base URL
 *
 * @var string
 */
	private $__url = array(
		'http' => 'http://www.gravatar.com/avatar/',
		'https' => 'https://secure.gravatar.com/avatar/'
	);

/**
 * Hash type to use for email addresses
 *
 * @var string
 */
	private $__hashType = 'md5';

/**
 * Collection of allowed ratings
 *
 * @var array
 */
	private $__allowedRatings = array('g', 'pg', 'r', 'x');

/**
 * Default Icon sets
 *
 * @var array
 */
	private $__defaultIcons = array('none', 'identicon', 'mm', 'monsterid', 'retro', 'wavatar', '404');

/**
 * Default settings
 *
 * @var array
 */
	private $__default = array(
		'default' => null,
		'size' => null,
		'rating' => null,
		'ext' => false);

/**
 * Helpers used by this helper
 *
 * @var array
 */
	public $helpers = array('Html');

/**
 * Constructor
 *
 */
	public function __construct($settings = array()) {
		if (!is_array($settings)) {
			$settings = array();
		}
		$this->__default = array_merge($this->__default, array_intersect_key($settings, $this->__default));

		// Default the secure option to match the current URL.
		$this->__default['secure'] = env('HTTPS');
	}

/**
 * Show gravatar for the supplied email addresses
 *
 * @param string $email Email address
 * @param array $options Array of options, keyed from default settings
 * @return string Gravatar image string
 */
	public function image($email, $options = array()) {
		$imageUrl = $this->url($email, $options);
		unset($options['default'], $options['size'], $options['rating'], $options['ext']);
		return $this->Html->image($imageUrl, $options);
	}<commit_msg>refs #24 - fix helper constructor<commit_after><?php
App::import(array('Security', 'Validation'));

/**
 * CakePHP Gravatar Helper
 *
 * A CakePHP View Helper for the display of Gravatar images (http://www.gravatar.com)
 *
 * @copyright Copyright 2009-2010, <NAME> (http://grahamweldon.com)
 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package goodies
 * @subpackage goodies.views.helpers
 */
class GravatarHelper extends AppHelper {

/**
 * Gravatar avatar image base URL
 *
 * @var string
 */
	private $__url = array(
		'http' => 'http://www.gravatar.com/avatar/',
		'https' => 'https://secure.gravatar.com/avatar/'
	);

/**
 * Hash type to use for email addresses
 *
 * @var string
 */
	private $__hashType = 'md5';

/**
 * Collection of allowed ratings
 *
 * @var array
 */
	private $__allowedRatings = array('g', 'pg', 'r', 'x');

/**
 * Default Icon sets
 *
 * @var array
 */
	private $__defaultIcons = array('none', 'identicon', 'mm', 'monsterid', 'retro', 'wavatar', '404');

/**
 * Default settings
 *
 * @var array
 */
	private $__default = array(
		'default' => null,
		'size' => null,
		'rating' => null,
		'ext' => false);

/**
 * Helpers used by this helper
 *
 * @var array
 */
	public $helpers = array('Html');

/**
 * Constructor
 *
 */
	public function __construct($View = null, $settings = array()) {
		if (!is_array($settings)) {
			$settings = array();
		}
		$this->__default = array_merge($this->__default, array_intersect_key($settings, $this->__default));

		// Default the secure option to match the current URL.
		$this->__default['secure'] = env('HTTPS');

		$this->View = $View;
		return parent::__construct($this->View, $settings);
	} 	
	

/**
 * Show gravatar for the supplied email addresses
 *
 * @param string $email Email address
 * @param array $options Array of options, keyed from default settings
 * @return string Gravatar image string
 */
	public function image($email, $options = array()) {
		$imageUrl = $this->url($email, $options);
		unset($options['default'], $options['size'], $options['rating'], $options['ext']);
		return $this->Html->image($imageUrl, $options);
	}
{'fraction_non_alphanumeric': 0.17797419971333014, 'fraction_numerical': 0.006211180124223602, 'mean_word_length': 3.9785969084423307, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 33, 'https://': 2, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5490092', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1348, 'n_words': 367}