Infinite scroll function for Twenty Seventeen

Well, I really should’ve done this to begin with, but I took a look at my NGINX logs while the infinite scroll would hang, and it turns out the NAXSI web application firewall module I’m using in NGINX is blocking infinite scroll due to anti-XSS/ant-SQL injection policies. Specifically it’s because of square brackets and usage of the word “update”.

Hopefully this will help anyone else out on Google with a similar issue, but here is what I added to the WordPress NAXSI whitelist to allow infinite scroll:

BasicRule wl:1310,1311 "mz:$BODY_VAR:scripts[]|NAME";
BasicRule wl:1310,1311 "mz:$BODY_VAR:styles[]|NAME";
BasicRule wl:1310,1311 "mz:$BODY_VAR_X:^query_args\[.*\]|NAME";
BasicRule wl:1000 "mz:$BODY_VAR:query_args[update_post_term_cache]|NAME";
BasicRule wl:1000 "mz:$BODY_VAR:query_args[update_post_meta_cache]|NAME";