Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors:
given-names: Justin
- family-names: Tresova
given-names: Armand
version: 1.11.0
version: 1.11.1
doi: 10.5281/zenodo.1171250
date-released: 2017-05-08
url: "https://github.com/XjSv/cooked"
20 changes: 2 additions & 18 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,8 @@ Versions that are currently being supported with security updates.

| Version | Supported |
| ----------- | ------------------ |
| 1.11.0 | :white_check_mark: |
| 1.10.0 | :x: |
| 1.9.4 | :x: |
| 1.9.3 | :x: |
| 1.9.2 | :x: |
| 1.9.1 | :x: |
| 1.9.0 | :x: |
| 1.8.9 | :x: |
| 1.8.8 | :x: |
| 1.8.7 | :x: |
| 1.8.6 | :x: |
| 1.8.5 | :x: |
| 1.8.4 | :x: |
| 1.8.3 | :x: |
| 1.8.2 | :x: |
| 1.8.1 | :x: |
| 1.8.0 | :x: |
| <= 1.7.15.4 | :x: |
| 1.11.1 | :white_check_mark: |
| <= 1.11.0 | :x: |

## Reporting a Vulnerability

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"recipe"
],
"homepage": "https://wordpress.org/plugins/cooked/",
"version": "1.11.0",
"version": "1.11.1",
"type": "wordpress-plugin",
"license": "GPL-3.0-or-later",
"prefer-stable": true,
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

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

4 changes: 2 additions & 2 deletions cooked.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Description: A recipe plugin for WordPress.
Author: Gora Tech
Author URI: https://goratech.dev
Version: 1.11.0
Version: 1.11.1
Text Domain: cooked
Domain Path: languages
License: GPL2
Expand All @@ -30,7 +30,7 @@

require_once __DIR__ . '/vendor/autoload.php';

define( 'COOKED_VERSION', '1.11.0' );
define( 'COOKED_VERSION', '1.11.1' );
define( 'COOKED_DEV', false );

if ( ! class_exists( 'Cooked_Plugin' ) ) :
Expand Down
21 changes: 20 additions & 1 deletion includes/class.cooked-recipe-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,26 @@ public function save_recipe_meta_box( $post_id ) {
global $recipe_settings;

/* OK, it's safe for us to validate/sanitize the data now. */
$recipe_settings = isset($_POST['_recipe_settings']) ? self::meta_cleanup( $_POST['_recipe_settings'] ) : false;
$recipe_settings = isset($_POST['_recipe_settings']) ? self::meta_cleanup( $_POST['_recipe_settings'] ) : [];

if ( isset( $recipe_settings['content'] ) ) {
$recipe_settings['content'] = str_replace( ["\r\n", "\r"], "\n", $recipe_settings['content'] );
}
if ( isset( $recipe_settings['excerpt'] ) ) {
$recipe_settings['excerpt'] = str_replace( ["\r\n", "\r"], "\n", $recipe_settings['excerpt'] );
}
if ( isset( $recipe_settings['notes'] ) ) {
$recipe_settings['notes'] = str_replace( ["\r\n", "\r"], "\n", $recipe_settings['notes'] );
}

// Directions
if ( isset( $recipe_settings['directions'] ) ) {
foreach ( $recipe_settings['directions'] as $key => $direction ) {
if ( isset( $direction['content'] ) ) {
$recipe_settings['directions'][$key]['content'] = str_replace( ["\r\n", "\r"], "\n", $direction['content'] );
}
}
}

// Update the recipe settings meta field.
update_post_meta( $post_id, '_recipe_settings', $recipe_settings );
Expand Down
12 changes: 8 additions & 4 deletions includes/class.cooked-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ function cooked_settings_saved_admin_notice() {

public static function reset() {
global $_cooked_settings;
$_cooked_settings = Cooked_Settings::get();
$_cooked_settings = self::get();
}

public static function get() {
$_cooked_settings = get_option( 'cooked_settings' );
$_cooked_settings = get_option( 'cooked_settings', [] );

// Get defaults for fields that are not set yet.
$cooked_tabs_fields = self::tabs_fields();
Expand All @@ -121,8 +121,6 @@ public static function get() {
}

public static function check_version_and_update() {
global $_cooked_settings;

$cooked_settings_saved = get_option( 'cooked_settings_saved', false );
$_cooked_settings_version = get_option( 'cooked_settings_version', '1.0.0' );
$_cooked_pro_settings_version = get_option( 'cooked_pro_settings_version', '1.0.0' );
Expand All @@ -133,6 +131,12 @@ public static function check_version_and_update() {

// Update if either version has changed or settings haven't been saved before
if ( !$cooked_settings_saved || $cooked_version_compare < 0 || $cooked_pro_version_compare < 0 ) {
global $_cooked_settings;

if ( empty($_cooked_settings) ) {
$_cooked_settings = self::get();
}

update_option( 'cooked_settings', $_cooked_settings );

// Update both version numbers
Expand Down
Loading