Possible minor issue when import XML containing absolute href path

Hi,

I am using native XML to import submissions with submission files.
With an absolute path in the href of the revision, the import plugin looks for a / in the second character of the path, not the first. I think it is a code error but not sure as I am new to OJS code.
I had a look through the issues but did not locate this.

My XML:

  <submission_file stage="proof" id="2">
    <revision number="1" genre="Article Text" filename="can-11-718.xml" filetype="application/xml">
      <name>xml for my test article</name>
      <href src="/var/www/html/archive/published-content/can-11-718/can-11-718.xml"/>
    </revision>

OJS3 version: 3.1.2-4

Source file:
lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFileFilter.inc.php (line 289)

} elseif (substr($filesrc, 1, 1) === '/') {

should this be

} elseif (substr($filesrc, 0, 1) === '/') {

?

Regards,
@jp_ecancer

Hi @jp_ecancer,

Thanks for reporting, and yes, you have correctly diagnosed and fixed a bug! I’ve filed this at Issues · pkp/pkp-lib · GitHub it’ll be released with the next OJS and OMP packages.

Regards,
Alec Smecher
Public Knowledge Project Team