Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php 8.3: fix catch for empty sitemap filename #4521

Merged
merged 1 commit into from
Feb 1, 2025
Merged

Conversation

midlan
Copy link
Contributor

@midlan midlan commented Feb 1, 2025

Description (*)

With PHP 7.4 this catch will catch empty filename exception. With PHP 8.3, empty filename escapes the catch, because it is type of ValueError which does not inherit from Exception. This PR fixes the catch, that PHP 8.3 behavior is the same as PHP 7.4

full PHP 8.3 error that escapes the catch

PHP Fatal error:  Uncaught ValueError: Path cannot be empty in /srv/www/scooterdiscounter/public/lib/Varien/Io/File.php:139

Manual testing scenarios (*)

  1. create sitemap with empty filename (using script or manipulate in database)
  2. execute cronjob sitemap_generate

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)

@github-actions github-actions bot added the Component: Sitemap Relates to Mage_Sitemap label Feb 1, 2025
Copy link
Contributor

github-actions bot commented Feb 1, 2025

Test Results

541 tests  ±0   533 ✅ ±0   2s ⏱️ ±0s
145 suites ±0     8 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit b03990f. ± Comparison against base commit 4dc680e.

1 similar comment
Copy link
Contributor

github-actions bot commented Feb 1, 2025

Test Results

541 tests  ±0   533 ✅ ±0   2s ⏱️ ±0s
145 suites ±0     8 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit b03990f. ± Comparison against base commit 4dc680e.

Copy link
Contributor

github-actions bot commented Feb 1, 2025

Test Results

541 tests  ±0   533 ✅ ±0   2s ⏱️ ±0s
145 suites ±0     8 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit b03990f. ± Comparison against base commit 4dc680e.

♻️ This comment has been updated with latest results.

Copy link

sonarqubecloud bot commented Feb 1, 2025

@sreichel sreichel added the bug label Feb 1, 2025
@sreichel sreichel added the PHP 8.3 Related to PHP 8.3 label Feb 1, 2025
@sreichel sreichel changed the title fix catch for php 8.3 php 8.3: fix catch for empty sitemap filename Feb 1, 2025
@sreichel sreichel merged commit e5feff0 into main Feb 1, 2025
33 checks passed
@sreichel sreichel deleted the midlan-patch-1 branch February 1, 2025 06:54
fballiano added a commit to MahoCommerce/maho that referenced this pull request Feb 1, 2025
@sreichel sreichel added this to the 20.13.0 milestone Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component: Sitemap Relates to Mage_Sitemap PHP 8.3 Related to PHP 8.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants