public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
RESTRICT hyphens as a possible separator for permalink styles. [Chris 
Wanstrath]

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2697 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Tue Jan 16 06:40:01 -0800 2007
commit  911fe1c89e7257a092f0dfc08f03093967dbe8f7
tree    8e4572162f3469be596721d6456830ef939325de
parent  15bcc24019be45774ab8a00ab884b6833516db33
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 * SVN *
0
 
0
-* Allow hyphens as an allowed separator for permalink styles. [Chris Wanstrath]
0
+* RESTRICT hyphens as a possible separator for permalink styles. [Chris Wanstrath]
0
 
0
 * Initial article/asset assignment support. Perfect for podcasting.
0
 
...
212
213
214
215
 
216
217
218
...
212
213
214
 
215
216
217
218
0
@@ -212,7 +212,7 @@ class Site < ActiveRecord::Base
0
     def check_permalink_style
0
       permalink_style.sub! /^\//, ''
0
       permalink_style.sub! /\/$/, ''
0
- pieces = permalink_style.split(Regexp.new('/|-'))
0
+ pieces = permalink_style.split('/')
0
       errors.add :permalink_style, 'cannot have blank paths' if pieces.any?(&:blank?)
0
       pieces.each do |p|
0
         errors.add :permalink_style, "cannot contain '#{p}' variable" unless p.blank? || permalink_variable_format?(p).nil? || permalink_variable?(p)
...
43
44
45
46
 
47
48
 
49
50
51
...
43
44
45
 
46
47
 
48
49
50
51
0
@@ -43,9 +43,9 @@ context "Site Permalink Validations" do
0
     assert_equal "cannot contain ':foo' variable", @site.errors.on(:permalink_style)
0
   end
0
 
0
- specify "should recongize hyphens as token separators" do
0
+ specify "should not recongize hyphens as token separators" do
0
     @site.permalink_style = ':id-:permalink'
0
- assert_valid @site
0
+ assert !@site.valid?
0
   end
0
 end
0
 

Comments

    No one has commented yet.