From a67169c5fedc8cbdfc7a8a83481ed4a7538dc51c Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Wed, 8 Apr 2015 17:35:40 -0400 Subject: [PATCH 1/3] I solved Cryptographic Issues in Thirdparty --- gulliver/thirdparty/creole/Creole.php | 11 ++++++- gulliver/thirdparty/geshi/geshi.php | 11 ++++++- .../html2ps_pdf/box.checkbutton.php | 11 ++++++- .../html2ps_pdf/box.radiobutton.php | 11 ++++++- .../html2ps_pdf/css.cache.class.php | 11 ++++++- .../thirdparty/html2ps_pdf/image.class.php | 11 ++++++- gulliver/thirdparty/pear/Log/console.php | 11 ++++++- gulliver/thirdparty/pear/Log/daemon.php | 11 ++++++- gulliver/thirdparty/pear/Log/display.php | 11 ++++++- gulliver/thirdparty/pear/Log/error_log.php | 11 ++++++- gulliver/thirdparty/pear/Log/file.php | 11 ++++++- gulliver/thirdparty/pear/Log/firebug.php | 11 ++++++- gulliver/thirdparty/pear/Log/mail.php | 11 ++++++- gulliver/thirdparty/pear/Log/mcal.php | 11 ++++++- gulliver/thirdparty/pear/Log/mdb2.php | 11 ++++++- gulliver/thirdparty/pear/Log/null.php | 11 ++++++- gulliver/thirdparty/pear/Net/DIME.php | 22 +++++++++++-- .../pear/Net/UserAgent/Detect/APC.php | 11 ++++++- gulliver/thirdparty/pear/PEAR/Installer.php | 22 +++++++++++-- gulliver/thirdparty/pear/class.wsdlcache.php | 26 ++++++++++++--- .../thirdparty/phpmailer/class.phpmailer.php | 33 +++++++++++++++++-- gulliver/thirdparty/propel/om/BaseObject.php | 13 ++++++-- gulliver/thirdparty/propel/util/Criteria.php | 17 +++++++--- gulliver/thirdparty/tcpdf/2dbarcodes.php | 11 ++++++- 24 files changed, 296 insertions(+), 35 deletions(-) diff --git a/gulliver/thirdparty/creole/Creole.php b/gulliver/thirdparty/creole/Creole.php index 175878527..7d6185ce1 100755 --- a/gulliver/thirdparty/creole/Creole.php +++ b/gulliver/thirdparty/creole/Creole.php @@ -189,10 +189,19 @@ class Creole { trigger_error("The Creole::NO_ASSOC_LOWER flag has been deprecated, and is now the default behavior. Use Creole::COMPAT_ASSOC_LOWER to lowercase resulset keys.", E_USER_WARNING); } + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // sort $dsninfo by keys so the serialized result is always the same // for identical connection parameters, no matter what their order is ksort($dsninfo); - $connectionMapKey = crc32(serialize($dsninfo + array('compat_flags' => ($flags & Creole::COMPAT_ALL)))); + $connectionMapKey = G::encryptCrc32(serialize($dsninfo + array('compat_flags' => ($flags & Creole::COMPAT_ALL)))); // see if we already have a connection with these parameters cached if(isset(self::$connectionMap[$connectionMapKey]) && $dsninfo['phptype'] !== 'dbarray') diff --git a/gulliver/thirdparty/geshi/geshi.php b/gulliver/thirdparty/geshi/geshi.php index 31d2da49f..a97b012ec 100755 --- a/gulliver/thirdparty/geshi/geshi.php +++ b/gulliver/thirdparty/geshi/geshi.php @@ -3738,10 +3738,19 @@ class GeSHi { /** NOTE: memorypeak #1 */ $parsed_code = preg_replace('#]+>(\s*)#', '\\1', $parsed_code); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // If we are using IDs for line numbers, there needs to be an overall // ID set to prevent collisions. if ($this->add_ids && !$this->overall_id) { - $this->overall_id = 'geshi-' . substr(md5(microtime()), 0, 4); + $this->overall_id = 'geshi-' . substr(G::encryptOld(microtime()), 0, 4); } // Get code into lines diff --git a/gulliver/thirdparty/html2ps_pdf/box.checkbutton.php b/gulliver/thirdparty/html2ps_pdf/box.checkbutton.php index f38028a91..4e358d4d3 100755 --- a/gulliver/thirdparty/html2ps_pdf/box.checkbutton.php +++ b/gulliver/thirdparty/html2ps_pdf/box.checkbutton.php @@ -57,11 +57,20 @@ class CheckBox extends GenericFormattedBox { * @see CheckBox::CheckBox() */ function &create(&$root, &$pipeline) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $value = $root->get_attribute('value'); if (trim($value) == "") { error_log("Checkbox with empty 'value' attribute"); - $value = sprintf("___Value%s",md5(time().rand())); + $value = sprintf("___Value%s",G::encryptOld(time().rand())); }; $box =& new CheckBox($root->has_attribute('checked'), diff --git a/gulliver/thirdparty/html2ps_pdf/box.radiobutton.php b/gulliver/thirdparty/html2ps_pdf/box.radiobutton.php index 026a39d26..6e8cccdf8 100755 --- a/gulliver/thirdparty/html2ps_pdf/box.radiobutton.php +++ b/gulliver/thirdparty/html2ps_pdf/box.radiobutton.php @@ -19,12 +19,21 @@ class RadioBox extends SimpleInlineBox { var $_value; function &create(&$root, &$pipeline) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $checked = $root->has_attribute('checked'); $value = $root->get_attribute('value'); if (trim($value) == "") { error_log("Radiobutton with empty 'value' attribute"); - $value = sprintf("___Value%s",md5(time().rand())); + $value = sprintf("___Value%s",G::encryptOld(time().rand())); }; $css_state = $pipeline->getCurrentCSSState(); diff --git a/gulliver/thirdparty/html2ps_pdf/css.cache.class.php b/gulliver/thirdparty/html2ps_pdf/css.cache.class.php index 7152b3869..d9fe80a1d 100755 --- a/gulliver/thirdparty/html2ps_pdf/css.cache.class.php +++ b/gulliver/thirdparty/html2ps_pdf/css.cache.class.php @@ -15,7 +15,16 @@ class CSSCache { } function _getCacheFilename($url) { - return CACHE_DIR.md5($url).'.css.compiled'; + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return CACHE_DIR.G::encryptOld($url).'.css.compiled'; } function _isCached($url) { diff --git a/gulliver/thirdparty/html2ps_pdf/image.class.php b/gulliver/thirdparty/html2ps_pdf/image.class.php index 91949db79..78e8b572c 100755 --- a/gulliver/thirdparty/html2ps_pdf/image.class.php +++ b/gulliver/thirdparty/html2ps_pdf/image.class.php @@ -80,7 +80,16 @@ class Image { // allowed file name length (especially after escaping specialy symbols) // thus, we generate long almost random 32-character name using the md5 hash function // - return CACHE_DIR.md5(time() + $url + rand()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return CACHE_DIR.G::encryptOld(time() + $url + rand()); } // Checks if cache directory is available diff --git a/gulliver/thirdparty/pear/Log/console.php b/gulliver/thirdparty/pear/Log/console.php index 0c1f9b685..a52c15a57 100755 --- a/gulliver/thirdparty/pear/Log/console.php +++ b/gulliver/thirdparty/pear/Log/console.php @@ -67,7 +67,16 @@ class Log_console extends Log function Log_console($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/daemon.php b/gulliver/thirdparty/pear/Log/daemon.php index 9873f2a40..07ca7a832 100755 --- a/gulliver/thirdparty/pear/Log/daemon.php +++ b/gulliver/thirdparty/pear/Log/daemon.php @@ -74,7 +74,16 @@ class Log_daemon extends Log $name = LOG_SYSLOG; } - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_name = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/display.php b/gulliver/thirdparty/pear/Log/display.php index da8291a27..fb3667e09 100755 --- a/gulliver/thirdparty/pear/Log/display.php +++ b/gulliver/thirdparty/pear/Log/display.php @@ -54,7 +54,16 @@ class Log_display extends Log function Log_display($name = '', $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/error_log.php b/gulliver/thirdparty/pear/Log/error_log.php index 117e96c48..412f4cac9 100755 --- a/gulliver/thirdparty/pear/Log/error_log.php +++ b/gulliver/thirdparty/pear/Log/error_log.php @@ -52,7 +52,16 @@ class Log_error_log extends Log function Log_error_log($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_type = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/file.php b/gulliver/thirdparty/pear/Log/file.php index d0d03eeeb..fa352bcb0 100755 --- a/gulliver/thirdparty/pear/Log/file.php +++ b/gulliver/thirdparty/pear/Log/file.php @@ -98,7 +98,16 @@ class Log_file extends Log function Log_file($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_filename = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/firebug.php b/gulliver/thirdparty/pear/Log/firebug.php index 9f013f684..1dea4a7f5 100755 --- a/gulliver/thirdparty/pear/Log/firebug.php +++ b/gulliver/thirdparty/pear/Log/firebug.php @@ -81,7 +81,16 @@ class Log_firebug extends Log function Log_firebug($name = '', $ident = 'PHP', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); if (isset($conf['buffering'])) { diff --git a/gulliver/thirdparty/pear/Log/mail.php b/gulliver/thirdparty/pear/Log/mail.php index d4eea6c67..51538ae52 100755 --- a/gulliver/thirdparty/pear/Log/mail.php +++ b/gulliver/thirdparty/pear/Log/mail.php @@ -103,7 +103,16 @@ class Log_mail extends Log function Log_mail($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_recipients = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/mcal.php b/gulliver/thirdparty/pear/Log/mcal.php index ab88d457e..f2832cf48 100755 --- a/gulliver/thirdparty/pear/Log/mcal.php +++ b/gulliver/thirdparty/pear/Log/mcal.php @@ -74,7 +74,16 @@ class Log_mcal extends Log function Log_mcal($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_name = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/mdb2.php b/gulliver/thirdparty/pear/Log/mdb2.php index cc06787a3..34d35676b 100755 --- a/gulliver/thirdparty/pear/Log/mdb2.php +++ b/gulliver/thirdparty/pear/Log/mdb2.php @@ -115,7 +115,16 @@ class Log_mdb2 extends Log function Log_mdb2($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_table = $name; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/null.php b/gulliver/thirdparty/pear/Log/null.php index 58cb9b43f..20a510566 100755 --- a/gulliver/thirdparty/pear/Log/null.php +++ b/gulliver/thirdparty/pear/Log/null.php @@ -30,7 +30,16 @@ class Log_null extends Log function Log_null($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); } diff --git a/gulliver/thirdparty/pear/Net/DIME.php b/gulliver/thirdparty/pear/Net/DIME.php index 6c54208ea..1eaf321b8 100755 --- a/gulliver/thirdparty/pear/Net/DIME.php +++ b/gulliver/thirdparty/pear/Net/DIME.php @@ -167,7 +167,16 @@ class Net_DIME_Record extends PEAR function generateID() { - $id = md5(time()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $id = G::encryptOld(time()); $this->setID($id); return $id; } @@ -373,6 +382,15 @@ class Net_DIME_Message extends PEAR function startChunk(&$data, $typestr='', $id=NULL, $type=NET_DIME_TYPE_UNKNOWN) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $this->me = 0; $this->cf = 1; $this->type = $type; @@ -380,7 +398,7 @@ class Net_DIME_Message extends PEAR if ($id) { $this->id = $id; } else { - $this->id = md5(time()); + $this->id = G::encryptOld(time()); } return $this->_makeRecord($data, $this->typestr, $this->id, $this->type); } diff --git a/gulliver/thirdparty/pear/Net/UserAgent/Detect/APC.php b/gulliver/thirdparty/pear/Net/UserAgent/Detect/APC.php index 467907217..7c8a23537 100755 --- a/gulliver/thirdparty/pear/Net/UserAgent/Detect/APC.php +++ b/gulliver/thirdparty/pear/Net/UserAgent/Detect/APC.php @@ -29,6 +29,15 @@ class Net_UserAgent_Detect_APC extends Net_UserAgent_Detect $restored = false; $ua_cache_timeout = apc_fetch('useragent:cache_timeout'); // don't cache after time period + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } if ($ua_cache_window > 0) { if (!$ua_cache_timeout) { // check apc uptime and disable after x mins @@ -49,7 +58,7 @@ class Net_UserAgent_Detect_APC extends Net_UserAgent_Detect if ($in_detect !== null) { $key_flags = implode('-', $in_detect); } - $this->key = 'useragent:'.md5($in_userAgent.$key_flags); + $this->key = 'useragent:'.G::encryptOld($in_userAgent.$key_flags); } if ($data = apc_fetch($this->key)) { diff --git a/gulliver/thirdparty/pear/PEAR/Installer.php b/gulliver/thirdparty/pear/PEAR/Installer.php index 6ef191c98..9c8e15c95 100755 --- a/gulliver/thirdparty/pear/PEAR/Installer.php +++ b/gulliver/thirdparty/pear/PEAR/Installer.php @@ -232,8 +232,17 @@ class PEAR_Installer extends PEAR_Common $fp = fopen($orig_file, "r"); $contents = fread($fp, filesize($orig_file)); fclose($fp); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } if (isset($atts['md5sum'])) { - $md5sum = md5($contents); + $md5sum = G::encryptOld($contents); } $subst_from = $subst_to = array(); foreach ($atts['replacements'] as $a) { @@ -863,11 +872,20 @@ class PEAR_Installer extends PEAR_Common if (!function_exists("md5_file")) { function md5_file($filename) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $fp = fopen($filename, "r"); if (!$fp) return null; $contents = fread($fp, filesize($filename)); fclose($fp); - return md5($contents); + return G::encryptOld($contents); } } diff --git a/gulliver/thirdparty/pear/class.wsdlcache.php b/gulliver/thirdparty/pear/class.wsdlcache.php index 4258ea112..048a8a4f3 100755 --- a/gulliver/thirdparty/pear/class.wsdlcache.php +++ b/gulliver/thirdparty/pear/class.wsdlcache.php @@ -53,7 +53,16 @@ class wsdlcache { * @access private */ function createFilename($wsdl) { - return $this->cache_dir.'/wsdlcache-' . md5($wsdl); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return $this->cache_dir.'/wsdlcache-' . G::encryptOld($wsdl); } /** @@ -112,15 +121,24 @@ class wsdlcache { * @access private */ function obtainMutex($filename, $mode) { - if (isset($this->fplock[md5($filename)])) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + if (isset($this->fplock[G::encryptOld($filename)])) { $this->debug("Lock for $filename already exists"); return false; } $this->fplock[md5($filename)] = fopen($filename.".lock", "w"); if ($mode == "r") { - return flock($this->fplock[md5($filename)], LOCK_SH); + return flock($this->fplock[G::encryptOld($filename)], LOCK_SH); } else { - return flock($this->fplock[md5($filename)], LOCK_EX); + return flock($this->fplock[G::encryptOld($filename)], LOCK_EX); } } diff --git a/gulliver/thirdparty/phpmailer/class.phpmailer.php b/gulliver/thirdparty/phpmailer/class.phpmailer.php index 1002df591..830cd592d 100755 --- a/gulliver/thirdparty/phpmailer/class.phpmailer.php +++ b/gulliver/thirdparty/phpmailer/class.phpmailer.php @@ -1360,8 +1360,17 @@ class PHPMailer { public function CreateHeader() { $result = ''; + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // Set the boundaries - $uniq_id = md5(uniqid(time())); + $uniq_id = G::encryptOld(uniqid(time())); $this->boundary[1] = 'b1_' . $uniq_id; $this->boundary[2] = 'b2_' . $uniq_id; $this->boundary[3] = 'b3_' . $uniq_id; @@ -1777,6 +1786,15 @@ class PHPMailer { $mime = array(); $cidUniq = array(); $incl = array(); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // Add all attachments foreach ($this->attachment as $attachment) { @@ -1792,7 +1810,7 @@ class PHPMailer { $path = $attachment[0]; } - $inclhash = md5(serialize($attachment)); + $inclhash = G::encryptOld(serialize($attachment)); if (in_array($inclhash, $incl)) { continue; } $incl[] = $inclhash; $filename = $attachment[1]; @@ -2486,6 +2504,15 @@ class PHPMailer { */ public function MsgHTML($message, $basedir = '') { preg_match_all("/(src|background)=[\"'](.*)[\"']/Ui", $message, $images); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } if(isset($images[2])) { foreach($images[2] as $i => $url) { // do not change urls for absolute images (thanks to corvuscorax) @@ -2495,7 +2522,7 @@ class PHPMailer { if ($directory == '.') { $directory = ''; } - $cid = 'cid:' . md5($url); + $cid = 'cid:' . G::encryptOld($url); $ext = pathinfo($filename, PATHINFO_EXTENSION); $mimeType = self::_mime_types($ext); if ( strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; } diff --git a/gulliver/thirdparty/propel/om/BaseObject.php b/gulliver/thirdparty/propel/om/BaseObject.php index 8ef9942e7..df12154c0 100755 --- a/gulliver/thirdparty/propel/om/BaseObject.php +++ b/gulliver/thirdparty/propel/om/BaseObject.php @@ -165,11 +165,20 @@ abstract class BaseObject { */ public function hashCode() { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $ok = $this->getPrimaryKey(); if ($ok === null) { - return crc32(serialize($this)); + return G::encryptCrc32(serialize($this)); } - return crc32(serialize($ok)); // serialize because it could be an array ("ComboKey") + return G::encryptCrc32(serialize($ok)); // serialize because it could be an array ("ComboKey") } /** diff --git a/gulliver/thirdparty/propel/util/Criteria.php b/gulliver/thirdparty/propel/util/Criteria.php index 802122207..f22653e4e 100755 --- a/gulliver/thirdparty/propel/util/Criteria.php +++ b/gulliver/thirdparty/propel/util/Criteria.php @@ -1669,14 +1669,23 @@ class Criterion { */ public function hashCode() { - $h = crc32(serialize($this->value)) ^ crc32($this->comparison); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $h = G::encryptCrc3(serialize($this->value)) ^ G::encryptCrc3($this->comparison); if ($this->table !== null) { - $h ^= crc32($this->table); + $h ^= G::encryptCrc3($this->table); } if ($this->column !== null) { - $h ^= crc32($this->column); + $h ^= G::encryptCrc3($this->column); } foreach ( $this->clauses as $clause ) { @@ -1687,7 +1696,7 @@ class Criterion { $sb = ''; $params = array(); $clause->appendPsTo($sb,$params); - $h ^= crc32(serialize(array($sb,$params))); + $h ^= G::encryptCrc3(serialize(array($sb,$params))); unset ( $sb, $params ); } diff --git a/gulliver/thirdparty/tcpdf/2dbarcodes.php b/gulliver/thirdparty/tcpdf/2dbarcodes.php index 6490dfa7e..b4cc36744 100644 --- a/gulliver/thirdparty/tcpdf/2dbarcodes.php +++ b/gulliver/thirdparty/tcpdf/2dbarcodes.php @@ -85,6 +85,15 @@ class TCPDF2DBarcode { * @public */ public function getBarcodeSVG($w=3, $h=3, $color='black') { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // send headers $code = $this->getBarcodeSVGcode($w, $h, $color); header('Content-Type: application/svg+xml'); @@ -92,7 +101,7 @@ class TCPDF2DBarcode { header('Pragma: public'); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - header('Content-Disposition: inline; filename="'.md5($code).'.svg";'); + header('Content-Disposition: inline; filename="'.G::encryptOld($code).'.svg";'); //header('Content-Length: '.strlen($code)); echo $code; } From f3a5b57d1ee24aa84420359cf57123aa9c2525a4 Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Thu, 9 Apr 2015 11:43:24 -0400 Subject: [PATCH 2/3] I corrected --- gulliver/thirdparty/propel/util/Criteria.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gulliver/thirdparty/propel/util/Criteria.php b/gulliver/thirdparty/propel/util/Criteria.php index f22653e4e..bef1199b8 100755 --- a/gulliver/thirdparty/propel/util/Criteria.php +++ b/gulliver/thirdparty/propel/util/Criteria.php @@ -1678,14 +1678,14 @@ class Criterion { $pathTrunk = implode( '/', $docuroot ) . '/'; require_once($pathTrunk.'gulliver/system/class.g.php'); } - $h = G::encryptCrc3(serialize($this->value)) ^ G::encryptCrc3($this->comparison); + $h = G::encryptCrc32(serialize($this->value)) ^ G::encryptCrc32($this->comparison); if ($this->table !== null) { - $h ^= G::encryptCrc3($this->table); + $h ^= G::encryptCrc32($this->table); } if ($this->column !== null) { - $h ^= G::encryptCrc3($this->column); + $h ^= G::encryptCrc32($this->column); } foreach ( $this->clauses as $clause ) { From 486b94ae00708c99661b2b5aa6201ce75178c37e Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Thu, 9 Apr 2015 12:41:34 -0400 Subject: [PATCH 3/3] I corrected --- gulliver/thirdparty/propel/util/Criteria.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulliver/thirdparty/propel/util/Criteria.php b/gulliver/thirdparty/propel/util/Criteria.php index bef1199b8..0eeb54262 100755 --- a/gulliver/thirdparty/propel/util/Criteria.php +++ b/gulliver/thirdparty/propel/util/Criteria.php @@ -1696,7 +1696,7 @@ class Criterion { $sb = ''; $params = array(); $clause->appendPsTo($sb,$params); - $h ^= G::encryptCrc3(serialize(array($sb,$params))); + $h ^= G::encryptCrc32(serialize(array($sb,$params))); unset ( $sb, $params ); }