New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KG - OS Setting Fixes #1014
KG - OS Setting Fixes #1014
Conversation
…rect types to task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment on regex
app/lib/data_type_validator.rb
Outdated
@@ -39,7 +39,7 @@ def is_email?(value) | |||
end | |||
|
|||
def is_url?(value) | |||
value.match?(/^((ftp|http|https):\/\/)?[a-zA-Z0-9]+(.[a-zA-Z0-9])?(:[0-9]+)?/) | |||
value.match?(/^((ftp|http|https):\/\/)?[a-zA-Z0-9]+((\.[a-zA-Z0-9]+)|(:[0-9]+)+)/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regex doesn't allow for multiple periods in a url, and it allows more than one port. I'm not sure how big of an issue it is, but 123.0.0.0:3000
would not match, and localhost:3000:3000
would match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I'm fixing this part of the URL and adding an optional path regex after it (updated from the current path regex) to ensure that the URL is fully valid.
@Stuart-Johnson |
Kyle, you have to update your Travis config. See the OS master branch and my latest commit. You have to merge and repush.
Andrew
On Jul 21, 2017, at 9:42 AM, kyle-glick <notifications@github.com<mailto:notifications@github.com>> wrote:
@Stuart-Johnson<https://github.com/stuart-johnson>
The test suite is unable to run currently on os-move-configuration-to-database so this branch won't be able to pass on Travis.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#1014 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AH7TzfnNVbhia4Gg491TQRiYqxF2xCZsks5sQKrSgaJpZM4Oc2C4>.
…-------------------------------------------------------------------------
This message was secured via TLS by MUSC.
|
@sparc-request |
#value
method on the Setting model was missing a default return. It returned nil unless the setting was a JSON or boolean type.value
validation on the Setting model incorrectly usedfalse
as a default, but should usetrue
. This prevents errors from being added forstring
type settings.'t'
and'f'
instead of'true'
and'false'
.friendly_name
anddescription
to each setting in the rake task.email
,url
, andpath
to rake task.
which matched any character instead of\.
which matches only the.
character. Also allows more flexible strings in the domain.