Skip to content

Commit 8a89014

Browse files
Coding Standards: Correct casing of chr() and ord() in class-pclzip.php.
This replaces `Chr()` and `Ord()` with their canonical lowercase forms `chr()` and `ord()`. This is flagged as a case-sensitivity violation by the upcoming [https://wiki.php.net/rfc/case_sensitive_php PHP 8.6 RFC], which will emit `E_DEPRECATED` for function references that don't match their declared casing. Fixing it now keeps WordPress ahead of the deprecation. Props Soean. See #64897. git-svn-id: https://develop.svn.wordpress.org/trunk@62498 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3b36879 commit 8a89014

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-admin/includes/class-pclzip.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3988,7 +3988,7 @@ function privExtractFileUsingTempFile(&$p_entry, &$p_options)
39883988

39893989

39903990
// ----- Write gz file format header
3991-
$v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3));
3991+
$v_binary_data = pack('va1a1Va1a1', 0x8b1f, chr($p_entry['compression']), chr(0x00), time(), chr(0x00), chr(3));
39923992
@fwrite($v_dest_file, $v_binary_data, 10);
39933993

39943994
// ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
@@ -4616,10 +4616,10 @@ function privReadEndCentralDir(&$p_central_dir)
46164616
$v_byte = @fread($this->zip_fd, 1);
46174617

46184618
// ----- Add the byte
4619-
//$v_bytes = ($v_bytes << 8) | Ord($v_byte);
4619+
//$v_bytes = ($v_bytes << 8) | ord($v_byte);
46204620
// Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
46214621
// Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
4622-
$v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);
4622+
$v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | ord($v_byte);
46234623

46244624
// ----- Compare the bytes
46254625
if ($v_bytes == 0x504b0506)

0 commit comments

Comments
 (0)