Skip to content

Commit 18fd962

Browse files
committed
Yet another fix for a function that didn't allow non-string types to be passed.
1 parent 3bcd1c8 commit 18fd962

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

functions/strings/strrpos.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
function strrpos( haystack, needle, offset){
22
// http://kevin.vanzonneveld.net
33
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
4+
// + bugfixed by: Onno Marsman
45
// * example 1: strrpos('Kevin van Zonneveld', 'e');
56
// * returns 1: 16
67

7-
var i = haystack.lastIndexOf( needle, offset ); // returns -1
8+
var i = (haystack+'').lastIndexOf( needle, offset ); // returns -1
89
return i >= 0 ? i : false;
910
}

0 commit comments

Comments
 (0)