WPAds WordPress plugin adds slashes in wp-admin? New version here!
1 Attachment(s)
I've been using the WPAds WordPress plugin for several years now, both for banner ad rotation, as well as simply rotating images and content easily on the site. It's an excellent tool for randomizing the design!
The Problem Anyway, the plugin was built to use PHP "magic quotes". This means that the php.ini must have "magic_quotes_gpc = on" However, in more recent years, this was determined to be unsafe, and is in fact be deprecated (obsoleted and removed) from future versions of PHP 5.x and PHP 6. Shared hosts will undoubtedly have magic_quotes turned off, and VPS/dedicated users are strongly urged to repair their PHP code to not use it, in order to have the best server/website security. When magic_quotes is turned off, the wp-admin Settings controls for WPAds will not work correctly -- you'll have forward-slashes injected into your script. So if you try to add or edit existing WPAds entries, when magic_quotes is off, you'll get errors. For example: Here's the proper code used in the "ad" spot (for randomizing the header image): PHP Code:
PHP Code:
And here's what that generates to the browser: PHP Code:
PHP Code:
The Solution The solution is to simply remove the magic_quotes PHP -- or as I prefer to do, simply comment out the old code (in case, for whatever reason, you need to know what the old code was). ... or just download the new version I've attached to this post. If you want to edit your own code, simply change this: PHP Code:
PHP Code:
Change both instances. And that's it. The New Version for Download You'll find the attached file download at the bottom of this top post. To get access to download the files, simply join the forum as a Free Member (it's free!) and that's it. You'll be able to download. We provide files like this for the convenience and support of our members, including both Free and Premium Members. We don't send spam or sell your e-mail addresses. If you're not sure what to do with the attached ZIP or RAR files, then read this help post. Although, as a WordPress user who's likely downloaded/installed quite a bit of code (themes + plugins), I'm hoping you know what a RAR file is! |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.