PHP Classes

Values as Keys

Recommend this page to a friend!

      HTML SQL  >  All threads  >  Values as Keys  >  (Un) Subscribe thread alerts  
Subject:Values as Keys
Summary:Error when attribute is in "find_value_ending_c" mode
Messages:1
Author:Guilherme Blanco
Date:2007-11-29 04:28:40
 

  1. Values as Keys   Reply   Report abuse  
Picture of Guilherme Blanco Guilherme Blanco - 2007-11-29 04:28:40
Hi,

I experienced an error while working with tidy.
Sometimes tidy generated tags like:

<a href=
"http://www.domain.com" class=
"classname2">value</a>

When processing attributes, your class parses href as "find_value_ending_c" mode and the value is defined as a new key. That was what I had:

Array
(
[href] =>
["http://www.mercadolivre.com.br/jm/micuenta"] =>
[class] =>
["hpcategmenu"] =>
[tagname] => a
[text] => Minha Conta
)

I made a fix to prevent this error, which worked perfectly in my test case. Please consider revision and apply the patch, so others author won't experience the same issue.


File: htmlsql.class.php
Line 648:

else if ($mode == 'value'){
// [FIX - Guilherme Blanco] Should skip if non html def value
if ( ! preg_match('/[ \t\s\r\n>]/', $char) ) {
$tmp .= $char; $mode = 'find_value_ending_c';
}
} else if (



If you need any other explanation about the error, mail me.


Regards,