@anonymous-matomo-user opened this Issue on November 5th 2012

One error in RegExp on 'public function getAge()' return incorrect date creation:

Original function:
public function getAge()
{
$url = preg_replace('/^www./', '', $this->url);
$url = 'http://www.who.is/whois/'.urlencode($url);
$data = $this->getPage($url);
preg_match('#(?:Creation Date|Created On):\s*([ \ta-z0-9/-]+)#si', $data, $p);
if(!isset($p[1]))
{
return null;
}
$value = strtotime($p[1]);
if ($value === false) {
return null;
}
$value = Piwik::getPrettyTimeFromSeconds(time() - $value);
return $value;
}

Modified function:
public function getAge()
{
$url = preg_replace('/^www./', '', $this->url);
$url = 'http://www.who.is/whois/'.urlencode($url);
$data = $this->getPage($url);
---> preg_match('#(?:Creation Date|Created On):\s*([ \ta-z0-9/-:]+)#si', $data, $p);
if(!isset($p[1]))
{
return null;
}
$value = strtotime($p[1]);
if ($value === false) {
return null;
}
$value = Piwik::getPrettyTimeFromSeconds(time() - $value);
return $value;
}
Keywords: date creation

@anonymous-matomo-user commented on November 5th 2012

On file: ./plugins/SEO/RankChecker.php

@robocoder commented on November 5th 2012 Contributor

Yeah, adding . and : will handle some more esoteric formats.

@mattab commented on November 9th 2012 Member

(In [7410]) Fixes #3516 Thanks for the patch

This Issue was closed on November 9th 2012
Powered by GitHub Issue Mirror