Filter options passed to toJSON
Filter options passed to toJSON

fixes #5177

- we now pass API/model options directly to toJSON, which is unsafe as these options haven't always been filtered before they are passed.
- this fix adds a filter so that toJSON only uses the options it needs
- additionally, rename the 'name' option to something more specific to prevent clashes

diancloud/Ghost,NovaDevelopGroup/Academy,JohnONolan/Ghost,alecho/Ghost,tyrikio/Ghost,rameshponnada/Ghost,sebgie/Ghost,jgillich/Ghost,jeonghwan-kim/Ghost,daihuaye/Ghost,rafaelstz/Ghost,woodyrew/Ghost,kortemy/Ghost,NikolaiIvanov/Ghost,edsadr/Ghost,bastianbin/Ghost,allanjsx/Ghost,leonli/ghost,yundt/seisenpenji,camilodelvasto/localghost,AnthonyCorrado/Ghost,ASwitlyk/Ghost,janvt/Ghost,olsio/Ghost,influitive/crafters,Xibao-Lv/Ghost,claudiordgz/Ghost,yangli1990/Ghost,augbog/Ghost,GarrethDottin/Habits-Design,nneko/Ghost,Romdeau/Ghost,FredericBernardo/Ghost,Japh/shortcoffee,francisco-filho/Ghost,notno/Ghost,NovaDevelopGroup/Academy,FredericBernardo/Ghost,tyrikio/Ghost,davidenq/Ghost-Blog,devleague/uber-hackathon,mlabieniec/ghost-env,Kaenn/Ghost,akveo/akveo-blog,e10/Ghost,atandon/Ghost,andrewconnell/Ghost,jorgegilmoreira/ghost,kevinansfield/Ghost,sceltoas/Ghost,Smile42RU/Ghost,theonlypat/Ghost,rouanw/Ghost,wemakeweb/Ghost,riyadhalnur/Ghost,sajmoon/Ghost,schematical/Ghost,ananthhh/Ghost,daimaqiao/Ghost-Bridge,weareleka/blog,javimolla/Ghost,Netazoic/bad-gateway,benstoltz/Ghost,manishchhabra/Ghost,icowan/Ghost,carlosmtx/Ghost,greyhwndz/Ghost,UsmanJ/Ghost,hyokosdeveloper/Ghost,ivantedja/ghost,leninhasda/Ghost,kevinansfield/Ghost,jaguerra/Ghost,TryGhost/Ghost,zackslash/Ghost,mlabieniec/ghost-env,Azzurrio/Ghost,Bunk/Ghost,ygbhf/Ghost,davidmenger/nodejsfan,situkangsayur/Ghost,camilodelvasto/herokughost,mlabieniec/ghost-env,imjerrybao/Ghost,ErisDS/Ghost,velimir0xff/Ghost,sunh3/Ghost,AlexKVal/Ghost,Remchi/Ghost,jamesslock/Ghost,JulienBrks/Ghost,davidmenger/nodejsfan,sfpgmr/Ghost,mdbw/ghost,Dnlyc/Ghost,morficus/Ghost,omaracrystal/Ghost,julianromera/Ghost,dYale/blog,rizkyario/Ghost,carlyledavis/Ghost,aroneiermann/GhostJade,dqj/Ghost,francisco-filho/Ghost,dggr/Ghost-sr,memezilla/Ghost,stridespace/Ghost,kortemy/Ghost,ignasbernotas/nullifer,no1lov3sme/Ghost,ryanbrunner/crafters,ryanbrunner/crafters,sfpgmr/Ghost,netputer/Ghost,adam-paterson/blog,rollokb/Ghost,developer-prosenjit/Ghost,cqricky/Ghost,bsansouci/Ghost,Feitianyuan/Ghost,weareleka/blog,pbevin/Ghost,thomasalrin/Ghost,obsoleted/Ghost,Japh/Ghost,sifatsultan/js-ghost,developer-prosenjit/Ghost,dymx101/Ghost,Elektro1776/javaPress,augbog/Ghost,flpms/ghost-ad,sifatsultan/js-ghost,epicmiller/pages,rchrd2/Ghost,johnnymitch/Ghost,singular78/Ghost,claudiordgz/Ghost,flpms/ghost-ad,jin/Ghost,mnitchie/Ghost,petersucks/blog,bisoe/Ghost,BlueHatbRit/Ghost,rizkyario/Ghost,Netazoic/bad-gateway,barbastan/Ghost,schematical/Ghost,blankmaker/Ghost,lukekhamilton/Ghost,v3rt1go/Ghost,diogogmt/Ghost,rmoorman/Ghost,tandrewnichols/ghost,katrotz/blog.katrotz.space,PaulBGD/Ghost-Plus,pedroha/Ghost,riyadhalnur/Ghost,ckousik/Ghost,edurangel/Ghost,lanffy/Ghost,hilerchyn/Ghost,omaracrystal/Ghost,tidyui/Ghost,daimaqiao/Ghost-Bridge,dgem/Ghost,NamedGod/Ghost,leonli/ghost,cncodog/Ghost-zh-codog,rafaelstz/Ghost,smedrano/Ghost,edurangel/Ghost,telco2011/Ghost,bbmepic/Ghost,Kikobeats/Ghost,influitive/crafters,dymx101/Ghost,kolorahl/Ghost,bbmepic/Ghost,camilodelvasto/localghost,theonlypat/Ghost,axross/ghost,lf2941270/Ghost,bosung90/Ghost,Kaenn/Ghost,greenboxindonesia/Ghost,mattchupp/blog,ManRueda/manrueda-blog,cwonrails/Ghost,ErisDS/Ghost,Rovak/Ghost,AlexKVal/Ghost,denzelwamburu/denzel.xyz,jorgegilmoreira/ghost,Loyalsoldier/Ghost,KnowLoading/Ghost,flomotlik/Ghost,hnarayanan/narayanan.co,ananthhh/Ghost,jorgegilmoreira/ghost,jaguerra/Ghost,tanbo800/Ghost,Loyalsoldier/Ghost,smedrano/Ghost,STANAPO/Ghost,GroupxDev/javaPress,sunh3/Ghost,darvelo/Ghost,PeterCxy/Ghost,schneidmaster/theventriloquist.us,atandon/Ghost,PepijnSenders/whatsontheotherside,skmezanul/Ghost,Trendy/Ghost,kolorahl/Ghost,mtvillwock/Ghost,rito/Ghost,JulienBrks/Ghost,johnnymitch/Ghost,rchrd2/Ghost,dgem/Ghost,julianromera/Ghost,JonathanZWhite/Ghost,IbrahimAmin/Ghost,LeandroNascimento/Ghost,velimir0xff/Ghost,notno/Ghost,virtuallyearthed/Ghost,javorszky/Ghost,novaugust/Ghost,BlueHatbRit/Ghost,davidenq/Ghost-Blog,nmukh/Ghost,duyetdev/islab,schneidmaster/theventriloquist.us,gabfssilva/Ghost,hnarayanan/narayanan.co,exsodus3249/Ghost,ineitzke/Ghost,sergeylukin/Ghost,dbalders/Ghost,jgillich/Ghost,JonSmith/Ghost,tmp-reg/Ghost,codeincarnate/Ghost,Elektro1776/javaPress,syaiful6/Ghost,zackslash/Ghost,yanntech/Ghost,IbrahimAmin/Ghost,tksander/Ghost,greyhwndz/Ghost,blankmaker/Ghost,YY030913/Ghost,petersucks/blog,syaiful6/Ghost,smaty1/Ghost,llv22/Ghost,etdev/blog,Sebastian1011/Ghost,disordinary/Ghost,cqricky/Ghost,morficus/Ghost,k2byew/Ghost,JonSmith/Ghost,sceltoas/Ghost,jomahoney/Ghost,melissaroman/ghost-blog,jin/Ghost,lowkeyfred/Ghost,delgermurun/Ghost,flomotlik/Ghost,Rovak/Ghost,hyokosdeveloper/Ghost,mtvillwock/Ghost,leninhasda/Ghost,zeropaper/Ghost,daihuaye/Ghost,akveo/akveo-blog,etdev/blog,davidenq/Ghost-Blog,mohanambati/Ghost,ghostchina/Ghost-zh,vainglori0us/urban-fortnight,singular78/Ghost,phillipalexander/Ghost,devleague/uber-hackathon,Yarov/yarov,Bunk/Ghost,kevinansfield/Ghost,phillipalexander/Ghost,beautyOfProgram/Ghost,Kikobeats/Ghost,JohnONolan/Ghost,mohanambati/Ghost,bsansouci/Ghost,GroupxDev/javaPress,zhiyishou/Ghost,beautyOfProgram/Ghost,javimolla/Ghost,situkangsayur/Ghost,TribeMedia/Ghost,wallmarkets/Ghost,veyo-care/Ghost,hnq90/Ghost,wspandihai/Ghost,cysys/ghost-openshift,JonathanZWhite/Ghost,cysys/ghost-openshift,novaugust/Ghost,zumobi/Ghost,ManRueda/manrueda-blog,yanntech/Ghost,MadeOnMars/Ghost,Alxandr/Blog,ddeveloperr/Ghost,VillainyStudios/Ghost,dYale/blog,melissaroman/ghost-blog,rouanw/Ghost,PDXIII/Ghost-FormMailer,allanjsx/Ghost,Klaudit/Ghost,Xibao-Lv/Ghost,denzelwamburu/denzel.xyz,sajmoon/Ghost,mayconxhh/Ghost,woodyrew/Ghost,praveenscience/Ghost,jiachenning/Ghost,ITJesse/Ghost-zh,kwangkim/Ghost,shrimpy/Ghost,edsadr/Ghost,ITJesse/Ghost-zh,ineitzke/Ghost,camilodelvasto/herokughost,GarrethDottin/Habits-Design,anijap/PhotoGhost,PepijnSenders/whatsontheotherside,letsjustfixit/Ghost,NovaDevelopGroup/Academy,andrewconnell/Ghost,cysys/ghost-openshift,cwonrails/Ghost,veyo-care/Ghost,patterncoder/patterncoder,zeropaper/Ghost,rizkyario/Ghost,bosung90/Ghost,lethalbrains/Ghost,dai-shi/Ghost,ManRueda/Ghost,trunk-studio/Ghost,mayconxhh/Ghost,arvidsvensson/Ghost,ClarkGH/Ghost,xiongjungit/Ghost,yundt/seisenpenji,vloom/blog,lukekhamilton/Ghost,ballPointPenguin/Ghost,MadeOnMars/Ghost,ivanoats/ivanstorck.com,bitjson/Ghost,exsodus3249/Ghost,BayPhillips/Ghost,NikolaiIvanov/Ghost,ManRueda/Ghost,chris-yoon90/Ghost,bisoe/Ghost,Brunation11/Ghost,chevex/undoctrinate,qdk0901/Ghost,carlosmtx/Ghost,Gargol/Ghost,bitjson/Ghost,epicmiller/pages,TryGhost/Ghost,daimaqiao/Ghost-Bridge,singular78/Ghost,icowan/Ghost,dbalders/Ghost,UnbounDev/Ghost,handcode7/Ghost,nneko/Ghost,Japh/Ghost,handcode7/Ghost,ljhsai/Ghost,liftup/ghost,gabfssilva/Ghost,thomasalrin/Ghost,ashishapy/ghostpy,rollokb/Ghost,Japh/shortcoffee,stridespace/Ghost,load11/ghost,lf2941270/Ghost,KnowLoading/Ghost,lukw00/Ghost,wangjun/Ghost,Alxandr/Blog,dqj/Ghost,GroupxDev/javaPress,kwangkim/Ghost,ThorstenHans/Ghost,madole/diverse-learners,k2byew/Ghost,lethalbrains/Ghost,katrotz/blog.katrotz.space,Trendy/Ghost,johngeorgewright/blog.j-g-w.info,skmezanul/Ghost,jiachenning/Ghost,ngosinafrica/SiteForNGOs,telco2011/Ghost,xiongjungit/Ghost,YY030913/Ghost,gcamana/Ghost,chris-yoon90/Ghost,jiangjian-zh/Ghost,rameshponnada/Ghost,dggr/Ghost-sr,Netazoic/bad-gateway,dggr/Ghost-sr,wemakeweb/Ghost,lanffy/Ghost,vainglori0us/urban-fortnight,jaswilli/Ghost,r14r/fork_nodejs_ghost,kortemy/Ghost,SkynetInc/steam,SachaG/bjjbot-blog,trunk-studio/Ghost,makapen/Ghost,pollbox/ghostblog,lukaszklis/Ghost,carlyledavis/Ghost,dai-shi/Ghost,sebgie/Ghost,obsoleted/Ghost,DesenTao/Ghost,e10/Ghost,RufusMbugua/TheoryOfACoder,vloom/blog,memezilla/Ghost,ignasbernotas/nullifer,praveenscience/Ghost,Netazoic/bad-gateway,Romdeau/Ghost,psychobunny/Ghost,rmoorman/Ghost,klinker-apps/ghost,ManRueda/Ghost,janvt/Ghost,Kaenn/Ghost,ckousik/Ghost,imjerrybao/Ghost,acburdine/Ghost,djensen47/Ghost,mdbw/ghost,mhhf/ghost-latex,ddeveloperr/Ghost,patterncoder/patterncoder,psychobunny/Ghost,aroneiermann/GhostJade,RufusMbugua/TheoryOfACoder,Remchi/Ghost,thehogfather/Ghost,qdk0901/Ghost,sergeylukin/Ghost,pollbox/ghostblog,SkynetInc/steam,PaulBGD/Ghost-Plus,karmakaze/Ghost,JohnONolan/Ghost,vainglori0us/urban-fortnight,jamesslock/Ghost,diogogmt/Ghost,telco2011/Ghost,ashishapy/ghostpy,Yarov/yarov,cncodog/Ghost-zh-codog,ygbhf/Ghost,bastianbin/Ghost,Brunation11/Ghost,PeterCxy/Ghost,TryGhost/Ghost,wallmarkets/Ghost,olsio/Ghost,darvelo/Ghost,lukw00/Ghost,gcamana/Ghost,dbalders/Ghost,karmakaze/Ghost,sangcu/Ghost,jeonghwan-kim/Ghost,ManRueda/manrueda-blog,UsmanJ/Ghost,lowkeyfred/Ghost,pbevin/Ghost,tanbo800/Ghost,nmukh/Ghost,ngosinafrica/SiteForNGOs,shannonshsu/Ghost,Alxandr/Blog,zumobi/Ghost,mattchupp/blog,llv22/Ghost,ghostchina/Ghost-zh,Gargol/Ghost,pathayes/FoodBlog,diancloud/Ghost,acburdine/Ghost,Sebastian1011/Ghost,BayPhillips/Ghost,PDXIII/Ghost-FormMailer,r1N0Xmk2/Ghost,ballPointPenguin/Ghost,Smile42RU/Ghost,mnitchie/Ghost,virtuallyearthed/Ghost,novaugust/Ghost,tmp-reg/Ghost,NamedGod/Ghost,Azzurrio/Ghost,allanjsx/Ghost,etanxing/Ghost,wangjun/Ghost,letsjustfixit/Ghost,cwonrails/Ghost,TribeMedia/Ghost,delgermurun/Ghost,wspandihai/Ghost,stridespace/Ghost,gleneivey/Ghost,hilerchyn/Ghost,letsjustfixit/Ghost,Elektro1776/javaPress,jacostag/Ghost,disordinary/Ghost,pathayes/FoodBlog,STANAPO/Ghost,manishchhabra/Ghost,v3rt1go/Ghost,netputer/Ghost,Kikobeats/Ghost,smaty1/Ghost,etanxing/Ghost,codeincarnate/Ghost,alecho/Ghost,tksander/Ghost,panezhang/Ghost,benstoltz/Ghost,arvidsvensson/Ghost,r1N0Xmk2/Ghost,pedroha/Ghost,sebgie/Ghost,prosenjit-itobuz/Ghost,thehogfather/Ghost,makapen/Ghost,acburdine/Ghost,VillainyStudios/Ghost,shannonshsu/Ghost,jaswilli/Ghost,UnbounDev/Ghost,anijap/PhotoGhost,cicorias/Ghost,klinker-apps/ghost,load11/ghost,rito/Ghost,DesenTao/Ghost,ThorstenHans/Ghost,yangli1990/Ghost,kaychaks/kaushikc.org,LeandroNascimento/Ghost,liftup/ghost,axross/ghost,mhhf/ghost-latex,ASwitlyk/Ghost,cncodog/Ghost-zh-codog,javorszky/Ghost,ivanoats/ivanstorck.com,lukaszklis/Ghost,devleague/uber-hackathon,Dnlyc/Ghost,jomahoney/Ghost,ljhsai/Ghost,duyetdev/islab,greenboxindonesia/Ghost,gleneivey/Ghost,r14r/fork_nodejs_ghost,zhiyishou/Ghost,mohanambati/Ghost,Klaudit/Ghost,sangcu/Ghost,leonli/ghost,no1lov3sme/Ghost,AnthonyCorrado/Ghost,prosenjit-itobuz/Ghost,ErisDS/Ghost,johngeorgewright/blog.j-g-w.info,shrimpy/Ghost,jacostag/Ghost,adam-paterson/blog,SachaG/bjjbot-blog,tidyui/Ghost,tandrewnichols/ghost,madole/diverse-learners,djensen47/Ghost,Feitianyuan/Ghost,hnq90/Ghost,barbastan/Ghost,ClarkGH/Ghost,kaychaks/kaushikc.org,jiangjian-zh/Ghost,cicorias/Ghost,panezhang/Ghost