@@ -66,7 +66,7 @@ |
||
66 | 66 | // Register template helpers |
67 | 67 | $builder->addDefinition($this->prefix('helpers')) |
68 | 68 | ->setClass(Templating\Helpers::CLASS_NAME) |
69 | - ->setFactory($this->prefix('@gravatar') . '::createTemplateHelpers') |
|
69 | + ->setFactory($this->prefix('@gravatar').'::createTemplateHelpers') |
|
70 | 70 | ->setInject(FALSE); |
71 | 71 | } |
72 | 72 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | return NULL; |
69 | 69 | } |
70 | 70 | |
71 | - fputs($sock, "HEAD " . $path . " HTTP/1.0\r\n\r\n"); |
|
71 | + fputs($sock, "HEAD ".$path." HTTP/1.0\r\n\r\n"); |
|
72 | 72 | $header = fgets($sock, 128); |
73 | 73 | fclose($sock); |
74 | 74 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $emailHash = hash('md5', strtolower(trim($email))); |
135 | 135 | |
136 | 136 | // Start building the URL, and deciding if we're doing this via HTTPS or HTTP. |
137 | - $url = new Http\Url(Gravatar\Gravatar::HTTPS_URL . $emailHash); |
|
137 | + $url = new Http\Url(Gravatar\Gravatar::HTTPS_URL.$emailHash); |
|
138 | 138 | |
139 | 139 | // Time to figure out our request params |
140 | 140 | $params = []; |
@@ -338,12 +338,12 @@ discard block |
||
338 | 338 | } |
339 | 339 | |
340 | 340 | // Check if avatar is in cache |
341 | - if (!$gravatar = $this->cache->load($this->getEmailHash($email) . ($size ? '.' . $size : ''))) { |
|
341 | + if (!$gravatar = $this->cache->load($this->getEmailHash($email).($size ? '.'.$size : ''))) { |
|
342 | 342 | // Get gravatar content |
343 | 343 | $gravatar = @file_get_contents($this->buildUrl($email, $size)); |
344 | 344 | |
345 | 345 | // Store facebook avatar url into cache |
346 | - $this->cache->save($this->getEmailHash($email) . ($size ? '.' . $size : ''), $gravatar, [ |
|
346 | + $this->cache->save($this->getEmailHash($email).($size ? '.'.$size : ''), $gravatar, [ |
|
347 | 347 | Caching\Cache::EXPIRE => '7 days', |
348 | 348 | ]); |
349 | 349 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | return NULL; |
397 | 397 | } |
398 | 398 | |
399 | - fputs($sock, "HEAD " . $path . " HTTP/1.0\r\n\r\n"); |
|
399 | + fputs($sock, "HEAD ".$path." HTTP/1.0\r\n\r\n"); |
|
400 | 400 | $header = fgets($sock, 128); |
401 | 401 | fclose($sock); |
402 | 402 | |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | $emailHash = $this->getEmailHash($email); |
426 | 426 | |
427 | 427 | // Start building the URL, and deciding if we're doing this via HTTPS or HTTP. |
428 | - $url = new Nette\Http\Url(($this->useSecureUrl ? static::HTTPS_URL : static::HTTP_URL) . $emailHash); |
|
428 | + $url = new Nette\Http\Url(($this->useSecureUrl ? static::HTTPS_URL : static::HTTP_URL).$emailHash); |
|
429 | 429 | |
430 | 430 | if (!$size || !$this->isSizeValid($size)) { |
431 | 431 | $size = NULL; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | throw new Latte\CompileException('Please provide email address.'); |
72 | 72 | } |
73 | 73 | |
74 | - return $writer->write('echo property_exists($this, "filters") ? %escape(call_user_func($this->filters->gravatar, ' . $arguments['email'] . ', ' . $arguments['size'] . ')) : $template->getGravatarService()->buildUrl(' . $arguments['email'] . ', ' . $arguments['size'] . ');'); |
|
74 | + return $writer->write('echo property_exists($this, "filters") ? %escape(call_user_func($this->filters->gravatar, '.$arguments['email'].', '.$arguments['size'].')) : $template->getGravatarService()->buildUrl('.$arguments['email'].', '.$arguments['size'].');'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | throw new Latte\CompileException('Please provide email address.'); |
92 | 92 | } |
93 | 93 | |
94 | - return $writer->write('?> ' . ($node->htmlNode->name === 'a' ? 'href' : 'src') . '="<?php echo property_exists($this, "filters") ? %escape(call_user_func($this->filters->gravatar, ' . $arguments['email'] . ', ' . $arguments['size'] . ')) : $template->getGravatarService()->buildUrl(' . $arguments['email'] . ', ' . $arguments['size'] . ');?>" <?php'); |
|
94 | + return $writer->write('?> '.($node->htmlNode->name === 'a' ? 'href' : 'src').'="<?php echo property_exists($this, "filters") ? %escape(call_user_func($this->filters->gravatar, '.$arguments['email'].', '.$arguments['size'].')) : $template->getGravatarService()->buildUrl('.$arguments['email'].', '.$arguments['size'].');?>" <?php'); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 |