Skip to content

Commit

Permalink
www.webkit.org webkit_surveys plugin errors in PHP-FPM 8.1
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=286829
rdar://143981711

Reviewed by Alexey Proskuryakov.

These changes will fix the error in PHP-FPM 8.1:
non-static method WebKit_Survey::process_vote() cannot be called statically

* Websites/webkit.org/wp-content/plugins/webkit-survey/plugin.php:

Canonical link: https://commits.webkit.org/290121@main
  • Loading branch information
lingcherd committed Feb 9, 2025
1 parent b3c8e43 commit df61325
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Websites/webkit.org/wp-content/plugins/webkit-survey/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public static function register_shortcodes() {
add_shortcode('survey', ['WebKit_Survey', 'survey_shortcode']);
}

public function process_survey($post_id, $post_after, $post_before) {
public static function process_survey($post_id, $post_after, $post_before) {
self::$post_update = true;
do_shortcode($post_after->post_content);
}

public function survey_shortcode($atts, $content) {
public static function survey_shortcode($atts, $content) {
$json_string = str_replace(array('',''), '"', html_entity_decode(strip_tags($content)));
$Survey = json_decode($json_string);

Expand All @@ -57,7 +57,7 @@ public function survey_shortcode($atts, $content) {
return ob_get_clean();
}

public function add_survey_boxes() {
public static function add_survey_boxes() {
$post_id = get_the_ID();
$settings = get_post_meta($post_id, 'webkit_survey_settings');
if (!$settings)
Expand All @@ -74,7 +74,7 @@ public function add_survey_boxes() {
}
}

public function admin_box() {
public static function admin_box() {
$post_id = get_the_ID();
$settings = get_post_meta($post_id, 'webkit_survey_settings');
?>
Expand All @@ -89,7 +89,7 @@ public function admin_box() {
echo '<strong>' . number_format($total) . '</strong> Total Votes';
}

public function process_vote() {
public static function process_vote() {
if (self::responded()) {
self::$responded = true;
return;
Expand Down

0 comments on commit df61325

Please sign in to comment.