Skip to content

Commit

Permalink
fixed wordpress detection
Browse files Browse the repository at this point in the history
  • Loading branch information
themodernpk committed Aug 12, 2017
1 parent 7c5236d commit ed926e8
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/CMS.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@
use \Curl\Curl;

/**
* @author webreinvent
*/
* @author webreinvent
*/
class CMS{

private $url;
private $url;

public function __construct($url)
{
$this->url = $url;
}
//---------------------------------------------------
public function __construct($url)
{
$this->url = $url;
}
//---------------------------------------------------
public function detect()
{
$scrap = $this->scrap();

if($scrap['status'] == 'failed')
{
return $scrap;
}

return $this->find_cms($scrap['data']);
return $this->find_cms($scrap['data']);
}
//---------------------------------------------------

Expand All @@ -48,7 +49,7 @@ public function scrap()
public function find_cms($html)
{
$response['data']['url'] = $this->url;
if (strpos($html, 'wp-admin') !== false)
if (strpos($html, 'wp-content/themes') !== false)
{
$response['status'] = 'success';
$response['data']['cms'] = 'wordpress';
Expand Down

0 comments on commit ed926e8

Please sign in to comment.