5wes13
Forum Replies Created
-
Forum: Plugins
In reply to: [Stock Manager for WooCommerce] woocommerce stock managerI also get this error when I scroll down and products try loading on the woocommerce stock manager page.
Forum: Plugins
In reply to: [User Login History] PHP7Hey Faiyazalam
I had the same issue so thank you for posting this solution. Please can you include this minor change in your files for download.
Thanks,
WesleyForum: Plugins
In reply to: [Stray Random Quotes] Can’t edit and new quotes are emptyHi Idearius are you bale to see my post with the code? It’s not showing up on my side but says it’s posted.
—-
NVM- This reply was modified 8 years ago by 5wes13.
Forum: Plugins
In reply to: [Stray Random Quotes] Can’t edit and new quotes are emptyHi Idearius
You will need to read up on prepared statements, but here is an example using the code in the stray_manage.php file in the plugin:
This is a sample code as it stands:
//update the quote $sql = "UPDATE " . WP_STRAY_QUOTES_TABLE . " SET quote='" . mysqli_real_escape_string($quote) . "', author='" . mysqli_real_escape_string($author) . "', source='" . mysqli_real_escape_string($source) . "', category='" . mysqli_real_escape_string($category) . "', visible='" . mysqli_real_escape_string($visible) . "', user='" . mysqli_real_escape_string($current_user->user_nicename) . "' WHERE quoteID='" . mysqli_real_escape_string($quoteID) . "'"; $wpdb->get_results($sql);
And this is the same query using prepared statements (I have changed the layout a bit):
//update the quote $sql = "UPDATE " . WP_STRAY_QUOTES_TABLE . " SET quote= %s, author=%s, source=%s, category=%s, visible=%s, user=%s WHERE quoteID=%s" ; $wpdb->get_results( $wpdb->prepare( $sql, $quote, $author, $source, $category, $visible, $current_user->user_nicename, $quoteID ) );
Change all queries where mysql_real_escape_string is used in stray_manage.php and stray_new.php.
Let me know if you have any further questions.
Forum: Plugins
In reply to: [Stray Random Quotes] Can’t edit and new quotes are emptyHey Guys, I was having a similar problem and found that my version of Stray Quotes (1.9.9) was still using mysql_real_escape_string which has been removed as of PHP 7.0.0. I have converted the queries to prepared statements and now I am able to edit quotes. I still need to to update the add new scripts, but I assume it will be the same issue. I hope this helps.
Forum: Fixing WordPress
In reply to: Media Upload not working (http error)Thanks asirota, I had the same issue and GD fixed it too. Much appreciated!