Jump to content

xavibj

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • First Name
    Xavi
  • Last Name
    Bolivar

Recent Profile Visitors

37 profile views

xavibj's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. I'm using PHP 7 php -v PHP 7.0.15-0ubuntu0.16.04.2 (cli) ( NTS ) Copyright © 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright © 1998-2017 Zend Technologies with Zend OPcache v7.0.15-0ubuntu0.16.04.2, Copyright © 1999-2017, by Zend Technologies
  2. Hi, I put these 2 includes since PS 1.6.0.x with no problem. Please see what happens in a fresh install with 1.6.1.11 (NO SSL) without init.php I get a Fatal error when I try to retreive the product price. <?php include_once('/home/limpio/config/config.inc.php'); include_once('/home/limpio/init.php'); echo "Hi"; $p = new Product(1); echo $p->getPrice(); ?> root:~#php test2.php Hi19.9771 root:~# Same script without init.php <?php include_once('/home/limpio/config/config.inc.php'); //include_once('/home/limpio/init.php'); echo "Hi"; $p = new Product(1); echo $p->getPrice(); ?> root:~# php test2.php HiFatal error root:~#
  3. No, a simple script like this also fails, if SSL is enabled for all pages <?php include_once('/var/ean/config/config.inc.php'); include_once('/var/ean/init.php'); echo "hola" ?> So I changed the condition in line 788 in classes/controller/FrontController.php if (Configuration::get('PS_SSL_ENABLED') && $_SERVER['REQUEST_METHOD'] != 'POST' && $this->ssl != Tools::usingSecureMode()) { by this if (isset($_SERVER['REQUEST_METHOD']) && Configuration::get('PS_SSL_ENABLED') && $_SERVER['REQUEST_METHOD'] != 'POST' && $this->ssl != Tools::usingSecureMode()) {
  4. Hi, if I try to execute the following script <?php include_once('/var/ean/config/config.inc.php'); include_once('/var/ean/init.php'); $p = new Product(401); echo $p->id; ?> in a prestahop (1.6.1.11) site with "all pages SSL" enabled fails with these warnings: PHP Notice: Undefined index: REQUEST_METHOD in /home/ean_test/classes/controller/FrontController.php on line 788 Notice: Undefined index: REQUEST_METHOD in /home/ean_test/classes/controller/FrontController.php on line 788 PHP Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 790 Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 790 PHP Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 791 Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 791 PHP Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 793 Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 793 the problem is in the if condition in sslRedirection, that evaluates to true. protected function sslRedirection() { // If we call a SSL controller without SSL or a non SSL controller with SSL, we redirect with the right protocol if (Configuration::get('PS_SSL_ENABLED') && $_SERVER['REQUEST_METHOD'] != 'POST' && $this->ssl != Tools::usingSecureMode()) { $this->context->cookie->disallowWriting(); header('HTTP/1.1 301 Moved Permanently'); header('Cache-Control: no-cache'); if ($this->ssl) { header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']); } else { header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']); } exit(); } } To solve this error I added isset($_SERVER['REQUEST_METHOD']) to the condition to avoid entering when called from external scripts and now all of them work again. is it correct? any thoughts? Thanks, Xavi.
  5. Hi, if I try to execute the following script <?php include_once('/var/ean/config/config.inc.php'); include_once('/var/ean/init.php'); $p = new Product(401); echo $p->id; ?> in a prestahop site with "all pages SSL" enabled fails with these warnings: PHP Notice: Undefined index: REQUEST_METHOD in /home/ean_test/classes/controller/FrontController.php on line 788 Notice: Undefined index: REQUEST_METHOD in /home/ean_test/classes/controller/FrontController.php on line 788 PHP Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 790 Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 790 PHP Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 791 Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 791 PHP Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 793 Warning: Cannot modify header information - headers already sent by (output started at /home/ean_test/classes/controller/FrontController.php:788) in /home/ean_test/classes/controller/FrontController.php on line 793 the problem is in the if condition in sslRedirection, that evaluates to true. protected function sslRedirection() { // If we call a SSL controller without SSL or a non SSL controller with SSL, we redirect with the right protocol if (Configuration::get('PS_SSL_ENABLED') && $_SERVER['REQUEST_METHOD'] != 'POST' && $this->ssl != Tools::usingSecureMode()) { $this->context->cookie->disallowWriting(); header('HTTP/1.1 301 Moved Permanently'); header('Cache-Control: no-cache'); if ($this->ssl) { header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']); } else { header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']); } exit(); } } To solve this error I added isset($_SERVER['REQUEST_METHOD']) to the condition to avoid entering when called from external scripts and now all of them work again. is it correct? any thoughts? Thanks, Xavi.
  6. Hola, en la página de checkout y tras aceptar las condiciones de la tienda, se muestran los métodos de pago pero poco después se redirecciona automáticamente a paypal. A alguien le ocurre? Estoy usando la última versión de Paypal. PS 1.6.1.0 Gracias.
  7. Hi, I have the same problem. Maybe a cache ussue. Any thoughts? Xavi.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More