You are not logged in.
Pages: 1
It seems when I have some php embedded into a string inside some php it breaks Xinha's script detection
(Rev: 1175 svn)
for example:
<?php
$string = "<?php
echo \"test\";
?>";
eval ("?>".$string."<?");
?>
The eval would be considered by xinha to be regular html, not detecting the "level" it is inside the php - then xinha translates the greater thans to > and the quotes to "
Also, thanks for the response on my other post gogo , I figured out it was that fairly quickly, and ended up using embedded tables to make it look the way I wanted
eg: <table><td><form ...><table><td>cell1</td><td>cell 2</td></table></form></td></tr><tr><td><form ...><table><td>.....etc</form></td></table> - but I also now have it so it can be pure css without any tables (I love php! )
Btw, I really really like Xinha. Props and cheers!
Last edited by 0xdeadc0de (2009-03-31 04:50:19)
Offline
Hi 0xdeadc0de,
if your're talking about the plugin PreserveScripts, it is using RegExps to find blocks of PHP. Obviously not all levels of complexity can be covered by this without designing an equally complex regular expression, but there are always cases that will fall out, like the example you give. Sorry.
Offline
ahh thank you for the explaination, that does make sense.
I run into lots of troubles with regex's (From not understanding them well ), which is why I personally stick to the alternative of character by character parsing when I make parsers that have to traverse slightly more complex stuff (even though they can be a pain in the arse to get right sometimes).
I'll try taking a whack at it someday when I have free time, if of course nobody minds. I'll have to brush up on JS though.
To give back to Xinha since I'm using it in my latest project would be good .
PS. I like smilies to much.. I need to stop using them all the time!
Last edited by 0xdeadc0de (2009-03-31 09:42:44)
Offline
I'd work around the issue by using chr(60) for < and chr(62) for >
<?php
$string = chr(60)."?php
echo \"test\";
?".chr(62);
eval (" ?".chr(62).$string.chr(60)."?php ");
?>
James Sleeman
Offline
Hmm, that gives me an idea, I can put the <?php ?> part inside the api and have it automatically insert into the scripts, although I'm not really crazy for that solution - it already parses and translates those mini-scripts them making then more difficult to debug already.
I don't want to use the chr method because that would reduce readability imo.
I'm using xinha as the default text area editor for a (wiki like) database API, so I don't know what kinds of scripts will be used in it in the end, but I made it "standard" to be able to replace a database field with a custom php script that will be eval'd (hence this bug affecting me).
Offline
Pages: 1