Skip to content

Commit

Permalink
Merge pull request #1508 from xwp/fix/issue-1489-valueerror-class-log
Browse files Browse the repository at this point in the history
Fix Uncaught ValueError in Gravity Forms and WordPress SEO connectors
  • Loading branch information
delawski authored Jul 19, 2024
2 parents a303ca6 + 09b0198 commit e78e3d6
Show file tree
Hide file tree
Showing 13 changed files with 282 additions and 68 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/stream.zip
/stream-*.zip
npm-debug.log
debug.log
package.lock
.phpunit.result.cache

Expand Down
10 changes: 10 additions & 0 deletions classes/class-connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,14 @@ function ( $value ) {
public function is_dependency_satisfied() {
return true;
}

/**
* Escape % characters in a string to avoid Uncaught ValueErrors in $this->log().
*
* @param string $value The string value to be escaped.
* @return string The escaped string.
*/
public function escape_percentages( $value ) {
return str_replace( '%', '%%', $value );
}
}
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"wpackagist-plugin/easy-digital-downloads": "2.9.23",
"wpackagist-plugin/jetpack": "10.0",
"wpackagist-plugin/user-switching": "1.5.5",
"wpackagist-plugin/wordpress-seo": "23.0",
"wpackagist-theme/twentytwentythree": "^1.0",
"xwp/wait-for": "^0.0.1",
"yoast/phpunit-polyfills": "^1.1"
Expand Down Expand Up @@ -77,6 +78,10 @@
"phpunit --coverage-text",
"php local/scripts/make-clover-relative.php ./tests/reports/clover.xml"
],
"test-one": [
"phpunit",
"WP_MULTISITE=1 phpunit"
],
"test-multisite": [
"WP_MULTISITE=1 phpunit --coverage-text",
"php local/scripts/make-clover-relative.php ./tests/reports/clover.xml"
Expand Down
72 changes: 45 additions & 27 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e78e3d6

Please sign in to comment.