W3C home > Mailing lists > Public > www-validator@w3.org > February 2008

Re: undefined value as ARRAY error

From: Ryan King <ryan@theryanking.com>
Date: Wed, 20 Feb 2008 12:33:51 -0800
Cc: www-validator@w3.org
Message-Id: <2E729E98-3324-4B8A-9ACA-B164EADDB1A8@theryanking.com>
To: olivier Thereaux <ot@w3.org>

On Feb 20, 2008, at 2:19 AM, olivier Thereaux wrote:
> Hi Ryan,
> Thanks for sending this bug report.
> On Feb 14, 2008, at 06:59 , Ryan King wrote:
>> I'm checking http://www.kyleandkelly.com/ via the soap interface.  
>> I'm actually downloading the html, then posting it to the  
>> validator. I can try and find a way to reproduce the error without  
>> my application, if that helps.
> Yes, finding a way to reproduce without the app, or letting us see  
> the way your app sends data to the validator, would be helpful.
> What may also help, as Ville suggested, is to try and run against  
> the dev version of the validator:
> http://qa-dev.w3.org/wmvs/HEAD/
> And tell us which line the error gets reported at (if at all).

There's a ruby script at the end of this email the reproduces the  
problem. It uses the w3c_validators gem[http://code.dunae.ca/w3c_validators/ 

Here's the response I get from validator.w3.org (as seen by tcpflow):
HTTP/1.1 200 OK
Date: Wed, 20 Feb 2008 20:27:53 GMT
Server: Apache/2.2.3 (Debian)
Transfer-Encoding: chunked
Content-Type: text/html

<h1>Software error:</h1>
<pre>Can't use an undefined value as an ARRAY reference at /usr/local/ 
validator/httpd/cgi-bin/check line 1919, &lt;fh00001temp.html&gt; line  
For help, please send mail to the webmaster (<a href="mailto:[no  
address given]">[no address given]</a>), giving this error message
and the time and date of the error.


Interestingly, when I point it at the dev version, I don't get the  

I hope this helps.


#!/usr/bin/env ruby -KU

require 'rubygems'
require 'w3c_validators'
require 'stringio'

module W3CValidators
class MarkupValidator
   def validate_file(file)
     if file.respond_to? :read
       src = file.read
       src = read_local_file(file)
     return validate({:uploaded_file => src}, false)

# v = W3CValidators::MarkupValidator.new :validator_uri => 'http://qa-dev.w3.org/wmvs/HEAD/'
v = W3CValidators::MarkupValidator.new

u = URI.parse('http://www.kyleandkelly.com/')

response = Net::HTTP.start(u.host, u.port) do |h|
   h.get u.request_uri

if response.type_params.key? 'charset'
   charset = response.type_params['charset']
   charset = nil

result = v.validate_file StringIO.new(response.body)
Received on Wednesday, 20 February 2008 20:34:05 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:30:57 UTC