Skip to content

Commit

Permalink
Merge branch 'MOODLE_23_STABLE' into install_23_STABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
AMOS bot committed Sep 6, 2013
2 parents ca2e480 + fadb971 commit 22c1afc
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions lib/configonlylib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ function min_fix_utf8($value) {
error_reporting($olderror ^ E_NOTICE); error_reporting($olderror ^ E_NOTICE);
} }


// No null bytes expected in our data, so let's remove it.
$value = str_replace("\0", '', $value);

static $buggyiconv = null; static $buggyiconv = null;
if ($buggyiconv === null) { if ($buggyiconv === null) {
$buggyiconv = (!function_exists('iconv') or iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'') !== '100€'); $buggyiconv = (!function_exists('iconv') or iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'') !== '100€');
Expand Down
1 change: 1 addition & 0 deletions lib/dml/mssql_native_moodle_database.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ protected function emulate_bound_params($sql, array $params=null) {


} else { } else {
$param = str_replace("'", "''", $param); $param = str_replace("'", "''", $param);
$param = str_replace("\0", "", $param);
$return .= "N'$param'"; $return .= "N'$param'";
} }


Expand Down
1 change: 1 addition & 0 deletions lib/dml/sqlsrv_native_moodle_database.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ protected function emulate_bound_params($sql, array $params = null) {
$return .= $param; $return .= $param;
} else { } else {
$param = str_replace("'", "''", $param); $param = str_replace("'", "''", $param);
$param = str_replace("\0", "", $param);
$return .= "N'$param'"; $return .= "N'$param'";
} }


Expand Down
2 changes: 2 additions & 0 deletions lib/moodlelib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1158,6 +1158,8 @@ function fix_utf8($value) {
// shortcut // shortcut
return $value; return $value;
} }
// No null bytes expected in our data, so let's remove it.
$value = str_replace("\0", '', $value);


// Lower error reporting because glibc throws bogus notices. // Lower error reporting because glibc throws bogus notices.
$olderror = error_reporting(); $olderror = error_reporting();
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/configonlylib_test.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class core_configonlylib_testcase extends advanced_testcase {
*/ */
public function test_min_fix_utf8() { public function test_min_fix_utf8() {
$this->assertSame('abc', min_fix_utf8('abc')); $this->assertSame('abc', min_fix_utf8('abc'));
$this->assertSame("žlutý koníček přeskočil potůček \n\t\r\0", min_fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0")); $this->assertSame("žlutý koníček přeskočil potůček \n\t\r", min_fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0"));
$this->assertSame('', min_fix_utf8('a'.chr(130).'š'), 'This fails with buggy iconv() when mbstring extenstion is not available as fallback.'); $this->assertSame('', min_fix_utf8('a'.chr(130).'š'), 'This fails with buggy iconv() when mbstring extenstion is not available as fallback.');
} }


Expand Down
2 changes: 1 addition & 1 deletion lib/tests/moodlelib_test.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ function test_fix_utf8() {
$this->assertEquals($object, fix_utf8($object)); $this->assertEquals($object, fix_utf8($object));


// valid utf8 string // valid utf8 string
$this->assertSame("žlutý koníček přeskočil potůček \n\t\r\0", fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0")); $this->assertSame("žlutý koníček přeskočil potůček \n\t\r", fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0"));


// invalid utf8 string // invalid utf8 string
$this->assertSame('', fix_utf8('a'.chr(130).'š'), 'This fails with buggy iconv() when mbstring extenstion is not available as fallback.'); $this->assertSame('', fix_utf8('a'.chr(130).'š'), 'This fails with buggy iconv() when mbstring extenstion is not available as fallback.');
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@


defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();


$version = 2012062508.06; // YYYYMMDD = weekly release date of this DEV branch $version = 2012062508.07; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches // RR = release increments - 00 in DEV branches
// .XX = incremental changes // .XX = incremental changes


$release = '2.3.8+ (Build: 20130815)'; // Human-friendly version name $release = '2.3.8+ (Build: 20130905)'; // Human-friendly version name


$branch = '23'; // this version's branch $branch = '23'; // this version's branch
$maturity = MATURITY_STABLE; // this version's maturity level $maturity = MATURITY_STABLE; // this version's maturity level

0 comments on commit 22c1afc

Please sign in to comment.