Based on the documentation of the str_replace() function, the 4th parameter is optional and should be a variable, that will hold the number of replacements. As it seems that this 4th parameter is not needed in the scope of this module, I think that dropping this parameter could solve the issue.
Using REDCap v13.1.37 in combination with version 2.0.1 of the external module, we have been receiving the following error:
Looking at the code, the error originates in this line of code: https://github.com/lsgs/redcap-extended-reports/blob/a0bd9b9adf02be9ec4af252a54fc0b0f995ba5c2/Report.php#L1130
Based on the documentation of the str_replace() function, the 4th parameter is optional and should be a variable, that will hold the number of replacements. As it seems that this 4th parameter is not needed in the scope of this module, I think that dropping this parameter could solve the issue.
I will prepare a pull request for this fix.