#32161 [NEW]: com_exception message filed string reformat

From: Date: Wed, 02 Mar 2005 02:24:04 +0000
Subject: #32161 [NEW]: com_exception message filed string reformat
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-74759@lists.php.net to get a copy of this message
From: baoshi dot zhu at gmail dot com Operating system: Windows XP/2000 PHP version: 5.0.3 PHP Bug Type: COM related Bug description: com_exception message filed string reformat Description: ------------ When a COM exception occurs, the error message produced by COM application can be obtained from 'message' in com_exception object. However the string is truncated with some characters wrapping to the front. Reproduce code: --------------- try { $word = new COM("word.application"); $doc = $word->Documents->Open($docfile); $doc->Activate(); $doc->PrintOut(); $doc->Close(); $word->Quit(); } catch (com_exception $e) { if ($doc) $doc->Close(); if ($word) $word->Quit(); print "Error occured at " . $e->getFile() . "(" . $e->getLine() . ")\n"; print $e->getMessage() . "\n"; } Expected result: ---------------- If $docfile does not exists, VBA will return Error: This file could not be found. Try one or more of the following: *Check the spelling of the name of the document. *Try a different file name. (c:\test1.doc) Actual result: -------------- Description: This file could not be found. Try one or more of the following: * Check the spelling of the name of the document. (C:\test1.doc)nt file name. ^^^^^^^^^^^^^^ -- Edit bug report at http://bugs.php.net/?id=32161&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32161&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32161&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32161&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32161&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32161&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32161&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32161&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32161&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32161&r=support Expected behavior: http://bugs.php.net/fix.php?id=32161&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32161&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32161&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32161&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32161&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32161&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32161&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32161&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32161&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32161&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32161&r=mysqlcfg

« previous php.bugs (#74759) next »