- Cleaned up a bit and added some methods to give Lean/Console more flexibility
This commit is contained in:
1 parent
531f786747
commit
4bd4cddbff
7 files changed
+78
-26
No files matched your search
@@ -102,7 +102,7 @@ class UrlExtension implements Extension {
|
||||
|
||||
public static function slug(string $text, string $separator = '-') : string
|
||||
{
|
||||
return str_replace('-', $separator, \Transliterator::createFromRules(':: Any-Latin;:: NFD;:: [:Nonspacing Mark:] Remove;:: NFC;:: [:Punctuation:] Remove;:: Lower();[:Separator:] > \'-\'')->transliterate(str_replace('-', ' ', $text)));
|
||||
return trim(str_replace('-', $separator, \Transliterator::createFromRules(':: Any-Latin;:: NFD;:: [:Nonspacing Mark:] Remove;:: NFC;:: [:Punctuation:] Remove;:: Lower();[:Separator:] > \'-\'')->transliterate(str_replace('-', ' ', $text))), '-');
|
||||
}
|
||||
|
||||
public function registerRoute(string $name, string $route, string $class, string $method, array $routeMethods) : void
|
||||
@@ -179,7 +179,7 @@ class UrlExtension implements Extension {
|
||||
])) || isset($_SERVER['HTTP_X_ARR_SSL']);
|
||||
|
||||
return $https
|
||||
|| ( "443" === ( $_SERVER['SERVER_PORT'] ?? "" ) )
|
||||
|| ( "443" === ( $_SERVER['SERVER_PORT'] ?? "" ) ) || ( "443" === ( $_SERVER['HTTP_X_FORWARDED_PORT'] ?? "" ) )
|
||||
|| ( "off" !== ( strtolower($_SERVER['HTTPS'] ?? $_SERVER['HTTP_X_FORWARDED_SSL'] ?? $_SERVER['X-Forwarded-Ssl'] ?? "off")) );
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user