-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preg_match error sanitizer #1154
Comments
private function check_attr_spec_rule_valid_url( $node, $attr_name, $attr_spec_rule ) {
if ( isset( $attr_spec_rule[ AMP_Rule_Spec::VALUE_URL ] ) ) {
if ( $node->hasAttribute( $attr_name ) ) {
$urls_to_test = preg_split( '/\s*,\s*/', $node->getAttribute( $attr_name ) );
foreach ( $urls_to_test as $url ) {
$url = urldecode( $url );
// Check if the host contains invalid chars.
$url_host = wp_parse_url( $url, PHP_URL_HOST );
if ( $url_host && preg_match( '/[!"#$%&\'()*+,\/:;<=>?@[\]^`{|}~\s]/i', $url_host ) ) {
return AMP_Rule_Spec::FAIL;
}
// Check if the protocol contains invalid chars.
$dots_pos = strpos( $url, ':' );
if ( false !== $dots_pos && preg_match( '/[!"#$%&\'()*+,\/:;<=>?@[\]^`{|}~\s]/i', substr( $url, 0, $dots_pos ) ) ) {
return AMP_Rule_Spec::FAIL;
}
}
return AMP_Rule_Spec::PASS;
}
}
return AMP_Rule_Spec::NOT_APPLICABLE;
} |
@nickreale What version of WordPress PHP are you running? What appears to be happening is on this line: The |
I am using the latest version. |
4.9.6 |
I'm confused. If this is the code in question: $url = urldecode( $url );
// Check if the host contains invalid chars.
$url_host = wp_parse_url( $url, PHP_URL_HOST );
if ( $url_host && preg_match( '/[!"#$%&\'()*+,\/:;<=>?@[\]^`{|}~\s]/i', $url_host ) ) { The |
i am also confused. You can go here
http://taylorfamilyfuneralhome.com/tributes/elena-sepulveda/
and see the error for yourself. I just did the WP update as well.
This is the error reported:
```
*Fatal error*: Uncaught Error: Call to undefined function
twentyseventeen_get_svg() in
/homepages/30/d261456565/htdocs/clickandbuilds/TFFH/wp-content/themes/CherryFramework/comments.php:62
Stack trace: #0
/homepages/30/d261456565/htdocs/clickandbuilds/TFFH/wp-includes/comment-template.php(1474):
require() #1
/homepages/30/d261456565/htdocs/clickandbuilds/TFFH/wp-content/themes/CherryFramework/loop/loop-single.php(25):
comments_template('/comments.php', true) #2
/homepages/30/d261456565/htdocs/clickandbuilds/TFFH/wp-includes/template.php(690):
require('/homepages/30/d...') #3
/homepages/30/d261456565/htdocs/clickandbuilds/TFFH/wp-includes/template.php(647):
load_template('/homepages/30/d...', false) #4
/homepages/30/d261456565/htdocs/clickandbuilds/TFFH/wp-includes/general-template.php(155):
locate_template(Array, true, false) #5
/homepages/30/d261456565/htdocs/clickandbuilds/TFFH/wp-content/themes/CherryFramework/single.php(14):
get_template_part('loop/loop-singl...') #6
/homepages/30/d261456565/htdocs/clickandbuilds/TFFH/w in
*/homepages/30/d261456565/htdocs/clickandbuilds/TFFH/wp-content/themes/CherryFramework/comments.php*
on line *62*
```
|
|
I would agree but i cannot find this problem documented anywhere else. I
even uninstalled 2017. Not sure where to go from here
…On Sat, May 19, 2018, 1:24 PM Weston Ruter ***@***.***> wrote:
twentyseventeen_get_svg() is undefined? It seems you have a deeper
problem with your install. Maybe a problem with CherryFramework?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1154 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOjqvTteF0mtqM1YliN6mn8Yel_aJUuKks5t0FU6gaJpZM4UC3hf>
.
|
By best guess is it is a problem with CherryFramework, so I'm going to close this for now. |
I installed the plugin on several sites. I only seem to have an issue with one site where every amp post is giving this error.
Here is a link
http://www.familytireandautoservice.com/locations/tires-needed-denver-tires/amp/
I have several hundred posts and it has this error on all I have checked.
Any ideas or help is appreciated.
The text was updated successfully, but these errors were encountered: