Skip to content

Conversation

andrew-kzoo
Copy link
Contributor

In PHP 5.4.4 realpath() handles absolute paths correctly, but in PHP 5.3.8 returns false.

Note: PHP 5.4.4 and PHP 5.3.8 on Windows.

// PHP 5.4.4 - pass - returns original path
// PHP 5.3.8 - fail - returns false
$tempfile = tempnam(sys_get_temp_dir(), "PHPWORD");

echo realpath($tempfile);

In PHP 5.4.4 realpath() handles absolute paths correctly, but in PHP 5.3.8 returns false.
@ivanlanin
Copy link
Contributor

Thanks @andrew-kzoo. I tried to find the reference of this PHP bug, but can't find one. What Windows version were you using? I'll try to reproduce the error.

@andrew-kzoo
Copy link
Contributor Author

PHP 5.4.4 is running on Windows 7 Business Edition Service Pack 1
PHP 5.3.8 is running on Windows Server 2008 R2 Standard Edition Service Pack 1

I found a similar bug report which is older and no longer active: https://bugs.php.net/bug.php?id=41480

In advance, I understand this bug may be too narrow to have the fix included in PHPWord.

@ivanlanin
Copy link
Contributor

Ok, thanks for the info. I'll try to reproduce the bug this weekend.

@ivanlanin ivanlanin merged commit d576060 into PHPOffice:develop Jun 7, 2014
@ivanlanin ivanlanin added this to the 0.12.0 milestone Jun 7, 2014
@ivanlanin ivanlanin self-assigned this Jun 7, 2014
@andrew-kzoo andrew-kzoo deleted the fix-rare-pclzip-realpath-php-version-issue branch June 9, 2014 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants