Skip to content
This repository
  • 6 commits
  • 7 files changed
  • 0 comments
  • 1 contributor
6  osCommerce/OM/Core/Mail.php
... ...
@@ -1,8 +1,8 @@
1 1
 <?php
2 2
 /**
3 3
  * osCommerce Online Merchant
4  
- * 
5  
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
  4
+ *
  5
+ * @copyright Copyright (c) 2014 osCommerce; http://www.oscommerce.com
6 6
  * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
7 7
  */
8 8
 
@@ -22,7 +22,7 @@ class Mail {
22 22
         $_headers = array('X-Mailer' => 'osCommerce'),
23 23
         $_body,
24 24
         $_content_transfer_encoding = '7bit',
25  
-        $_charset = 'iso-8859-1';
  25
+        $_charset = 'utf-8';
26 26
 
27 27
     public function __construct($to = null, $to_email_address = null, $from = null, $from_email_address = null, $subject = null) {
28 28
       if ( !empty($to_email_address) ) {
6  osCommerce/OM/Core/OSCOM.php
@@ -266,7 +266,7 @@ public static function getLink($site = null, $application = null, $parameters =
266 266
         $link .= HTML::output($parameters) . '&';
267 267
       }
268 268
 
269  
-      if ( ($add_session_id === true) && Registry::exists('Session') && Registry::get('Session')->hasStarted() && (SERVICE_SESSION_FORCE_COOKIE_USAGE == '-1') ) {
  269
+      if ( ($add_session_id === true) && Registry::exists('Session') && Registry::get('Session')->hasStarted() && ((bool)ini_get('session.use_only_cookies') === false) ) {
270 270
         if ( strlen(SID) > 0 ) {
271 271
           $_sid = SID;
272 272
         } elseif ( ((static::getRequestType() == 'NONSSL') && ($connection == 'SSL') && (static::getConfig('enable_ssl', $site) == 'true')) || ((static::getRequestType() == 'SSL') && ($connection != 'SSL')) ) {
@@ -324,13 +324,13 @@ public static function getPublicSiteLink($url, $parameters = null, $site = null)
324 324
  * @param string $site The Site to link to. Default: The currently used Site.
325 325
  * @param string $application The Site Application to link to. Default: The currently used Site Application.
326 326
  * @param string $parameters Parameters to add to the link. Example: key1=value1&key2=value2
327  
- * @param string $connection The type of connection to use for the link. Values: NONSSL, SSL, AUTO. Default: NONSSL.
  327
+ * @param string $connection The type of connection to use for the link. Values: NONSSL, SSL, AUTO. Default: AUTO.
328 328
  * @param bool $add_session_id Add the session ID to the link. Default: True.
329 329
  * @param bool $search_engine_safe Use search engine safe URLs. Default: True.
330 330
  * @return string The URL address.
331 331
  */
332 332
 
333  
-    public static function getRPCLink($site = null, $application = null, $parameters = null, $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
  333
+    public static function getRPCLink($site = null, $application = null, $parameters = null, $connection = 'AUTO', $add_session_id = true, $search_engine_safe = true) {
334 334
       if ( empty($site) ) {
335 335
         $site = static::getSite();
336 336
       }
10  osCommerce/OM/Core/SessionAbstract.php
... ...
@@ -1,8 +1,8 @@
1 1
 <?php
2 2
 /**
3 3
  * osCommerce Online Merchant
4  
- * 
5  
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
  4
+ *
  5
+ * @copyright Copyright (c) 2014 osCommerce; http://www.oscommerce.com
6 6
  * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
7 7
  */
8 8
 
@@ -77,13 +77,13 @@ public function start() {
77 77
         $this->_life_time = ini_get('session.gc_maxlifetime');
78 78
       }
79 79
 
80  
-      session_set_cookie_params(0, ((OSCOM::getRequestType() == 'NONSSL') ? OSCOM::getConfig('http_cookie_path') : OSCOM::getConfig('https_cookie_path')), ((OSCOM::getRequestType() == 'NONSSL') ? OSCOM::getConfig('http_cookie_domain') : OSCOM::getConfig('https_cookie_domain')));
  80
+      session_set_cookie_params(0, ((OSCOM::getRequestType() == 'NONSSL') ? OSCOM::getConfig('http_cookie_path') : OSCOM::getConfig('https_cookie_path')), ((OSCOM::getRequestType() == 'NONSSL') ? OSCOM::getConfig('http_cookie_domain') : OSCOM::getConfig('https_cookie_domain')), (bool)ini_get('session.cookie_secure'), (bool)ini_get('session.cookie_httponly'));
81 81
 
82  
-      if ( isset($_GET[$this->_name]) && (empty($_GET[$this->_name]) || !ctype_alnum($_GET[$this->_name]) || !$this->exists($_GET[$this->_name])) ) {
  82
+      if ( isset($_GET[$this->_name]) && ((bool)ini_get('session.use_only_cookies') || empty($_GET[$this->_name]) || !ctype_alnum($_GET[$this->_name]) || !$this->exists($_GET[$this->_name])) ) {
83 83
         unset($_GET[$this->_name]);
84 84
       }
85 85
 
86  
-      if ( isset($_POST[$this->_name]) && (empty($_POST[$this->_name]) || !ctype_alnum($_POST[$this->_name]) || !$this->exists($_POST[$this->_name])) ) {
  86
+      if ( isset($_POST[$this->_name]) && ((bool)ini_get('session.use_only_cookies') || empty($_POST[$this->_name]) || !ctype_alnum($_POST[$this->_name]) || !$this->exists($_POST[$this->_name])) ) {
87 87
         unset($_POST[$this->_name]);
88 88
       }
89 89
 
10  osCommerce/OM/Core/Site/Admin/Template.php
... ...
@@ -1,8 +1,8 @@
1 1
 <?php
2 2
 /**
3 3
  * osCommerce Online Merchant
4  
- * 
5  
- * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
  4
+ *
  5
+ * @copyright Copyright (c) 2014 osCommerce; http://www.oscommerce.com
6 6
  * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
7 7
  */
8 8
 
@@ -95,8 +95,10 @@ public function getTemplateFile($file = null, $template = null) {
95 95
       return false;
96 96
     }
97 97
 
98  
-    public function getPageContentsFile() {
99  
-      $file = $this->getPageContentsFilename();
  98
+    public function getPageContentsFile($file = null) {
  99
+      if ( !isset($file) ) {
  100
+        $file = $this->getPageContentsFilename();
  101
+      }
100 102
 
101 103
       $template = $this->_template;
102 104
 
14  osCommerce/OM/Core/Site/Shop/Module/Service/Session.php
... ...
@@ -1,15 +1,15 @@
1 1
 <?php
2 2
 /**
3 3
  * osCommerce Online Merchant
4  
- * 
5  
- * @copyright Copyright (c) 2011 osCommerce; http://www.oscommerce.com
  4
+ *
  5
+ * @copyright Copyright (c) 2014 osCommerce; http://www.oscommerce.com
6 6
  * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
7 7
  */
8 8
 
9 9
   namespace osCommerce\OM\Core\Site\Shop\Module\Service;
10 10
 
11  
-  use osCommerce\OM\Core\Registry;
12 11
   use osCommerce\OM\Core\OSCOM;
  12
+  use osCommerce\OM\Core\Registry;
13 13
   use osCommerce\OM\Core\Session as SessionClass;
14 14
 
15 15
   class Session implements \osCommerce\OM\Core\Site\Shop\ServiceInterface {
@@ -19,7 +19,13 @@ public static function start() {
19 19
       $OSCOM_Session = Registry::get('Session');
20 20
       $OSCOM_Session->setLifeTime(SERVICE_SESSION_EXPIRATION_TIME * 60);
21 21
 
22  
-      if ( (SERVICE_SESSION_FORCE_COOKIE_USAGE == '1') || ((bool)ini_get('session.use_only_cookies') === true) ) {
  22
+      if ( SERVICE_SESSION_FORCE_COOKIE_USAGE == '1' ) {
  23
+        ini_set('session.use_only_cookies', 1);
  24
+      } else{
  25
+        ini_set('session.use_only_cookies', 0);
  26
+      }
  27
+
  28
+      if ( (bool)ini_get('session.use_only_cookies') ) {
23 29
         OSCOM::setCookie('cookie_test', 'please_accept_for_session', time()+60*60*24*90);
24 30
 
25 31
         if ( isset($_COOKIE['cookie_test']) ) {
19  osCommerce/OM/Core/Template/Tag/iftrue.php
... ...
@@ -1,8 +1,8 @@
1 1
 <?php
2 2
 /**
3 3
  * osCommerce Online Merchant
4  
- * 
5  
- * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
  4
+ *
  5
+ * @copyright Copyright (c) 2014 osCommerce; http://www.oscommerce.com
6 6
  * @license BSD License; http://www.oscommerce.com/bsdlicense.txt
7 7
  */
8 8
 
@@ -21,8 +21,6 @@ static public function execute($string) {
21 21
 
22 22
       $key = trim($args[1]);
23 23
 
24  
-      $result = '';
25  
-
26 24
       if ( !$OSCOM_Template->valueExists($key) ) {
27 25
         if ( class_exists('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Module\\Template\\Value\\' . $key . '\\Controller') && is_subclass_of('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Module\\Template\\Value\\' . $key . '\\Controller', 'osCommerce\\OM\\Core\\Template\\ValueAbstract') ) {
28 26
           call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Module\\Template\\Value\\' . $key . '\\Controller', 'initialize'));
@@ -31,7 +29,18 @@ static public function execute($string) {
31 29
         }
32 30
       }
33 31
 
34  
-      if ( $OSCOM_Template->getValue(trim($args[1])) === true ) {
  32
+      $is_true = $OSCOM_Template->valueExists($key) && ($OSCOM_Template->getValue($key) === true);
  33
+      $has_else = strpos($string, '{else}');
  34
+
  35
+      $result = '';
  36
+
  37
+      if ( $has_else !== false ) {
  38
+        if ( $is_true === true ) {
  39
+          $result = substr($string, 0, $has_else);
  40
+        } else {
  41
+          $result = substr($string, $has_else + 6); // strlen('{else}')==6
  42
+        }
  43
+      } elseif ( $is_true === true ) {
35 44
         $result = $string;
36 45
       }
37 46
 
30  osCommerce/OM/Core/Template/Tag/link.php
... ...
@@ -1,20 +1,18 @@
@@ -24,7 +22,27 @@ static public function execute($string) {

No commit comments for this range

Something went wrong with that request. Please try again.