Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,5 @@ pip-log.txt

# Mac crap
.DS_Store

*.code-workspace
2 changes: 1 addition & 1 deletion QuickBooks/Cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static public function cast($type_or_action, $field, $value, $use_abbrevs = true
$dh = opendir(dirname(__FILE__) . '/QBXML/Schema/Object');
while (false !== ($file = readdir($dh)))
{
if ($file{0} == '.' or substr($file, -6, 6) != 'Rq.php')
if ($file[0] == '.' or substr($file, -6, 6) != 'Rq.php')
{
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion QuickBooks/Driver/Sql/Mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ protected function _escape($str)
$str = '';
}

return $this->_conn->real_escape_string($str);
return $this->_conn->real_escape_string(isset($str) ? $str : '');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion QuickBooks/MerchantService/CheckingAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct($routing, $account, $info, $type, $first_name, $last

$phone = trim(str_replace(array('(', ')', '+', ' ', '.', '-'), '', $phone));
if (strlen($phone) == 11 and
$phone{0} == '1')
$phone[0] == '1')
{
$phone = substr($phone, 1);
}
Expand Down
3 changes: 2 additions & 1 deletion QuickBooks/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ static public function mask($message)
{
// It's an XML tag
$contents = QuickBooks_Utilities::_extractTagContents(trim($key, '<> '), $message);


$contents = isset($contents) ? $contents : '';
$masked = str_repeat('x', min(strlen($contents), 12)) . substr($contents, 12);

$message = str_replace($key . $contents . '</' . trim($key, '<> ') . '>', $key . $masked . '</' . trim($key, '<> ') . '>', $message);
Expand Down
2 changes: 1 addition & 1 deletion QuickBooks/WebConnector/Handlers.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ public function authenticate($obj)
$customauth_wait_before_next_update = null;
$customauth_min_run_every_n_seconds = null;

if (is_array($override_dsn) or strlen($override_dsn)) // Custom autj
if (is_array($override_dsn) or strlen(isset($override_dsn) ? $override_dsn : '')) // Custom autj
{
//if ($auth->authenticate($obj->strUserName, $obj->strPassword, $customauth_company_file, $customauth_wait_before_next_update, $customauth_min_run_every_n_seconds) and

Expand Down
4 changes: 2 additions & 2 deletions QuickBooks/XML.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ static public function decode($str, $for_qbxml = true)
'&quot;' => '"',
'&amp;' => '&', // Make sure that this is *the last* transformation to run, otherwise we end up double-un-encoding things
);

return str_replace(array_keys($transform), array_values($transform), $str);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the last change. Please remove this trailing space.

return str_replace(array_keys($transform), array_values($transform), isset($str) ? $str : '');
}
}

2 changes: 1 addition & 1 deletion QuickBooks/XML/Backend/Builtin.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ protected function _parseHelper($xml, &$Root, &$errnum, &$errmsg, $indent = 0)
$Node->addAttribute($key, $value);
}

if (false !== strpos($payload, '<'))
if (false !== strpos(isset($payload) ? $payload : '', '<'))
{
// The tag contains child tags

Expand Down