diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-content/plugins/portfolio/inc/class-prtfl-settings.php
--- a/wp/wp-content/plugins/portfolio/inc/class-prtfl-settings.php Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-content/plugins/portfolio/inc/class-prtfl-settings.php Tue Dec 15 13:49:49 2020 +0100
@@ -3,8 +3,6 @@
* Displays the content on the plugin settings page
*/
-require_once( dirname( dirname( __FILE__ ) ) . '/bws_menu/class-bws-settings.php' );
-
if ( ! class_exists( 'Prtfl_Settings_Tabs' ) ) {
class Prtfl_Settings_Tabs extends Bws_Settings_Tabs {
public $wp_image_sizes = array();
@@ -24,6 +22,7 @@
$tabs = array(
'settings' => array( 'label' => __( 'Settings', 'portfolio' ) ),
+ 'project' => array( 'label' => __( 'Project', 'portfolio' ) ),
'misc' => array( 'label' => __( 'Misc', 'portfolio' ) ),
'custom_code' => array( 'label' => __( 'Custom Code', 'portfolio' ) ),
'import-export' => array( 'label' => __( 'Import / Export', 'portfolio' ) ),
@@ -39,8 +38,6 @@
'tabs' => $tabs,
'wp_slug' => 'portfolio',
'demo_data' => $prtfl_BWS_demo_data,
- 'pro_page' => 'edit.php?post_type=bws-portfolio&page=portfolio-pro.php',
- 'bws_license_plugin' => 'portfolio-pro/portfolio-pro.php',
'link_key' => 'f047e20c92c972c398187a4f70240285',
'link_pn' => '74',
) );
@@ -82,7 +79,7 @@
'link' => __( 'Link', 'portfolio' ),
'shrdescription' => __( 'Short Description', 'portfolio' ),
'description' => __( 'Description', 'portfolio' ),
- 'svn' => __( 'SVN URL', 'portfolio' )
+
);
add_action( get_parent_class( $this ) . '_display_custom_messages', array( $this, 'display_custom_messages' ) );
@@ -99,12 +96,10 @@
*/
public function save_options() {
- $this->options["custom_image_row_count"] = intval( $_POST['prtfl_custom_image_row_count'] );
- $this->options["custom_portfolio_row_count"] = intval( $_POST['prtfl_portfolio_custom_row_count'] );
- if ( 1 > $this->options["custom_image_row_count"] )
- $this->options["custom_image_row_count"] = 1;
- if ( 1 > $this->options["custom_portfolio_row_count"] )
- $this->options["custom_portfolio_row_count"] = 1;
+ $message = $notice = $error = '';
+
+ $this->options["custom_image_row_count"] = absint( $_POST['prtfl_custom_image_row_count'] );
+ $this->options["custom_portfolio_row_count"] = absint( $_POST['prtfl_portfolio_custom_row_count'] );
$new_image_size_photo = esc_attr( $_POST['prtfl_image_size_photo'] );
$custom_image_size_w_photo = intval( $_POST['prtfl_custom_image_size_w_photo'] );
@@ -159,22 +154,21 @@
}
$this->options["link_additional_field_for_non_registered"] = isset( $_REQUEST["prtfl_link_additional_field_for_non_registered"] ) ? 1 : 0;
+ $this->options["svn_text_field"] = sanitize_text_field( $_REQUEST["prtfl_svn_text_field"] );
+ $this->options["svn_additional_field_for_non_logged"] = isset( $_REQUEST["prtfl_svn_additional_field_for_non_logged"] ) ? 1 : 0;
+ $this->options["svn_additional_field"] = isset( $_REQUEST["prtfl_svn_additional_field"] ) ? 1 : 0;
foreach ( $this->fields as $field_key => $field_title ) {
$this->options[ $field_key . '_additional_field'] = isset( $_REQUEST['prtfl_' . $field_key . '_additional_field'] ) ? 1 : 0;
- $this->options[ $field_key . '_text_field'] = stripslashes( esc_html( $_REQUEST['prtfl_' . $field_key . '_text_field'] ) );
+ $this->options[ $field_key . '_text_field'] = stripslashes( sanitize_text_field( $_REQUEST['prtfl_' . $field_key . '_text_field'] ) );
+
}
- $this->options['screenshot_text_field'] = stripslashes( esc_html( $_REQUEST['prtfl_screenshot_text_field'] ) );
+ $this->options['screenshot_text_field'] = stripslashes( sanitize_text_field( $_REQUEST['prtfl_screenshot_text_field'] ) );
- $slug = strtolower( trim( stripslashes( esc_html( $_POST['prtfl_slug'] ) ) ) );
- $slug = preg_replace( "/[^a-z0-9\s-]/", "", $slug );
- $slug = trim( preg_replace( "/[\s-]+/", " ", $slug ) );
- $slug = preg_replace( "/\s/", "-", $slug );
- if ( $this->options["slug"] != $slug ) {
+ if ( $this->options["slug"] != $_POST['prtfl_slug'] )
$this->options["flush_rewrite_rules"] = 1;
- }
- $this->options["slug"] = $slug;
+ $this->options["slug"] = sanitize_title( $_POST['prtfl_slug'] );
/**
* rewriting post types name with unique one from default options
@@ -257,6 +251,18 @@
hide_pro_tabs ) { ?>
@@ -322,10 +322,18 @@
|
- |
+
+
+ |
+
+
|
@@ -334,12 +342,6 @@