Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 123 characters in body
Source Link
Gkna
  • 81
  • 1
  • 3
  • 8

I have an issue;

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222 Which is ;

// get a version of the SQL statement with all quoted
// values and delimited identifiers stripped out
// remove "foo\"bar"
$sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql);
// get the character for delimited id quotes,
// this is usually " but in MySQL is `
$d = $this->_adapter->quoteIdentifier('a');
$d = $d[0];
// get the value used as an escaped delimited id quote,
// e.g. \" or "" or \`
$de = $this->_adapter->quoteIdentifier($d);
$de = substr($de, 1, 2);
$de = preg_quote($de);
// Note: $de and $d where never used..., now they are:
(222) $sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql);
return $sql;
}

My code is :

$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$_product = $block->getProduct();

$specs = $_product->getAttributeText('specifications');
$specs = $specs = $this->helper('Magento\Catalog\Helper\Output')- 
>productAttribute($block->getProduct(), $block->getProduct()- 
>getSpecifications(), 'specifications');

$specs = trim( str_replace( array("\r\n","\r", "<br />" ),"", $specs));
$specs = trim( html_entity_decode( $specs ) );

Sample output of the my code:

enter image description here

I have an issue;

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222 Which is ;

// get a version of the SQL statement with all quoted
// values and delimited identifiers stripped out
// remove "foo\"bar"
$sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql);
// get the character for delimited id quotes,
// this is usually " but in MySQL is `
$d = $this->_adapter->quoteIdentifier('a');
$d = $d[0];
// get the value used as an escaped delimited id quote,
// e.g. \" or "" or \`
$de = $this->_adapter->quoteIdentifier($d);
$de = substr($de, 1, 2);
$de = preg_quote($de);
// Note: $de and $d where never used..., now they are:
(222) $sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql);
return $sql;
}

My code is :

$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$_product = $block->getProduct();

$specs = $_product->getAttributeText('specifications');
$specs = $specs = $this->helper('Magento\Catalog\Helper\Output')- 
>productAttribute($block->getProduct(), $block->getProduct()- 
>getSpecifications(), 'specifications');

$specs = trim( str_replace( array("\r\n","\r", "<br />" ),"", $specs));
$specs = trim( html_entity_decode( $specs ) );

I have an issue;

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222 Which is ;

// get a version of the SQL statement with all quoted
// values and delimited identifiers stripped out
// remove "foo\"bar"
$sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql);
// get the character for delimited id quotes,
// this is usually " but in MySQL is `
$d = $this->_adapter->quoteIdentifier('a');
$d = $d[0];
// get the value used as an escaped delimited id quote,
// e.g. \" or "" or \`
$de = $this->_adapter->quoteIdentifier($d);
$de = substr($de, 1, 2);
$de = preg_quote($de);
// Note: $de and $d where never used..., now they are:
(222) $sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql);
return $sql;
}

My code is :

$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$_product = $block->getProduct();

$specs = $_product->getAttributeText('specifications');
$specs = $specs = $this->helper('Magento\Catalog\Helper\Output')- 
>productAttribute($block->getProduct(), $block->getProduct()- 
>getSpecifications(), 'specifications');

$specs = trim( str_replace( array("\r\n","\r", "<br />" ),"", $specs));
$specs = trim( html_entity_decode( $specs ) );

Sample output of the my code:

enter image description here

I updated codes
Source Link
Gkna
  • 81
  • 1
  • 3
  • 8

I have an issue;

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222 Which is ;

// get a version of the SQL statement with all quoted
// values and delimited identifiers stripped out
// remove "foo\"bar"
$sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql);
// get the character for delimited id quotes,
// this is usually " but in MySQL is `
$d = $this->_adapter->quoteIdentifier('a');
$d = $d[0];
// get the value used as an escaped delimited id quote,
// e.g. \" or "" or \`
$de = $this->_adapter->quoteIdentifier($d);
$de = substr($de, 1, 2);
$de = preg_quote($de);
// Note: $de and $d where never used..., now they are:
(222) $sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql);
return $sql;
}

My code is :

$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$_product = $block->getProduct(); 

$specs = $_product->getAttributeText('specifications');
$specs = $specs = $this->helper('Magento\Catalog\Helper\Output')- 
>productAttribute($block->getProduct(), $block->getProduct()- 
>getSpecifications(), 'specifications'); 

$specs = trim( str_replace( array("\r\n","\r", "<br />" ),"", $specs ) );
$specs = trim( html_entity_decode( $specs ) );

I have an issue;

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222

$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$_product = $block->getProduct();
$specs = $_product->getAttributeText('specifications');
$specs = $specs = $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getSpecifications(), 'specifications');
$specs = trim( str_replace( array("\r\n","\r", "<br />" ),"", $specs ) );
$specs = trim( html_entity_decode( $specs ) );

I have an issue;

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222 Which is ;

// get a version of the SQL statement with all quoted
// values and delimited identifiers stripped out
// remove "foo\"bar"
$sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql);
// get the character for delimited id quotes,
// this is usually " but in MySQL is `
$d = $this->_adapter->quoteIdentifier('a');
$d = $d[0];
// get the value used as an escaped delimited id quote,
// e.g. \" or "" or \`
$de = $this->_adapter->quoteIdentifier($d);
$de = substr($de, 1, 2);
$de = preg_quote($de);
// Note: $de and $d where never used..., now they are:
(222) $sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql);
return $sql;
}

My code is :

$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$_product = $block->getProduct(); 

$specs = $_product->getAttributeText('specifications');
$specs = $specs = $this->helper('Magento\Catalog\Helper\Output')- 
>productAttribute($block->getProduct(), $block->getProduct()- 
>getSpecifications(), 'specifications'); 

$specs = trim( str_replace( array("\r\n","\r", "<br />" ),"", $specs));
$specs = trim( html_entity_decode( $specs ) );
added 27 characters in body
Source Link
Ronak Rathod
  • 6.5k
  • 18
  • 43

I have an issue;

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222

$_helper = $this->helper('Magento\Catalog\Helper\Output'); $_imagehelper = $this->helper('Magento\Catalog\Helper\Image'); $_product = $block->getProduct(); $specs = $_product->getAttributeText('specifications'); $specs = $specs = $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getSpecifications(), 'specifications'); $specs = trim( str_replace( array("\r\n","\r", "
" ),"", $specs ) ); $specs = trim( html_entity_decode( $specs ) );

$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$_product = $block->getProduct();
$specs = $_product->getAttributeText('specifications');
$specs = $specs = $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getSpecifications(), 'specifications');
$specs = trim( str_replace( array("\r\n","\r", "<br />" ),"", $specs ) );
$specs = trim( html_entity_decode( $specs ) );

I have an issue;

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222

$_helper = $this->helper('Magento\Catalog\Helper\Output'); $_imagehelper = $this->helper('Magento\Catalog\Helper\Image'); $_product = $block->getProduct(); $specs = $_product->getAttributeText('specifications'); $specs = $specs = $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getSpecifications(), 'specifications'); $specs = trim( str_replace( array("\r\n","\r", "
" ),"", $specs ) ); $specs = trim( html_entity_decode( $specs ) );

I have an issue;

1 exception(s): Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222

$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$_product = $block->getProduct();
$specs = $_product->getAttributeText('specifications');
$specs = $specs = $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getSpecifications(), 'specifications');
$specs = trim( str_replace( array("\r\n","\r", "<br />" ),"", $specs ) );
$specs = trim( html_entity_decode( $specs ) );
Source Link
Gkna
  • 81
  • 1
  • 3
  • 8
Loading