Skip to content

Commit 580f154

Browse files
authored
Use url helpers (#4)
1 parent 576ff44 commit 580f154

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"illuminate/database": "^9.0",
2222
"illuminate/support": "^9.0",
2323
"illuminate/view": "^9.0",
24-
"rapidez/core": "~0.55"
24+
"rapidez/core": "~0.55|^1.0"
2525
},
2626
"autoload": {
2727
"psr-4": {

src/Models/Autolink.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public static function replace(string $text): string
2020
$limit = Rapidez::config('seoautolink/autolink/links_limit_per_page', false);
2121
$counter = 0;
2222
self::all()->each(function ($autolink) use (&$text, &$counter, $limit) {
23-
$link = " <a href=\"$autolink->url\" target=\"$autolink->url_target\" title=\"$autolink->url_title\">$autolink->keyword</a> ";
23+
$url = url($autolink->url);
24+
$link = " <a href=\"$url\" target=\"$autolink->url_target\" title=\"$autolink->url_title\">$autolink->keyword</a> ";
2425
$text = preg_replace('/ '.$autolink->keyword.' (?!([^<]+)?>)/i', $link, $text, -1, $count);
2526
$counter += $count;
2627
if ($limit && $counter > $limit) {

0 commit comments

Comments
 (0)