Skip to content

timeoutAlarm model interval param verification bug,You can now set negative integers#3171

Merged
qiaozhanwei merged 2 commits intoapache:devfrom
zhuangchong:dev
Jul 13, 2020
Merged

timeoutAlarm model interval param verification bug,You can now set negative integers#3171
qiaozhanwei merged 2 commits intoapache:devfrom
zhuangchong:dev

Conversation

@zhuangchong
Copy link
Copy Markdown
Contributor

timeoutAlarm.vue interval verification bug,You can now set negative integers

The interval parameter is validated by regular expression, and only positive integers can pass

Brief change log

Param interval , Positive integer validation rules use regular expressions

++    const reg = /^[1-9]\d*$/
++   if (this.enable && !reg.test(this.interval)) {
 -- if (this.enable && !parseInt(this.interval) && !_.isInteger(this.interval)) {

Verify this pull request

(example:)

  • Manually verified the change by testing locally.

timeoutAlarm.vue interval 参数验证bugverification bug,目前负整数也可以验证通过

interval 参数 通过正则表达式验证,只有正整数可以验证通过

Brief change log

interval 参数 ,正整数验证规则使用正则表达式
++    const reg = /^[1-9]\d*$/
++   if (this.enable && !reg.test(this.interval)) {
 -- if (this.enable && !parseInt(this.interval) && !_.isInteger(this.interval)) {

-通过本地测试手动验证更改

@qiaozhanwei
Copy link
Copy Markdown
Contributor

@break60

Copy link
Copy Markdown
Contributor

@break60 break60 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@yangyichao-mango
Copy link
Copy Markdown
Contributor

yangyichao-mango commented Jul 11, 2020

Good job and thx a lot for your contribution, +1.

Copy link
Copy Markdown
Contributor

@qiaozhanwei qiaozhanwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@qiaozhanwei qiaozhanwei merged commit de41ac5 into apache:dev Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants