Fix
This commit is contained in:
parent
91e25ad3c0
commit
ae66154be2
2 changed files with 10 additions and 8 deletions
|
@ -21,15 +21,17 @@ class discord
|
||||||
return $this->json->content;
|
return $this->json->content;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($this->json->embeds->title))
|
$this->readable .= PHP_EOL;
|
||||||
|
|
||||||
|
if(!empty($this->json->embeds[0]->title))
|
||||||
{
|
{
|
||||||
$this->readable .= $this->json->embeds->title . PHP_EOL;
|
$this->readable .= $this->json->embeds[0]->title . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($this->json->embeds->description))
|
if(!empty($this->json->embeds[0]->description))
|
||||||
{
|
{
|
||||||
$this->readable .= preg_replace("/(?:__|[*#])|\[(.*?)\]\(.*?\)/"," ",$this->json->embeds->description) . PHP_EOL;
|
$this->readable .= preg_replace("/(?:__|[*#])|\[(.*?)\]\(.*?\)/"," ",$this->json->embeds[0]->description) . PHP_EOL;
|
||||||
$this->readable .= $this->json->embeds->url;
|
$this->readable .= $this->json->embeds[0]->url;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->readable;
|
return $this->readable;
|
||||||
|
|
|
@ -89,13 +89,13 @@ class app
|
||||||
|
|
||||||
private function checkIfCompatibilityClassNeeded()
|
private function checkIfCompatibilityClassNeeded()
|
||||||
{
|
{
|
||||||
|
$comp = $_GET["comp"] ?? "";
|
||||||
if(array_key_exists("HTTP_X_GITEA_DELIVERY",$_SERVER))
|
if(array_key_exists("HTTP_X_GITEA_DELIVERY",$_SERVER) || $comp === "gitea")
|
||||||
{
|
{
|
||||||
return 'gitea';
|
return 'gitea';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_SERVER['User-Agent']) && $_SERVER['User-Agent'] === "Grafana")
|
if(isset($_SERVER['User-Agent']) && $_SERVER['User-Agent'] === "Grafana" || $comp === "Grafana")
|
||||||
{
|
{
|
||||||
return 'grafana';
|
return 'grafana';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue