Skip to content

Commit a095099

Browse files
committed
Fixed Theme Credit page links
1 parent f210346 commit a095099

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

resources/views/components/theme.blade.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,15 @@
2828

2929
<div class="container-theme">
3030
<h1>Theme: {{ ucfirst(trans($info->theme)) }}</h1>
31-
<?php
32-
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
33-
34-
$text = file_get_contents('themes/' . $info->theme . '/readme.md');
35-
36-
if(preg_match($reg_exUrl, $text, $url)) {
37-
38-
$txtspc = '<pre>' . preg_replace($reg_exUrl, "<a href=" . $url[0] . ">$url[0]</a> ", $text) . '</pre>';
39-
echo preg_replace('/[ \t]+/', ' ', preg_replace('/\s\S*$^\s\S*/m', "\n", $txtspc));
4031

41-
} else {
42-
43-
echo '<pre>' . preg_replace('/[ \t]+/', ' ', preg_replace('/\s\S*$^\s\S*/m', "\n", $txtspc)) . '</pre>';
44-
45-
}
32+
<?php
33+
$str = file_get_contents('themes/' . $info->theme . '/readme.md');
34+
$url_pattern = '/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/';
35+
$str= preg_replace($url_pattern, '<a href="$0">$0</a>', $str);
36+
$txtspc = '<pre>' . $str . '</pre>';
37+
echo preg_replace('/[ \t]+/', ' ', preg_replace('/\s\S*$^\s\S*/m', "\n", $txtspc));
4638
?>
39+
4740
</div>
4841

4942
@else

0 commit comments

Comments
 (0)