Coder Social home page Coder Social logo

phpally's People

Contributors

alanfcmv avatar atarisafari avatar bagofarms avatar cidijohn avatar cidilabs avatar jasonmatos23-git avatar jonathancrandall avatar justin-cidilabs avatar sgcooper78 avatar webchuckweb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

phpally's Issues

Unit tests have one failure missing ContentTooLongScript.html from testCheckSkipScriptTags

I was looking to add few more unit tests to test a few things that might be errors with this library surfacing in UDOIT. However, there was 1 current error when running the unit tests for this project:

1) NoHeadingsTest::testCheckSkipScriptTags
file_get_contents(/Users/jonespm/git/phpally/tests/../tests/testFiles/ContentTooLongScript.html): Failed to open stream: No such file or directory

Not sure if this file is available or if this test should just be removed. Looks like this was referenced in 9965a8b by @atarisafari

Thanks!

ImageHasAlt incorrect for data decorative images

If an image does not have the role attribute set to presentation, but does have the data-decorative attribute set to true, the image will be incorrectly flagged as breaking the ImageHasAlt rule.

Element with bgcolor attribute creates critical error

When phpally grabs the style of an element, the following condition is evaluated: https://github.com/cidilabs/phpally/blob/master/src/Rule/BaseRule.php#L170

if($element->hasAttribute('bgcolor') &&  in_array($element->tagName, $this->deprecated_style_elements)) {
	$style['background-color'] = $element->getAttribute('bgcolor');
}

If the element does not have a bgcolor attribute, php does not evaluate the second part of the condition, and the code continues executing without issue. If the element does have a bgcolor attribute, the in_array portion of the condition is evaluated, causing a critical error:

Uncaught PHP Exception TypeError: "in_array(): Argument #2 ($haystack) must be of type array, null given" at /var/www/html/vendor/cidilabs/phpally/src/Rule/BaseRule.php line 169

Which appears to be saying that $this->deprecated_style_elements is null. I did a search for deprecated_style_elements in the rest of the codebase, and did not find another mention of it, so it appears that this value is never defined, hence why it is null. It seems like the in_array check isn't really necessary, since it shouldn't matter what element we're pulling the bgcolor attribute from.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.