Skip to content

Commit

Permalink
Replace single and double quotes with empty string.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Oct 5, 2015
1 parent 01ac4fb commit 64945c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Model/Behavior/SlugBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class SlugBehavior extends Behavior
'?' => 'question',
'+' => 'and',
'&' => 'and',
'"' => '',
"'" => ''
],
'maxLength' => null,
'slugger' => 'Muffin\Slug\Slugger\CakeSlugger',
Expand Down
4 changes: 4 additions & 0 deletions tests/TestCase/Model/Behavior/SlugBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ public function testSlug()
$result = $this->Behavior->slug('foo/bar', '_');
$expected = 'foo_bar';
$this->assertEquals($expected, $result);

$result = $this->Behavior->slug('admad\'s "double quote "');
$expected = 'admads-double-quote';
$this->assertEquals($expected, $result);
}

public function testBeforeSaveMultiField()
Expand Down

0 comments on commit 64945c0

Please sign in to comment.