-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(security): prevent reflected xss #1200
base: v4
Are you sure you want to change the base?
Conversation
@@ -35,8 +35,6 @@ class WCMP_API extends WCMP_Rest | |||
*/ | |||
public function __construct($key) | |||
{ | |||
parent::__construct(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waarom is deze weggehaald?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De parent heeft geen __construct() meer omdat ie geen dingen meer hoeft te initialiseren voor de instance.
@@ -559,7 +559,7 @@ public function addShipments(array $order_ids, bool $process): array | |||
} catch (Exception $ex) { | |||
$errorMessage = sprintf( | |||
__('error_export_order_id_failed_because', 'woocommerce-myparcel'), | |||
$order_id, __($ex->getMessage(), 'woocommerce-myparcel') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wordt dit nu niet en nooit niet vertaald? Anders kunnen we deze ook door die esc_html__
halen denk ik om de vertaalfunctie voor de message niet kwijt te raken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dit werd volgens mij nooit vertaald.
@@ -15,102 +15,6 @@ | |||
*/ | |||
class WCMP_Rest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waarom zijn al deze functionaliteiten hier uit gehaald?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Als je het curl gedeelte bedoelt: dat werd helemaal niet meer gebruikt, ten gunste van wp_remote_get en wp_remote_post, wat aanbevolen is.
esc_html($date), | ||
selected($date, $selected), | ||
$dateString | ||
esc_html($dateString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deze data zou volgens mij niet escaped hoeven worden
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Volgens mij ook niet, en dat geldt voor meer dingen, maar de WP waakhond wil dat wel echt.
@@ -1375,7 +1374,7 @@ private function getConfirmationData(DeliveryOptions $deliveryOptions): ?array | |||
]; | |||
|
|||
if (WCMYPA()->setting_collection->isEnabled(WCMYPA_Settings::SETTING_SHOW_DELIVERY_DAY)) { | |||
$confirmationData[__('Date:', 'woocommerce')] = wc_format_datetime(new WC_DateTime($deliveryOptions->getDate() ?? '')); | |||
$confirmationData[__('Date:', 'woocommerce-myparcel')] = wc_format_datetime(new WC_DateTime($deliveryOptions->getDate() ?? '')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Klopt het dat deze vertaling nu niet meer uit Wooc zelf gehaald wordt? En daardoor misschien nu ontbreekt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dat is correct en helaas. Aan de andere kant, op andermans vertaalbestanden dependen zonder dat expliciet te maken is ook niet zo netjes.
exit($e); | ||
} | ||
return; | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hier wordt ondersteuning voor Wooc < 2.7 gedropped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik zal inbouwen dat onze plugin minimaal versie 5.x moet hebben (dat is al zo vanwege een functie die de landen uitleest), dus de plugin werkte sowieso al niet met oudere versies, ook al declarede die dat niet netjes.
// Remove placeholder values (IE8 & 9) | ||
add_action('woocommerce_checkout_update_order_meta', [$this, 'remove_placeholders'], 10, 2); | ||
|
||
// Fix weird required field translations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waarom is dit verwijderd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deze translations zijn niet meer van toepassing, heb ik gecontroleerd, WooC doet dat nu netjes. IE ondersteunen we helemaal niet meer.
* @return string Normalized screen ID. | ||
* @since 4.6.0-dev | ||
*/ | ||
public static function normalize_wc_screen_id($slug = 'wc-settings') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moet dit niet worden opgelost met de version check uit het gerefereerde ticket in dit docblock (ipv helemaal weggehaald)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmtja, dit werkt ook gewoon, tegenwoordig.
@@ -139,21 +139,10 @@ public static function set_props($object, $props, $compat_props = []) | |||
*/ | |||
public static function set_address_prop(WC_Order $order, $prop, $address = 'billing', $value = null, $save = true) | |||
{ | |||
if (WC_Core::is_wc_version_gte_3_0()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hier wordt ook weer compatibiliteit verwijderd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes ik zal dit netjes doen.
INT-740