Changeset 320

Show
Ignore:
Timestamp:
02/26/08 22:55:16 (6 months ago)
Author:
nperriault
Message:

Clever Svg: Silly validation exception handling fixed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cleversvg/trunk/document/csDocument.class.php

    r319 r320  
    664664    if ($this->strict_mode === true) 
    665665    { 
    666       set_error_handler(array('csDocument', 'handleValidationError'), E_ALL); 
    667666      if (!$dom->validate()) 
    668667      { 
    669668        throw new csException('This SVG Document does not validate'); 
    670669      } 
    671       restore_error_handler(); 
    672     } 
    673   } 
    674  
    675   /** 
    676    * Handle validation errors 
    677    * 
    678    * @throws csException 
    679    */ 
    680   public static function handleValidationError($code, $string, $file, $line, $context) 
    681   { 
    682     $message = $string ? $string : 'No message provided for this error'; 
    683     echo sprintf('SVG document doesn\'t validate: %s (%d)', $message, $code); 
    684     exit; 
     670    } 
    685671  } 
    686672