WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 11 days ago

#41387 new defect (bug)

Avoid 403's from AJAX requests from postbox.js

Reported by: bobbingwide Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch reporter-feedback
Focuses: javascript Cc:

Description

While making some improvements to a plugin's admin pages I changed the HTML in my meta boxes to be more inline with WordPress core. I then noticed that I was getting 403's from the closed-postboxes AJAX request each time I toggled the display of the postbox.

Since I don't have a requirement for the open/closed state of my postboxes to persist I don't need the AJAX requests. Consequently I don't have a #closedpostboxesnonce.

So, to avoid the 403's I changed postbox.js to not perform the AJAX request if the nonce isn't set.


Attachments (1)

41387.patch (819 bytes) - added by bobbingwide 4 years ago.
Don't post the AJAX request if there isn't a nonce

Download all attachments as: .zip

Change History (6)

@bobbingwide
4 years ago

Don't post the AJAX request if there isn't a nonce

#1 @bobbingwide
4 years ago

  • Keywords has-patch added

#2 @ocean90
4 years ago

  • Focuses javascript added
  • Keywords reporter-feedback added
  • Version 4.9 deleted

Why is your admin page enqueuing postbox.js? Just for the opening/closing functionality? If you want to be inline with other core meta boxes I'd expect that the state is saved as well.

#3 @bobbingwide
4 years ago

Yes. I’m using postbox.js to be consistent with core.
But as stated, I don’t feel I have a requirement to support saving the state.
Therefore there is no need for the extra admin logic and the associated nonce.

You can change this to an enhancement if you like.

#4 @adamsilverstein
4 years ago

@bobbingwide Your use case seems out of scope for using the postbox.js script. Eg, it wasn't designed for this. Instead of changing core to fit your use, I'd suggest you overwrite the postbox script functionality after it loads to get it to more closely match what you want it to do.

Since postboxes is exposed as a global, you can overwrite the save functionality. Something like this should work, make sure it runs immediately after postbox.js loads, and ideally prevent interaction with the toggles until your code runs:

postboxes.save_order = function() {};

Can you give that a try and see if it resolves your issue?

Last edited 4 years ago by adamsilverstein (previous) (diff)

#5 @usernameunkowns
11 days ago

https://uaenewsagency.blogspot.com/
https://dubaivehicle.blogspot.com/
https://uaeultimate.blogspot.com/
https://uaeblogonline.blogspot.com/
https://fddddsfddcdc.blogspot.com/
https://projectorliteblog.blogspot.com/
https://pakeducationalist.blogspot.com/
https://lionsonlineforcesacademy.blogspot.com/
https://dubaitimesblog.blogspot.com/
https://edcationinpakistan.blogspot.com/
https://mywebsitestorenew.blogspot.com/
https://mywebsitestoreold.blogspot.com/
https://theguestpostcontent.blogspot.com/
https://thesupercontent.blogspot.com/
https://thesuperbloggers.blogspot.com/
https://thebloggerfundablog.blogspot.com/
https://therunnerblogger.blogspot.com/
https://Foodreviewbloggerblog.blogspot.com/
https://thenewbieblogger.blogspot.com/
https://eindianbloggershub.blogspot.com/
https://eamericansupperblogger.blogspot.com/
https://eperfectaustralianblogger.blogspot.com/
https://themostwantedbloggernow.blogspot.com/
https://howyoudothatbloggers.blogspot.com/
https://whywearebestbloggernow.blogspot.com/
https://WhereIamgoing.blogspot.com
https://eLetmedownslowly.blogspot.com/
https://RedditRefrencesblogger.blogspot.com/
https://digitalTeamworkblogger.blogspot.com/
https://theseoandwriteragency.blogspot.com/
https://Theclientproblemsolver.blogspot.com/
https://theworldnewblogger.blogspot.com/
https://thewonderofworldbloggers.blogspot.com/
https://theestatementblogger.blogspot.com/
https://emobilesandgamesblog.blogspot.com/
http://social.technet.microsoft.com/profile/fashioninstitute/
https://bit.ly/3chMZO9
https://cutt.ly/oncdnP2
https://t.ly/WqVN
http://social.technet.microsoft.com/profile/lawyersarbi/
https://t.ly/UwAb
https://cutt.ly/4ncdQiR
https://bit.ly/3wVNvcD
http://social.technet.microsoft.com/profile/zardosi/
https://cutt.ly/2ncdElQ
https://t.ly/N7X2
https://bit.ly/34QYPdW
http://social.technet.microsoft.com/profile/rajendralawyer/
https://cutt.ly/TncsDUr
https://bit.ly/3g6qdKp
http://social.technet.microsoft.com/profile/barassociation/
https://bit.ly/2Sc69OP
http://social.technet.microsoft.com/profile/consumerlawyer/
https://cutt.ly/FncdvT0
https://bit.ly/3cjXZuF
http://bbs.now.qq.com/home.php?mod=space&uid=1021004/
http://bbs.now.qq.com/?1021004/
http://social.technet.microsoft.com/profile/Findtrademark/
https://cutt.ly/KncdzdW
https://bit.ly/2TIpsja
http://social.technet.microsoft.com/profile/gstlawyers/
https://cutt.ly/Hncdj1Q
https://bit.ly/34LPMer
http://social.technet.microsoft.com/profile/backlinkesysteml/
https://cutt.ly/HncdhyW
https://bit.ly/3wZDrzc
http://social.technet.microsoft.com/profile/backlinkesystemm/
https://cutt.ly/encdfp9
https://bit.ly/3z1P0Id
http://social.technet.microsoft.com/profile/backlinkesystemn/
https://cutt.ly/incda40
https://bit.ly/3vVlDp8
http://social.technet.microsoft.com/profile/backlinkesystemo/
https://cutt.ly/8ncdpSk
https://bit.ly/34K6lr1
http://social.technet.microsoft.com/profile/backlinkesystemj/
https://cutt.ly/ZncdoIr
https://bit.ly/2SXhe6i
https://social.technet.microsoft.com/profile/zardosi/
https://social.technet.microsoft.com/profile/backlinkesystemk/
https://social.technet.microsoft.com/profile/gstlawyers/
https://social.technet.microsoft.com/profile/backlinkesystemp/
https://social.technet.microsoft.com/profile/backlinkesystemp/
https://social.technet.microsoft.com/profile/registercompany/
https://social.technet.microsoft.com/profile/fashioninstitute/
https://social.technet.microsoft.com/profile/Findtrademark/
https://social.technet.microsoft.com/profile/squrefeet/
https://social.technet.microsoft.com/profile/backlinkesystemn/
https://social.technet.microsoft.com/profile/backlinkesysteml/
https://social.technet.microsoft.com/profile/backlinkesystemj/
https://social.technet.microsoft.com/profile/finaceconsult/
https://social.technet.microsoft.com/profile/divvorcelegal/
https://social.technet.microsoft.com/profile/backlinkesystemm/
https://social.technet.microsoft.com/profile/backlinkesystemi/
https://social.technet.microsoft.com/profile/backlinkesystemq/
https://social.technet.microsoft.com/profile/backlinkesystemr/
https://social.technet.microsoft.com/profile/drtlaw/
https://social.technet.microsoft.com/profile/publicforum/
https://social.technet.microsoft.com/profile/tamilsir/
https://social.technet.microsoft.com/profile/realestatelaw/
https://social.technet.microsoft.com/profile/ncltadvocate/
https://social.technet.microsoft.com/profile/BankLoan/
https://social.technet.microsoft.com/profile/PropertyLawyer/
https://social.technet.microsoft.com/profile/backlinkesystemo/
https://social.technet.microsoft.com/profile/fashioninstitute/
http://social.technet.microsoft.com/profile/backlinkesystemk/
https://cutt.ly/sncdiWH
https://bit.ly/3fPHAQT
http://social.technet.microsoft.com/profile/backlinkesystemp/
https://cutt.ly/pncdyHb
https://bit.ly/3ifrvp9
http://social.technet.microsoft.com/profile/lawyersch/
https://cutt.ly/bncdtYk
https://bit.ly/2THHCSb
http://social.technet.microsoft.com/profile/registercompany/
https://cutt.ly/hncdrAG
https://bit.ly/3fNXB9K
http://social.technet.microsoft.com/profile/squrefeet
https://cutt.ly/CncdqTC
https://bit.ly/3z56WS7
http://social.technet.microsoft.com/profile/finaceconsult/
https://cutt.ly/mncs51e
https://bit.ly/3g8vUrg
http://social.technet.microsoft.com/profile/divvorcelegal/
https://cutt.ly/0ncs7De
https://bit.ly/2SVtp3J
http://social.technet.microsoft.com/profile/backlinkesystemi/
https://cutt.ly/Cncs4G4
https://bit.ly/3fMq3Jc
http://social.technet.microsoft.com/profile/backlinkesystemq/
https://cutt.ly/Sncs8lL
https://bit.ly/2SYKYQo
https://www.liveinternet.ru/users/caisar987522/profile
https://cutt.ly/Lncs976
https://bit.ly/2SXi82G
http://social.technet.microsoft.com/profile/backlinkesystemr/
https://cutt.ly/hncs2To
https://bit.ly/3phAtni
http://social.technet.microsoft.com/profile/drtlaw/
https://cutt.ly/Oncs0ta
https://bit.ly/2TxUk5K
http://social.technet.microsoft.com/profile/publicforum/
https://cutt.ly/YncsMBR
https://bit.ly/3gdj8YF
http://social.technet.microsoft.com/profile/realestatelaw/
https://cutt.ly/fncsBWy
https://bit.ly/3fRRLnG
http://social.technet.microsoft.com/profile/tamilsir/
https://cutt.ly/PncsVtk
https://bit.ly/3vSQsdN
http://social.technet.microsoft.com/profile/ncltadvocate/
https://cutt.ly/yncsXFH
https://bit.ly/3vWqBBS
http://social.technet.microsoft.com/profile/PropertyLawyer/
https://cutt.ly/oncsL88
https://bit.ly/34KlhFV
http://social.technet.microsoft.com/profile/BankLoan/
https://cutt.ly/jncsKW2
https://bit.ly/3gcT4gb
https://uaenewsagency.blogspot.com/
https://bit.ly/3yJwJ22
https://dubaivehicle.blogspot.com/
https://bit.ly/3yINs5M
https://uaeultimate.blogspot.com/
https://bit.ly/3vw08uz
https://uaeblogonline.blogspot.com/
https://bit.ly/3wweWJY
https://fddddsfddcdc.blogspot.com/
https://bit.ly/2TfRYIy
https://projectorliteblog.blogspot.com/
https://bit.ly/3fUyQrc
https://pakeducationalist.blogspot.com/
https://bit.ly/3wBIRQU
https://lionsonlineforcesacademy.blogspot.com/
https://bit.ly/3i0RUH4
https://dubaitimesblog.blogspot.com/
https://bit.ly/3fOoeKB
https://edcationinpakistan.blogspot.com/
https://bit.ly/3vw9yXd
https://mywebsitestorenew.blogspot.com/
https://bit.ly/34nhY75
https://mywebsitestoreold.blogspot.com/
https://bit.ly/3fqZ8lR
https://theguestpostcontent.blogspot.com/
https://nodepositpokeronline.com/
https://edex.adobe.com/member/H0VBng_md
https://bit.ly/3hZB6jC
https://adobe.ly/3fxWURN
https://onlinecasinoku.com/
https://edex.adobe.com/member/m668LxZKy
https://adobe.ly/3c4PlQp
https://bit.ly/2TkwbiZ
https://redbettips.com/
https://edex.adobe.com/member/r5FTQM4Y9
https://adobe.ly/3fvS7QQ
https://bit.ly/2SCyU6V
https://sharkcasinogames.com/
https://edex.adobe.com/member/gEEJupeb3
https://adobe.ly/3c3druY
https://bit.ly/2Te9TiP
https://redwinecasino.com/
https://edex.adobe.com/member/Pill23DNX
https://adobe.ly/34rDVSC
https://bit.ly/3c04vXc
https://publicforum.in/
https://edex.adobe.com/member/kUuSuKqZO
https://adobe.ly/3i1veGy
https://bit.ly/3oVl4ZI
https://lawyerschennai.com/
https://edex.adobe.com/member/_gZSmBWL2
https://adobe.ly/3fvOB9e
https://bit.ly/2RIlM0h
https://wwwtamilsiragugal.com/
https://edex.adobe.com/member/TW44VSdgu
https://adobe.ly/34ry7st
https://bit.ly/2RK348A
https://ncltadvocates.com/
https://edex.adobe.com/member/avVnuvrJh
https://adobe.ly/3i2SwMd
https://bit.ly/2RIlNkR
https://drtlaw.in/
https://edex.adobe.com/member/4mLkt0zfW
https://adobe.ly/3yQNcS7
https://bit.ly/3vqhj0G
https://realestatelaw.in/
https://edex.adobe.com/member/jyeQssh0l
https://adobe.ly/2SyZqOJ
https://bit.ly/2Sy2ElI
https://propertylawyer.org.in/
https://edex.adobe.com/member/Rr0eM5mMO
https://adobe.ly/2TtqLT1
https://bit.ly/2ToSm7P
https://bankloan.org.in/
https://edex.adobe.com/member/Tn9F_WPGt
https://adobe.ly/2RMXLVV
https://bit.ly/3bWei0f
https://consumerlawyer.in/
https://edex.adobe.com/member/mWcQ_DOw_
https://adobe.ly/3yWqRTx
https://bit.ly/2RJmp9X
https://findtrademark.org/
https://edex.adobe.com/member/w3RIxeJ1X
https://adobe.ly/3p0nm9Z
https://bit.ly/2Sulie5
https://gstlawyers.in/
https://edex.adobe.com/member/CWQu1Jp5k
https://adobe.ly/3fuxFjs
https://bit.ly/3yMuevS
https://buddypress.trac.wordpress.org/ticket/3755
https://bit.ly/3p6KKCw
https://cutt.ly/DngZR8y
https://shorturl.at/npxO2
https://https://tinyurl.com/4mzz9xr2
https://tiny.cc/7qcytz
https://shorturl.at/sLMY5
http://lnkiy.in/UFnsd
https://pxlme.me/bdZoNvXk
https://redirect.is/gtdy3ax
https://t.ly/mFky
http://bitly.ws/dGnv
https://n9.cl/bitlyyy
https://fashioninstitute.co.in/
https://edex.adobe.com/member/iz9iLOmJ0
https://adobe.ly/2SFDiSG
https://bit.ly/3vvb6kc
https://lawyersarbitrators.com/
https://edex.adobe.com/member/HzwB02DKQ
https://adobe.ly/3p4AU4o
https://bit.ly/3wwg7ZU
https://zardosi.in/
https://edex.adobe.com/member/s5lSTFiyP
https://adobe.ly/3p2VKkj
https://bit.ly/3vAzMYI
https://rajendralawoffice.com/
https://adobe.ly/2RMXIJJ
https://edex.adobe.com/member/Snf6tuTsn
https://bit.ly/3bZReOa
https://barassociation.in/
https://edex.adobe.com/member/Sv4VjZ_A3
https://adobe.ly/2SDk68r
https://bit.ly/3oZoBpC
https://registeracompany.in/
https://edex.adobe.com/member/KJDWKng9v
https://adobe.ly/3fvFk0H
https://bit.ly/3yLjcqH
https://www.bestsquarefeet.com/
https://edex.adobe.com/member/pQTa07ing
https://adobe.ly/3fU4Trn
https://bit.ly/34wvKEt
https://financeconsultants.net/
https://edex.adobe.com/member/TrbX55Kbk
https://adobe.ly/3i8OjHb
https://bit.ly/3bYCKhR
https://divorcelegal.in/
https://edex.adobe.com/member/lUWaOzfPT
https://adobe.ly/3uyYsPJ
https://bit.ly/3wwguUi
https://bit.ly/3vtRD3b
https://thesupercontent.blogspot.com/
https://bit.ly/3vwQVlP
https://thesuperbloggers.blogspot.com/
https://bit.ly/3yHXiVx
https://thebloggerfundablog.blogspot.com/
https://bit.ly/3vw9MO3
https://therunnerblogger.blogspot.com/
https://bit.ly/3uro9Sb
https://Foodreviewbloggerblog.blogspot.com/
https://bit.ly/3i0L8kK
https://thenewbieblogger.blogspot.com/
https://bit.ly/3yKy7S7
https://eindianbloggershub.blogspot.com/
https://bit.ly/3i0Lo3c
https://eamericansupperblogger.blogspot.com/
https://bit.ly/3wwfgZc
https://eperfectaustralianblogger.blogspot.com/
https://bit.ly/3yLihXh
https://themostwantedbloggernow.blogspot.com/
https://bit.ly/3yMyfQW
https://howyoudothatbloggers.blogspot.com/
https://bit.ly/3oWbp4U
https://whywearebestbloggernow.blogspot.com/
https://bit.ly/3wFPRfw
https://WhereIamgoing.blogspot.com/
https://bit.ly/3p9z02t
https://eLetmedownslowly.blogspot.com/
https://bit.ly/3yK1VhO
https://RedditRefrencesblogger.blogspot.com/
https://bit.ly/3uCT9z3
https://digitalTeamworkblogger.blogspot.com/
https://bit.ly/3yJXKCM
https://theseoandwriteragency.blogspot.com/
https://bit.ly/3vyet9Z
https://Theclientproblemsolver.blogspot.com/
https://bit.ly/2Tqot76
https://theworldnewblogger.blogspot.com/
https://bit.ly/3bZ2GK9
https://thewonderofworldbloggers.blogspot.com/
https://bit.ly/3wAJZEv
https://theestatementblogger.blogspot.com/
https://bit.ly/2RLaybo
https://emobilesandgamesblog.blogspot.com/
https://bit.ly/3wKnixP

Note: See TracTickets for help on using tickets.