close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

"get_magic_quotes_gpc"

Thread began 10/10/2019 4:17 pm by Stan | Last modified 10/14/2019 10:15 am by Ray Borduin | 1838 views | 5 replies |

Stan

"get_magic_quotes_gpc"

As I continue to ready site for php7, I'm wondering what the best replacement is for "get_magic_quotes_gpc"

Sign in to reply to this post

Ray BorduinWebAssist

You shouldn't need that. It has been removed, so you shouldn't need to account for it. If you gave me an example in context then I could tell you more, but in general it just won't be necessary anymore. It will always be false, so wherever you used to have it, you could just hard code: false, if not delete it entirely.

Sign in to reply to this post
Did this help? Tips are appreciated...

Stan

Example where this is being used. I believe this is old power store code. It is scattered through the pages usually in less clear situations. I can get other examples if you'd like?

$colname1_rsBIBinventory = (get_magic_quotes_gpc()) ? $_POST['BPeCart6_1_SizeID_Add'] : addslashes($_POST['BPeCart6_1_SizeID_Add']);
$colname2_rsBIBinventory = (get_magic_quotes_gpc()) ? $_POST['BPeCart6_1_ColorID_Add'] : addslashes($_POST['BPeCart6_1_ColorID_Add']);
$colname3_rsBIBinventory = (get_magic_quotes_gpc()) ? $_POST['BPeCart6_1_Option1ID_Add'] : addslashes($_POST['BPeCart6_1_Option1ID_Add']);

Sign in to reply to this post

Ray BorduinWebAssist

These are lines of code associated with MySQL recordsets.... The code will be rewritten and the references to get_magic_quotes_gpc will be removed once they are updated ty MySQLi for php7.

Sign in to reply to this post
Did this help? Tips are appreciated...

Stan

Here is the previously updated recordset. My understanding is that the get_magic_quotes_gpc and "addslashes" were for security reasons. They are no longer necessary with mysqli? Can the complete line "$colname1_rsBIBinventory = ( get_magic_quotes_gpc() ) ? $_POST[ 'BPeCart6_1_SizeID_Add' ] : addslashes( $_POST[ 'BPeCart6_1_SizeID_Add' ] );" safely be deleted after the recordset uses mysqli?

$colname1_rsBIBinventory = ( get_magic_quotes_gpc() ) ? $_POST[ 'BPeCart6_1_SizeID_Add' ] : addslashes( $_POST[ 'BPeCart6_1_SizeID_Add' ] );
becomes:
$colname1_rsBIBinventory = $_POST[ 'BPeCart6_1_SizeID_Add' ] ;

For reference:
$query_rsBIBinventory = sprintf( "SELECT * FROM product_inventory WHERE ProductID = 23 and SizeID = %s and ColorID = %s and Option1 = %s", GetSQLValueString( $colname1_rsBIBinventory, "int" ), GetSQLValueString( $colname2_rsBIBinventory, "int" ), GetSQLValueString( $colname3_rsBIBinventory, "int" ) ); //make the query string
$rsBIBinventory = $conn_dbi->query( $query_rsBIBinventory );
$row_rsBIBinventory = $rsBIBinventory->fetch_assoc();

Sign in to reply to this post

Ray BorduinWebAssist

It will be removed when the recordset is updated to MySQLi and it will not be necessary since that protection is built in with the use of parameterized SQL statements.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...