File tree Expand file tree Collapse file tree 4 files changed +7
-3
lines changed Expand file tree Collapse file tree 4 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ var pathFn = require('path');
44var Promise = require ( 'bluebird' ) ;
55
66function getExtname ( str ) {
7+ if ( typeof str !== 'string' ) return '' ;
8+
79 var extname = pathFn . extname ( str ) || str ;
810 return extname [ 0 ] === '.' ? extname . slice ( 1 ) : extname ;
911}
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ var Promise = require('bluebird');
55var fs = require ( 'hexo-fs' ) ;
66
77function getExtname ( str ) {
8+ if ( typeof str !== 'string' ) return '' ;
9+
810 var extname = pathFn . extname ( str ) ;
911 return extname [ 0 ] === '.' ? extname . slice ( 1 ) : extname ;
1012}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ function postPermalinkFilter(data) {
1111 var meta = {
1212 id : data . id || data . _id ,
1313 title : data . slug ,
14- name : pathFn . basename ( data . slug ) ,
14+ name : typeof data . slug === 'string' ? pathFn . basename ( data . slug ) : '' ,
1515 post_title : util . slugize ( data . title , { transform : 1 } ) ,
1616 year : data . date . format ( 'YYYY' ) ,
1717 month : data . date . format ( 'MM' ) ,
Original file line number Diff line number Diff line change 3333 "bluebird" : " ^3.4.0" ,
3434 "chalk" : " ^1.1.3" ,
3535 "cheerio" : " ^0.20.0" ,
36- "hexo-cli" : " ^1.0.1 " ,
36+ "hexo-cli" : " ^1.0.2 " ,
3737 "hexo-front-matter" : " ^0.2.2" ,
3838 "hexo-fs" : " ^0.1.5" ,
3939 "hexo-i18n" : " ^0.2.1" ,
4646 "moment-timezone" : " ^0.5.4" ,
4747 "nunjucks" : " ^2.4.2" ,
4848 "pretty-hrtime" : " ^1.0.2" ,
49- "strip-indent" : " ^2 .0.0 " ,
49+ "strip-indent" : " ^1 .0.1 " ,
5050 "swig" : " 1.4.2" ,
5151 "swig-extras" : " 0.0.1" ,
5252 "text-table" : " ^0.2.0" ,
You can’t perform that action at this time.
0 commit comments