| @@ -159,8 +159,21 @@ | ||
| 159 | 159 | $decoded = json_decode($json); |
| 160 | 160 | return is_object($decoded) ? $decoded : null; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | + /** | |
| 164 | + * Hardened hosts disable ignore_user_abort in php.ini; PHP 8 fatals on the call instead of warning. | |
| 165 | + * | |
| 166 | + * @param bool $ignore | |
| 167 | + * @return void | |
| 168 | + */ | |
| 169 | + public static function ignoreUserAbort($ignore = true) | |
| 170 | + { | |
| 171 | + if (\function_exists('ignore_user_abort')) { | |
| 172 | + \ignore_user_abort($ignore); | |
| 173 | + } | |
| 174 | + } | |
| 175 | + | |
| 163 | 176 | public static function duplicateDbTable($oldTableName, $newTableName) |
| 164 | 177 | { |
| 165 | 178 | global $wpdb; |
| 166 | 179 | $oldTable = "{$wpdb->prefix}bitforms_{$oldTableName}"; |