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

Add external avatar file check for missing files #5241

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rica-carv
Copy link
Contributor

Motivation and Context

External avatar files, when missing, give this output:
Screenshot 2024-04-27 at 11-37-17 SelosPT
Screenshot 2024-04-27 at 11-36-55 Gestor de plugins - Instalado - Área do administrador SelosPT

Description

Added code to revert to default avatar image, when external file is missing, output like this:
Screenshot 2024-04-27 at 12-52-09 SelosPT
Screenshot 2024-04-27 at 12-51-40 Língua - Área do administrador SelosPT

How Has This Been Tested?

Tested in e107 v2.3.3 clean install,
Output tested in admin area and in the front end (pics above)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist

Aditional check for external linked avatars.
Without the code, external linked avatars not available are shown without the default avatar
@CaMer0n CaMer0n added this to the e107 2.4.0 milestone May 9, 2024
@CaMer0n
Copy link
Member

CaMer0n commented May 10, 2024

Thanks for this. Maybe I'm misreading it, but the file_exists() function in PHP does not work with remote URLs, so I'm not sure how this is working for you. ?

Changed file_exists to fopen, to check if remote file exists
@rica-carv
Copy link
Contributor Author

Thanks for this. Maybe I'm misreading it, but the file_exists() function in PHP does not work with remote URLs, so I'm not sure how this is working for you. ?

Sorry, im using localhost, so forgot it's a remote url. Just changed file_exists for fopen for remote url checking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants