2626 */
2727function url_with_lang (string $ lang ): string
2828{
29- if (!in_array ($ lang , (array )config ()->get ('lang.supported ' ))) {
29+ if (!in_array ($ lang , (array ) config ()->get ('lang.supported ' ))) {
3030 $ lang = config ()->get ('lang.default ' );
3131 }
3232
@@ -35,7 +35,7 @@ function url_with_lang(string $lang): string
3535 }
3636
3737 if (preg_match ('/ ' . preg_quote (current_lang ()) . '/ ' , route_uri ())) {
38- return base_url () . preg_replace ('/ ' . preg_quote (current_lang (), '/ ' ) . " / " , $ lang , route_uri (), 1 );
38+ return base_url () . preg_replace ('/ ' . preg_quote (current_lang (), '/ ' ) . ' / ' , $ lang , route_uri (), 1 );
3939 }
4040
4141 $ url = base_url (true );
@@ -47,7 +47,7 @@ function url_with_lang(string $lang): string
4747 if (!empty (route_prefix ()) && $ langSegmentIndex == 1 ) {
4848 $ langSegmentIndex += 1 ;
4949
50- $ uri = preg_replace ('/ ' . preg_quote (route_prefix (), '/ ' ) . " / " , '' , route_uri (), 1 );
50+ $ uri = preg_replace ('/ ' . preg_quote (route_prefix (), '/ ' ) . ' / ' , '' , route_uri (), 1 );
5151 }
5252
5353 $ segments = explode ('/ ' , $ uri );
@@ -103,7 +103,7 @@ function create_user_directory(string $uuid)
103103{
104104 $ userDirectory = uploads_dir () . DS . $ uuid ;
105105
106- if (!fs ()->isDirectory ($ userDirectory )) {
106+ if (!fs ()->isDirectory ($ userDirectory )) {
107107 fs ()->makeDirectory ($ userDirectory );
108108 }
109109}
@@ -143,4 +143,4 @@ function nav_ref_decode(?string $ref): string
143143 $ decoded = $ ref ? base64_decode (strtr ($ ref , '-_ ' , '+/ ' ), true ) : false ;
144144
145145 return '/posts ' . ($ decoded ? '? ' . $ decoded : '' );
146- }
146+ }
0 commit comments