Skip to content

Commit

Permalink
cast input to string in limit function
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodemellobueno committed Jun 12, 2015
1 parent 6eb656e commit a9ec3c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ module.exports = function plugin( data ) {
*/
swig.setFilter('limit', function(input,limit) {

var output;
var input, output;

input = String ( input );
if(!limit) limit = 140;

if( input.length < limit ) return input;
Expand Down

0 comments on commit a9ec3c0

Please sign in to comment.