improve script

add few checks to improve validation.
Merge branch 'master' of https://github.com/mediasoftpro/phpBootPagination