Change project structure

This commit is contained in:
Szmyk
2018-07-12 22:31:19 +02:00
parent 748754f505
commit cd67be63e2
3 changed files with 2 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
final class MediawikiDiscordUtils
{
public static function CreateMarkdownLink ($text, $url)
{
return "[" . $text . "]" . "(" . self::EncodeUrl($url) . ")";
}
public static function EncodeUrl($url)
{
$url = str_replace(" ", "%20", $url);
$url = str_replace("(", "%28", $url);
$url = str_replace(")", "%29", $url);
return $url;
}
public static function RemoveMultipleSlashes ($url)
{
return preg_replace('/([^:])(\/{2,})/', '$1/', $url);
}
}
?>