Skip to content

Commit

Permalink
Merge pull request #426 from statikbe/421
Browse files Browse the repository at this point in the history
[BUG]: anchor field does not work with question mark
  • Loading branch information
HannahDeWachter authored Feb 12, 2025
2 parents 45fe0e4 + 1bb57c3 commit a40f3eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
// ajax to php function
$.ajax({
url: "/actions/statik/slugify/create-slug-from-string",
data: {string: string},
data: {string: encodeURIComponent(string)},
async: false,
}).done(function (response) {
$slugified = response;
Expand Down
2 changes: 1 addition & 1 deletion modules/statik/src/controllers/SlugifyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SlugifyController extends Controller

public function actionCreateSlugFromString(): string
{
$string = Craft::$app->request->getParam('string');
$string = urldecode(Craft::$app->request->getParam('string'));
return ElementHelper::generateSlug($string);
}
}

0 comments on commit a40f3eb

Please sign in to comment.