Search code examples
phpxmljoomla

Uber Uploader XML ERROR: XML_ERR_NAME_REQUIRED at line 1 with hwdMediaShare


Uber uploader was working perfectly, and then suddenly it doesn't work and has this error:

XML ERROR: XML_ERR_NAME_REQUIRED at line 1

It occasionally starts working again and then goes back to this problem.


Solution

  • This error occurs because the joomla 32-bit random form token occasionally begins with a number, causing an invalid tag in the .redirect xml file.

    A quick fix is to rename the invalid xml tags before parsing:

    1. Open joomla\components\com_hwdmediashare\libraries\uber\ubr_finished_lib.php

    2. Add the following code to function parseFeed()

      # Precede invalid tag names with key_
      $xml_post_data = preg_replace('/\<([0-9][^\>]*)\>([^\<]*)\<\/([0-9][^\>]*)\>/',
      '<key_$1>$2</key_$3>', $xml_post_data);
      

    Or if you don't need the joomla form token then remove it.