Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added better support for international characters.

This commit may break existing questions since the URL generation differs.
  • Loading branch information...
commit a98415bcfa566b3741af80195e735f24391d4a2a 1 parent 9c1e09c
@ZetaTwo ZetaTwo authored
View
1  app/config/database_sample.php
@@ -84,6 +84,7 @@ class DATABASE_CONFIG {
'login' => 'username',
'password' => '',
'database' => '',
+ 'encoding' => 'utf8',
);
}
View
1  app/controllers/installer_controller.php
@@ -60,6 +60,7 @@ class DATABASE_CONFIG {
'login' => '" . $this->data['Database']['login'] . "',
'password' => '" . $this->data['Database']['password'] . "',
'database' => '" . $this->data['Database']['database'] . "',
+ 'encoding' => 'utf8',
);
}
?>
View
6 app/models/post.php
@@ -51,11 +51,7 @@ class Post extends AppModel {
);
public function niceUrl($url) {
- $prohibited = array(' ', '!', "'", '"', '@', '#', '$', '%', '^', '&', '*', '?', ',', '/', '<', '>', ':', ';',
- 'é', 'è', '{', '}', ')', '(');
- $replace = array('-', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
- 'e', 'e', '', '', '', '');
- return strtolower(str_replace($prohibited, $replace, $url));
+ return preg_replace("/[^0-9a-zA-Z-]/", "", str_replace(' ', '-', $url));
}
public function monsterSearch($type, $page, $search) {
Please sign in to comment.
Something went wrong with that request. Please try again.