doherty/WP-vanilla-pdf-embed — pull request #4 by AngelinaBelle (2014-04-04 20:35:45+00:00)
Title: $attachment[0], RLIKE issue, and only autoembed pdf files

Check that $attachment[0] exists before returning it.
Avoid issue with regexp chars in filename by using LIKE '%%%s'
Do not autoembed non-pdf files just because they are on a line by themselves. Check $route. If file is not an attachment in _posts, and if $route=VPDFE_AUTOEMBED && file is not a pdf file, do not embed it.