Skip to content

Commit 07c9d3c

Browse files
committed
Build Your First Application used url_title incorrectly
1 parent 098b7fe commit 07c9d3c

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

system/Helpers/url_helper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,6 @@ function url_title(string $str, string $separator = '-', bool $lowercase = false
601601
$str = strip_tags($str);
602602
foreach ($trans as $key => $val)
603603
{
604-
// $str = preg_replace('#'.$key.'#i'.( UTF8_ENABLED ? 'u' : ''), $val, $str);
605604
$str = preg_replace('#' . $key . '#iu', $val, $str);
606605
}
607606

user_guide_src/source/tutorial/create_news_items.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ validation <../libraries/validation>` library to do this.
6161
{
6262
$model->save([
6363
'title' => $this->request->getVar('title'),
64-
'slug' => url_title($this->request->getVar('title')),
64+
'slug' => url_title($this->request->getVar('title'), '-', TRUE),
6565
'body' => $this->request->getVar('body'),
6666
]);
6767

0 commit comments

Comments
 (0)