Skip to content

Commit

Permalink
Fixed 'mbstring' extension is not loaded error, use Polyfill instead [
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Feb 14, 2022
1 parent ec88499 commit b3b5fca
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 33 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

1. [](#new)
* Added support to get image size for SVG vector images [#3533](https://github.com/getgrav/grav/pull/3533)
2. [](#bugfix)
* Fixed `'mbstring' extension is not loaded` error, use Polyfill instead [#3504](https://github.com/getgrav/grav/pull/3504)

# v1.7.30
## 02/07/2022
Expand Down
8 changes: 2 additions & 6 deletions bin/gpm
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ if (!file_exists(__DIR__ . '/../vendor/autoload.php')){

$autoload = require __DIR__ . '/../vendor/autoload.php';

if (!ini_get('date.timezone')) {
date_default_timezone_set('UTC');
}
// Set timezone to default, falls back to system if php.ini not set
date_default_timezone_set(@date_default_timezone_get());

// Set internal encoding.
if (!\extension_loaded('mbstring')) {
die("'mbstring' extension is not loaded. This is required for Grav to run correctly");
}
@ini_set('default_charset', 'UTF-8');
mb_internal_encoding('UTF-8');

Expand Down
8 changes: 2 additions & 6 deletions bin/grav
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ if (!file_exists(__DIR__ . '/../vendor/autoload.php')){

$autoload = require __DIR__ . '/../vendor/autoload.php';

if (!ini_get('date.timezone')) {
date_default_timezone_set('UTC');
}
// Set timezone to default, falls back to system if php.ini not set
date_default_timezone_set(@date_default_timezone_get());

// Set internal encoding.
if (!\extension_loaded('mbstring')) {
die("'mbstring' extension is not loaded. This is required for Grav to run correctly");
}
@ini_set('default_charset', 'UTF-8');
mb_internal_encoding('UTF-8');

Expand Down
8 changes: 2 additions & 6 deletions bin/plugin
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ if (!file_exists(__DIR__ . '/../vendor/autoload.php')){

$autoload = require __DIR__ . '/../vendor/autoload.php';

if (!ini_get('date.timezone')) {
date_default_timezone_set('UTC');
}
// Set timezone to default, falls back to system if php.ini not set
date_default_timezone_set(@date_default_timezone_get());

// Set internal encoding.
if (!\extension_loaded('mbstring')) {
die("'mbstring' extension is not loaded. This is required for Grav to run correctly");
}
@ini_set('default_charset', 'UTF-8');
mb_internal_encoding('UTF-8');

Expand Down
23 changes: 8 additions & 15 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@
}
}

// Set timezone to default, falls back to system if php.ini not set
date_default_timezone_set(@date_default_timezone_get());

// Set internal encoding.
if (!\extension_loaded('mbstring')) {
die("'mbstring' extension is not loaded. This is required for Grav to run correctly");
}
@ini_set('default_charset', 'UTF-8');
mb_internal_encoding('UTF-8');

// Ensure vendor libraries exist
$autoload = __DIR__ . '/vendor/autoload.php';
if (!is_file($autoload)) {
Expand All @@ -39,15 +29,18 @@
// Register the auto-loader.
$loader = require $autoload;

// Set timezone to default, falls back to system if php.ini not set
date_default_timezone_set(@date_default_timezone_get());

// Set internal encoding.
@ini_set('default_charset', 'UTF-8');
mb_internal_encoding('UTF-8');

use Grav\Common\Grav;
use RocketTheme\Toolbox\Event\Event;

// Get the Grav instance
$grav = Grav::instance(
array(
'loader' => $loader
)
);
$grav = Grav::instance(array('loader' => $loader));

// Process the page
try {
Expand Down

0 comments on commit b3b5fca

Please sign in to comment.