mirror of
https://github.com/shadoll/sLetter.git
synced 2025-12-20 03:27:00 +00:00
flag fix
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* @author sHa <sha@shadoll.com>
|
* @author sHa <sha@shadoll.com>
|
||||||
* @package sLetter
|
* @package sLetter
|
||||||
* @version 18.2.13-12
|
* @version 18.2.13-13
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ class sLetter{
|
|||||||
return $return?$this->lang:$this;
|
return $return?$this->lang:$this;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setData($data,$return=false){
|
function setData($data,$raw=false,$return=false){
|
||||||
if(empty($data) || !is_array($data))
|
if(empty($data) || !is_array($data))
|
||||||
return $return?$this->fields:$this;
|
return $return?$this->fields:$this;
|
||||||
|
|
||||||
@@ -54,7 +54,10 @@ class sLetter{
|
|||||||
|
|
||||||
foreach($data as $key=>$val)
|
foreach($data as $key=>$val)
|
||||||
if(!empty($val))
|
if(!empty($val))
|
||||||
$this->fields[$key] = is_string($val)?trim(stripslashes(strip_tags($val))):$val;
|
if(!$raw)
|
||||||
|
$this->fields[$key] = is_string($val)?trim(stripslashes(strip_tags($val))):$val;
|
||||||
|
else
|
||||||
|
$this->fields[$key] = is_string($val)?trim($val):$val;
|
||||||
|
|
||||||
return $return?$this->fields:$this;
|
return $return?$this->fields:$this;
|
||||||
}
|
}
|
||||||
@@ -128,8 +131,6 @@ class sLetter{
|
|||||||
if(!empty($this->senderIP)){
|
if(!empty($this->senderIP)){
|
||||||
$query = @unserialize(file_get_contents('http://ip-api.com/php/'.$this->senderIP));
|
$query = @unserialize(file_get_contents('http://ip-api.com/php/'.$this->senderIP));
|
||||||
if($query && $query['status'] == 'success'){
|
if($query && $query['status'] == 'success'){
|
||||||
|
|
||||||
|
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'senderIP' => $this->senderIP,
|
'senderIP' => $this->senderIP,
|
||||||
'flag' => "<img style='height:14px; width:auto' src='http://www.geognos.com/api/en/countries/flag/".$query['countryCode'].".png'>",
|
'flag' => "<img style='height:14px; width:auto' src='http://www.geognos.com/api/en/countries/flag/".$query['countryCode'].".png'>",
|
||||||
@@ -137,7 +138,7 @@ class sLetter{
|
|||||||
'region' => $query['regionName'],
|
'region' => $query['regionName'],
|
||||||
'city' => $query['city'],
|
'city' => $query['city'],
|
||||||
'provider' => $query['isp'],
|
'provider' => $query['isp'],
|
||||||
]);
|
],true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $return?$this->fields:$this;
|
return $return?$this->fields:$this;
|
||||||
|
|||||||
Reference in New Issue
Block a user