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 !
ignore bad requests like //foo.  fixed some deprecation warnings

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2294 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Fri Sep 29 18:39:12 -0700 2006
commit  f9b2174b2c6cf415f3f28aabaec752f21f911b2a
tree    6a4ef83903d86d758f7ce1415c98b28f4f733265
parent  1da1ea5e583cb806314d4b7438c61d4af161c07e
...
5
6
7
8
9
10
11
...
5
6
7
 
8
9
10
0
@@ -5,7 +5,6 @@ class Admin::ArticlesController < Admin::BaseController
0
     cache_sweeper :comment_sweeper, :only => [:approve, :unapprove, :destroy_comment]
0
   end
0
 
0
- observer :article_observer, :comment_observer
0
   before_filter :convert_times_to_utc, :only => [:create, :update, :upload]
0
   before_filter :check_for_new_draft, :only => [:create, :update, :upload]
0
   
...
3
4
5
6
7
8
9
...
3
4
5
 
6
7
8
0
@@ -3,7 +3,6 @@ class MephistoController < ApplicationController
0
   session :off
0
   caches_page_with_references :dispatch
0
   cache_sweeper :comment_sweeper
0
- observer :comment_observer
0
 
0
   def dispatch
0
     @dispatch_path = Mephisto::Dispatcher.run(site, params[:path].dup)
...
4
5
6
 
 
 
 
7
8
9
...
4
5
6
7
8
9
10
11
12
13
0
@@ -4,6 +4,10 @@ module Mephisto
0
     PERMALINK_VAR = /^:([a-z]+)$/
0
 
0
     def self.run(site, path)
0
+ # check for any bad urls like /foo//bar
0
+ return [:error, nil, *path] if path.any? &:blank?
0
+
0
+ # check for permalink
0
       if options = recognize_permalink(site, path)
0
         if options[1] == 'comments' && options[2]
0
           return [:comment, nil, options.first, options.last]
...
7
8
9
 
 
10
11
12
...
7
8
9
10
11
12
13
14
0
@@ -7,6 +7,8 @@ require 'xmlrpc_patch'
0
 
0
 RAILS_PATH = Pathname.new(File.expand_path(RAILS_ROOT))
0
 
0
+ActiveRecord::Base.observers = [:article_observer, :comment_observer]
0
+
0
 Inflector.inflections do |inflect|
0
   #inflect.plural /^(ox)$/i, '\1en'
0
   #inflect.singular /^(ox)en/i, '\1'
...
76
77
78
 
79
80
81
...
76
77
78
79
80
81
82
0
@@ -76,6 +76,7 @@ context "Dispatcher" do
0
     assert_dispatch :error, sections(:home), '2006', '9', '123', 'foo', %w(2006 9 123 foo)
0
     assert_dispatch :error, sections(:home), '2006', '9', '1', 'foo', 'boo', %w(2006 9 1 foo boo)
0
     assert_dispatch :error, sections(:home), '2006', '9', '1', 'foo', 'comment', %w(2006 9 1 foo comment)
0
+ assert_dispatch :error, nil, '', 'foo', ['', 'foo']
0
   end
0
 
0
   protected

Comments

    No one has commented yet.