Fix processParams with escapeshellarg(): adds single quotes around a string and quotes/escapes any existing single quotes #636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue:
If my string have a single quote, I can not use the CURL request log in Postman.
So we need to use
escapeshellargto add single quotes around a string and quotes/escapes any existing single quotes. Then we can use it in PostmanOLD CODE

curl -F 'block_display_for_non_targeted_viewer=0' -F 'context_card={"title":"Walkthrough Videos Are The Best Way To Sell Your Property","content":["Enhance your listings and give them greater social presence."],"style":"PARAGRAPH_STYLE"}' -F 'follow_up_action_url=https://www.xxx.co.za/' -F 'is_optimized_for_quality=1' -F 'locale=EN_GB' -F 'name=CCT Capture Media Video 01/10 Company Q (xxx) 10-202411 hello321xin chao abc xyz' -F 'question_page_custom_headline=Please complete the short form below so we can contact you to to discuss your specific walkthrough video needs.' -F 'questions=[{"key":"which_real_estate_company_do_you_currently_work_for?","label":"Which real estate company do you currently work for?","type":"CUSTOM"},{"key":"full_name","type":"FULL_NAME"},{"key":"email","type":"EMAIL"},{"key":"phone_number","type":"PHONE"},{"key":"province","type":"PROVINCE"}]' -F 'thank_you_page={"title":"Thanks, our team will be in touch.","body":"We\'ll contact you to to discuss your specific walkthrough video needs.","button_text":"View Website","enable_messenger":false,"button_type":"VIEW_WEBSITE","website_url":"https:\/\/www.xxx.co.za\/"}' -F 'allow_organic_lead_retrieval=1' -F 'privacy_policy={"url":"https:\/\/www.xxx.co.za\/privacy\/","link_text":"Privacy Policy"}' -F 'fields=id,page_id,name,questions' -F 'access_token=xxx' -F 'appsecret_proof=xxx' https://graph.facebook.com/v21.0/xxx/leadgen_forms [] []NEW CODE

curl -F 'block_display_for_non_targeted_viewer=0' -F 'context_card={"title":"Walkthrough Videos Are The Best Way To Sell Your Property","content":["Enhance your listings and give them greater social presence."],"style":"PARAGRAPH_STYLE"}' -F 'follow_up_action_url=https://www.capturevideos.co.za/' -F 'is_optimized_for_quality=1' -F 'locale=EN_GB' -F 'name=CCT Capture Media Video 01/10 Company Q (RUA230500013ST) 10-202411 hello123xin chao abc xyz' -F 'question_page_custom_headline=Please complete the short form below so we can contact you to to discuss your specific walkthrough video needs.' -F 'questions=[{"key":"which_real_estate_company_do_you_currently_work_for?","label":"Which real estate company do you currently work for?","type":"CUSTOM"},{"key":"full_name","type":"FULL_NAME"},{"key":"email","type":"EMAIL"},{"key":"phone_number","type":"PHONE"},{"key":"province","type":"PROVINCE"}]' -F 'thank_you_page={"title":"Thanks, our team will be in touch.","body":"We'\''ll contact you to to discuss your specific walkthrough video needs.","button_text":"View Website","enable_messenger":false,"button_type":"VIEW_WEBSITE","website_url":"https:\/\/www.capturevideos.co.za\/"}' -F 'allow_organic_lead_retrieval=1' -F 'privacy_policy={"url":"https:\/\/www.capturevideos.co.za\/privacy\/","link_text":"Privacy Policy"}' -F 'fields=id,page_id,name,questions' -F 'access_token=xxx' -F 'appsecret_proof=xxx' https://graph.facebook.com/v21.0/595010557337230/leadgen_forms [] []................