Bug #781
Plugins: Read local xml files
Status: | Invalid | Start date: | 11/16/2011 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Plugins | |||
Target version: | 3.4 | |||
Found in version: | 3.3.223 | Platform: | Linux |
Description
Read a XML file from a local path or from plugin.path
showtime.readFile('/dev_hdd0/test.xml');
History
#1
Updated by andreus sebes about 11 years ago
andreas,
I'm sorry the problem is not reading the files. I tested with local path, with plugin.path and with smb path.
The error in parsing to XML.
My code:var upath="LOCAL OR PLUGIN OR SMB PATH";
var xTest = new XML(showtime.readFile(upath).toString());
Returns the error "Syntax Error: xml is a reserved identifier"
Note you can close bug 782, since is the same problem that this one
#2
Updated by Andreas Smas about 11 years ago
Ok, The readFile() method is not available in (correctly built) release versions of Showtime.
Why?
Because I don't want plugins to be able to read all sorts of files from peoples system and upload that stuff anywhere on the internet.
#3
Updated by Andreas Smas about 11 years ago
- Status changed from New to Invalid
Not really related to this, but just FYI
#4
Updated by andreus sebes about 11 years ago
Ok. Problem solved.
Googling i discover that is a bug of XML, if you do this workaroud it works :)
http://blogs.adobe.com/formfeed/2010/09/e4x-in-form-design.html
sXML = sXML.replace(/^[\s\S]*?(<[^\?!])/, "$1");
Sorry for the problem
#5
Updated by andreus sebes about 11 years ago
Ok, The readFile() method is not available in (correctly built) release versions of Showtime. Why? Because I don't want plugins to be able to read all sorts of files from peoples system and upload that stuff anywhere on the internet.
But then you can only read xml files from http. SMB requires readFile().
Can't you only permit readFile() in SMB and inside the zipped plugin and not in whole local system?