Fix valid related content url helper method
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
class RelatedContentsController < ApplicationController
|
class RelatedContentsController < ApplicationController
|
||||||
VALID_URL = /#{Setting['url']}\/.*\/.*/
|
|
||||||
|
|
||||||
skip_authorization_check
|
skip_authorization_check
|
||||||
|
|
||||||
respond_to :html, :js
|
respond_to :html, :js
|
||||||
@@ -35,7 +33,7 @@ class RelatedContentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def valid_url?
|
def valid_url?
|
||||||
params[:url].match(VALID_URL)
|
params[:url].start_with?(Setting['url'])
|
||||||
end
|
end
|
||||||
|
|
||||||
def relationable_object
|
def relationable_object
|
||||||
|
|||||||
Reference in New Issue
Block a user