Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: DOM Bug?

Posted on 2008-04-18 18:37:16 by sathia

Hello

Reproduce code:
---------------
Html:
this textarea has inside it a reference to an external image
[...]
<textarea><img src="foobar" /></textarea>
[...]


Php:

$documentx = new DOMDocument();
$documentx->loadHTML($data);
$textareas = $documentx->getElementsByTagName("textarea");
foreach($textareas AS $textarea){
   print($textarea->getAttribute("value"));
   print($textarea->textContent);
}

I know there's no "value" attribute in the textarea, but if the content of
said textarea is wrapped in < and > there's no way to read it.

ideas?
--
e ziocan

Report this message

#2: Re: DOM Bug?

Posted on 2008-04-18 19:24:42 by AlmostBob

<textarea style="BACKGROUND: fixed no-repeat #f5f5f5 url(foobar);">
</textarea>

might work

--
Adaware http://www.lavasoft.de
spybot http://security.kolla.de
AVG free antivirus http://www.grisoft.com
Etrust/Vet/CA.online Antivirus scan
http://www3.ca.com/securityadvisor/virusinfo/scan.aspx
Panda online AntiVirus scan http://www.pandasoftware.com/ActiveScan/
Catalog of removal tools (1)
http://www.pandasoftware.com/download/utilities/
Catalog of removal tools (2)
http://www3.ca.com/securityadvisor/newsinfo/collateral.aspx? CID=40387
Blocking Unwanted Parasites with a Hosts file
http://mvps.org/winhelp2002/hosts.htm
links provided as a courtesy, read all instructions on the pages before use

Grateful thanks to the authors and webmasters
_

"motion musso: aka sathia" <sathia.musso@libero.it> wrote in message
news:074Oj.292512$%k.403029@twister2.libero.it...
> Hello
>
> Reproduce code:
> ---------------
> Html:
> this textarea has inside it a reference to an external image
> [...]
> <textarea><img src="foobar" /></textarea>
> [...]
>
>
> Php:
>
> $documentx = new DOMDocument();
> $documentx->loadHTML($data);
> $textareas = $documentx->getElementsByTagName("textarea");
> foreach($textareas AS $textarea){
> print($textarea->getAttribute("value"));
> print($textarea->textContent);
> }
>
> I know there's no "value" attribute in the textarea, but if the content of
> said textarea is wrapped in < and > there's no way to read it.
>
> ideas?
> --
> e ziocan

Report this message

#3: Re: DOM Bug?

Posted on 2008-04-18 19:44:48 by sathia

AlmostBob wrote:

> <textarea style="BACKGROUND: fixed no-repeat #f5f5f5 url(foobar);">
> </textarea>
>
> might work
>

this is really far from what I expected to read,
sorry but it's not a problem with style.

I surely explained myself in an awful way.

I was complaining that you can't read the content of a textarea via DOM if
it is surrounded with <>

regards

--
e ziocan

Report this message

#4: Re: DOM Bug?

Posted on 2008-04-18 23:57:44 by Jerry Stuckle

motion musso: aka sathia wrote:
> Hello
>
> Reproduce code:
> ---------------
> Html:
> this textarea has inside it a reference to an external image
> [...]
> <textarea><img src="foobar" /></textarea>
> [...]
>
>
> Php:
>
> $documentx = new DOMDocument();
> $documentx->loadHTML($data);
> $textareas = $documentx->getElementsByTagName("textarea");
> foreach($textareas AS $textarea){
> print($textarea->getAttribute("value"));
> print($textarea->textContent);
> }
>
> I know there's no "value" attribute in the textarea, but if the content of
> said textarea is wrapped in < and > there's no way to read it.
>
> ideas?

I haven't tried this particular one, but is it maybe considered a child
node of the textarea?

I'm just not sure if this is valid xml or not - don't know if you can
have an img within a textarea.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Report this message

#5: Re: DOM Bug?

Posted on 2008-04-19 00:49:14 by sathia

Jerry Stuckle wrote:

> I haven't tried this particular one, but is it maybe considered a child
> node of the textarea?

nope, it pure text, but...


>
> I'm just not sure if this is valid xml or not - don't know if you can
> have an img within a textarea.


you should not consider it as a node, but it should be valid as text (ie:
let's say I have a CMS in which i need to enter an embed tag from a
textarea, (an input field would do the trick) )

the problem is that for php it isn't text but it isn't a node as well.



--
e ziocan

Report this message

#6: Re: DOM Bug?

Posted on 2008-04-19 03:49:02 by Jerry Stuckle

motion musso: aka sathia wrote:
> Jerry Stuckle wrote:
>
>> I haven't tried this particular one, but is it maybe considered a child
>> node of the textarea?
>
> nope, it pure text, but...
>
>
>> I'm just not sure if this is valid xml or not - don't know if you can
>> have an img within a textarea.
>
>
> you should not consider it as a node, but it should be valid as text (ie:
> let's say I have a CMS in which i need to enter an embed tag from a
> textarea, (an input field would do the trick) )
>
> the problem is that for php it isn't text but it isn't a node as well.
>
>
>

No, &lt;img src="foobar" /&lt; would be text. <img src="foobar"\>
should be a node.

< and > are not legitimate XML characters, other than as tag delimiters.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Report this message

#7: Re: DOM Bug?

Posted on 2008-04-19 04:43:29 by Jeff North

On Fri, 18 Apr 2008 16:37:16 GMT, in alt.php "motion musso: aka
sathia" <sathia.musso@libero.it>
<074Oj.292512$%k.403029@twister2.libero.it> wrote:

>| Hello
>|
>| Reproduce code:
>| ---------------
>| Html:
>| this textarea has inside it a reference to an external image
>| [...]
>| <textarea><img src="foobar" /></textarea>
>| [...]
>|
>|
>| Php:
>|
>| $documentx = new DOMDocument();
>| $documentx->loadHTML($data);
>| $textareas = $documentx->getElementsByTagName("textarea");
>| foreach($textareas AS $textarea){
>|    print($textarea->getAttribute("value"));
>|    print($textarea->textContent);
>| }
>|
>| I know there's no "value" attribute in the textarea, but if the content of
>| said textarea is wrapped in < and > there's no way to read it.
>|
>| ideas?

I'd look at the library that you are using and checking what
'textContent' is looking at and it's return value.

AFAIK, textarea contents can be accessed by
value or childNodes[0].nodeValue
-- ------------------------------------------------------------ -
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
-- ------------------------------------------------------------ -

Report this message