Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#459 closed defect (fixed)

Error in dojo.string.has(...)

Reported by: Martin J. Conlon <mconlon@…> Owned by: alex
Priority: high Milestone:
Component: Core Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

There is a coding error in the dojo.string.has comparison function. Misplaced brackets mean that the function always returns true, even if none of the testcases are contained in the main string.

Diff:

--- extras.js.old       Mon Feb 20 20:31:08 2006
+++ extras.js.new       Mon Feb 20 20:30:59 2006
@@ -163,7 +163,7 @@
  */
 dojo.string.has = function(str /* , ... */) {
        for(var i = 1; i < arguments.length; i++) {
-               if(str.indexOf(arguments[i] > -1)) {
+               if(str.indexOf(arguments[i]) > -1) {
                        return true;
                }
        }

Change History (3)

comment:1 Changed 14 years ago by alex

Milestone: 0.3release
Owner: changed from anonymous to alex
Status: newassigned

comment:2 Changed 14 years ago by alex

Resolution: fixed
Status: assignedclosed

fixed in [3121]. Thanks for reporting this.

comment:3 Changed 12 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.