Skip to content

Instantly share code, notes, and snippets.

@lvivier
Created July 19, 2016 22:23
Show Gist options
  • Save lvivier/75cfd14886e331693c90b9a358063710 to your computer and use it in GitHub Desktop.
Save lvivier/75cfd14886e331693c90b9a358063710 to your computer and use it in GitHub Desktop.
Use RETS MD with a recent PHP (such as 5.6) with no warnings
commit 8dc0d08fb1979a6b6de39dbab514a0478cc7a844
Author: Luke Vivier <luke@vivier.ca>
Date: Tue Jul 19 15:20:50 2016 -0700
php 5.6 fixes
diff --git a/index.php b/index.php
index bd3fa0b..023be50 100644
--- a/index.php
+++ b/index.php
@@ -322,10 +322,10 @@ function code_peek() {
$field_list = $rets->SearchGetFields($search);
$rets->FreeResult($search);
-
+
$system_to_long = array();
$table_metadata = $rets->GetMetadataTable($_REQUEST['r_resource'], $_REQUEST['r_class']);
-
+
foreach ($table_metadata as $fi) {
$system_to_long["{$fi['SystemName']}"] = $fi['LongName'];
}
@@ -359,7 +359,7 @@ function code_peek() {
echo "</tr>\n";
echo "</table>\n";
-
+
$rets->Disconnect();
echo "
@@ -960,9 +960,10 @@ if (isset($_REQUEST['load']) && $_REQUEST['load'] == "demo") {
else {
$user_agent = "RETSMD/1.0";
$rets_version = "1.5";
- $username = $_REQUEST['username'];
- $password = $_REQUEST['password'];
- $login_url = $_REQUEST['login_url'];
+ $username = isset($_REQUEST['username']) ? $_REQUEST['username'] : null;
+ $password = isset($_REQUEST['password']) ? $_REQUEST['password'] : null;
+ $login_url = isset($_REQUEST['login_url']) ? $_REQUEST['login_url'] : null;
+ $ua_pwd = isset($_REQUEST['ua_pwd']) ? $_REQUEST['ua_pwd'] : null;
}
$possible_versions = array("1.0","1.5","1.7","1.7.2");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment