32                if (preg_match(
'#(1|ON)#i', ini_get(
'safe_mode'))) {
 
   33                        $this->errors[] = 
'PHP running in Safe Mode (backtick operator not available) - cannot call vorbiscomment, tags not written';
 
   38                $tempcommentsfilename = tempnam(GETID3_TEMP_DIR, 
'getID3');
 
   39                if (is_writable($tempcommentsfilename) && is_file($tempcommentsfilename) && ($fpcomments = fopen($tempcommentsfilename, 
'wb'))) {
 
   41                        foreach ($this->tag_data as 
$key => $value) {
 
   42                                foreach ($value as $commentdata) {
 
   49                        $this->errors[] = 
'failed to open temporary tags file "'.$tempcommentsfilename.
'", tags not written';
 
   53                $oldignoreuserabort = ignore_user_abort(
true);
 
   54                if (GETID3_OS_ISWINDOWS) {
 
   56                        if (file_exists(GETID3_HELPERAPPSDIR.
'vorbiscomment.exe')) {
 
   67                                $timestampbeforewriting = filemtime($this->filename);
 
   69                                $commandline = GETID3_HELPERAPPSDIR.
'vorbiscomment.exe -w --raw -c "'.$tempcommentsfilename.
'" "'.$this->filename.
'" 2>&1';
 
   70                                $VorbiscommentError = `$commandline`;
 
   72                                if (empty($VorbiscommentError)) {
 
   74                                        if ($timestampbeforewriting == filemtime($this->filename)) {
 
   75                                                $VorbiscommentError = 
'File modification timestamp has not changed - it looks like the tags were not written';
 
   79                                $VorbiscommentError = 
'vorbiscomment.exe not found in '.GETID3_HELPERAPPSDIR;
 
   84                        $commandline = 
'vorbiscomment -w --raw -c "'.$tempcommentsfilename.
'" "'.$this->filename.
'" 2>&1';
 
   85                        $VorbiscommentError = `$commandline`;
 
   90                unlink($tempcommentsfilename);
 
   91                ignore_user_abort($oldignoreuserabort);
 
   93                if (!empty($VorbiscommentError)) {
 
   95                        $this->errors[] = 
'system call to vorbiscomment failed with message: '.
"\n\n".$VorbiscommentError;
 
  104                $this->tag_data = array(array());
 
  116                return strtoupper(preg_replace(
'#[^ -<>-}]#', 
' ', str_replace(
"\x00", 
' ', $originalcommentname)));
 
An exception for terminatinating execution or to throw for unit testing.