hexojs / hexo-util

Utilities for Hexo.
MIT License
93 stars 59 forks source link

fix(url_for): absolute path is processed by relative_url #262

Closed zkqiang closed 3 years ago

zkqiang commented 3 years ago

The path will be processed by relative_url if you don't judge whether the path is an absolute path first

https://github.com/hexojs/hexo-util/blob/b19468da60ac0e6eab51ae6f90e3f4d625eb9c5c/lib/url_for.js#L19-L21

eg: url_for('http://hexo.io/favicon.ico') will be processed as ../../http:/hexo.io/favicon.ico

So I think this is a bug

zkqiang commented 3 years ago

@SukkaW I added it