wppaste
WordPress

getid3_apetag

Source
wp-includes/ID3/module.tag.apetag.php:21

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 2

$inline_attachmentsint|bool|stringpublic
true: return full data for all attachments; false: return no data for all attachments; integer: return data for attachments <= than this; string: save as file to this directory.
$overrideendoffsetpublic

Methods · 5

Source code

class getid3_apetag extends getid3_handler{	/**	 * true: return full data for all attachments;	 * false: return no data for all attachments;	 * integer: return data for attachments <= than this;	 * string: save as file to this directory.	 *	 * @var int|bool|string	 */	public $inline_attachments = true; 	public $overrideendoffset  = 0; 	/**	 * @return bool	 */	public function Analyze() {		$info = &$this->getid3->info; 		if (!getid3_lib::intValueSupported($info['filesize'])) {			$this->warning('Unable to check for APEtags because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB');			return false;		}		if (PHP_INT_MAX == 2147483647) {			// https://github.com/JamesHeinrich/getID3/issues/439			$this->warning('APEtag flags may not be parsed correctly on 32-bit PHP');		} 		$id3v1tagsize     = 128;		$apetagheadersize = 32;		$lyrics3tagsize   = 10; 		if ($this->overrideendoffset == 0) { 			$this->fseek(0 - $id3v1tagsize - $apetagheadersize - $lyrics3tagsize, SEEK_END);			$APEfooterID3v1 = $this->fread($id3v1tagsize + $apetagheadersize + $lyrics3tagsize); 			//if (preg_match('/APETAGEX.{24}TAG.{125}$/i', $APEfooterID3v1)) {			if (substr($APEfooterID3v1, strlen($APEfooterID3v1) - $id3v1tagsize - $apetagheadersize, 8) == 'APETAGEX') { 				// APE tag found before ID3v1				$info['ape']['tag_offset_end'] = $info['filesize'] - $id3v1tagsize; 			//} elseif (preg_match('/APETAGEX.{24}$/i', $APEfooterID3v1)) {			} elseif (substr($APEfooterID3v1, strlen($APEfooterID3v1) - $apetagheadersize, 8) == 'APETAGEX') { 				// APE tag found, no ID3v1				$info['ape']['tag_offset_end'] = $info['filesize']; 			} 		} else { 			$this->fseek($this->overrideendoffset - $apetagheadersize);			if ($this->fread(8) == 'APETAGEX') {				$info['ape']['tag_offset_end'] = $this->overrideendoffset;			} 		}		if (!isset($info['ape']['tag_offset_end'])) { 			// APE tag not found			unset($info['ape']);			return false; 		} 		// shortcut		$thisfile_ape = &$info['ape']; 		$this->fseek($thisfile_ape['tag_offset_end'] - $apetagheadersize);		$APEfooterData = $this->fread(32);		if (!($thisfile_ape['footer'] = $this->parseAPEheaderFooter($APEfooterData))) {			$this->error('Error parsing APE footer at offset '.$thisfile_ape['tag_offset_end']);			return false;		} 		if (isset($thisfile_ape['footer']['flags']['header']) && $thisfile_ape['footer']['flags']['header']) {			$this->fseek($thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'] - $apetagheadersize);

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/ID3/module.tag.apetag.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.