OJS 3.1.1-2 Plagiarism (iThenticate) plugin

Hi everyone,

We recently started seeing this in a hosted site, and I think the error is due to a bug in the XML parser library that comes with the plugin. There is a regular expression that checks the format of the date returned. Specifically, there is a line of code in the XML library that looks at the date sent back from the server and checks to see if it matches a string:

if (!preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $this->_xh['ac'])) {

Essentially, that checks to see if the date looks like 20190702T16:08:05 but this is not what your date looks like. Your date looks like 2019-07-02T16:08:05Z, with dashes and a Z at the end, which won’t pass this step. You can modify the regular expression to:

/^[0-9\-]{10}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$/

Which should allow it to pass. The file you need to modify is XMLParser.php:

Cheers,
Jason

2 Likes