cidilabs / phpally Goto Github PK
View Code? Open in Web Editor NEWPHP server-based accessibility checker (hence the name ALLY or A11Y) based on the PHP accessibility library QUAIL.
License: MIT License
PHP server-based accessibility checker (hence the name ALLY or A11Y) based on the PHP accessibility library QUAIL.
License: MIT License
Link checker that was added to UDOIT 2.8 should be added to 3.0 (From UDOIT/Issue/620).
I am currently working on this in a forked version.
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!
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.
Aria is not handled by the current rule. ucfopen/UDOIT#673
A decorative image in an anchor with no other content inside breaks two rules, both AnchorMustContainText and ImageAltNotEmptyInAnchor.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.