Skip to content
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

Playground plugin: % signs lost during the import #246

Open
adamziel opened this issue Apr 18, 2024 · 5 comments
Open

Playground plugin: % signs lost during the import #246

adamziel opened this issue Apr 18, 2024 · 5 comments
Labels
Bug Something isn't working Playground plugin

Comments

@adamziel
Copy link
Collaborator

adamziel commented Apr 18, 2024

This is what my Sandbox Site looks like:

CleanShot 2024-04-18 at 14 12 08@2x

I poked around a bit and the % is missing from flex-basis: 60% here:

CleanShot 2024-04-18 at 14 10 54@2x

@adamziel adamziel added Bug Something isn't working Playground plugin labels Apr 18, 2024
@adamziel adamziel added this to the Zero Crashes – Tools milestone Apr 18, 2024
@adamziel
Copy link
Collaborator Author

It's missing from the .sql database export

@adamziel
Copy link
Collaborator Author

Escaping values using wpdb prepare does something weird:

(await playground.run({
    code: `<?php require '/wordpress/wp-load.php'; var_dump($wpdb->prepare("60%")); `
})).text;
'string(68) "60{af9a6abec7c9b260e27aa2ace1c5391a7c553540c6e87b6723050d04230d874a}"\n'

@adamziel
Copy link
Collaborator Author

It's coming from the $wpdb->prepare call here:

if (is_numeric($value)) {
$escaped[] = $wpdb->prepare('%d', $value);
} else {
$escaped[] = $wpdb->prepare('%s', $value);
}

@bgrgicak
Copy link
Collaborator

I think that we should drop these prepares. The data is coming from SQL and going into SQL, if there is no way to change the data, we should be fine without prepares.

@adamziel
Copy link
Collaborator Author

adamziel commented Apr 19, 2024

@bgrgicak we still need to escape the values, say my database field contains a single quote or ends with a backslash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Playground plugin
Projects
Status: No status
Development

No branches or pull requests

2 participants