Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion reference/fileinfo/functions/finfo-file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<term><parameter>filename</parameter></term>
<listitem>
<para>
Name of a file to be checked.
Name of a local file to be checked. Remote URLs are not supported.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it not say URIs? Also, what is the source of this information?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be completely honest, I'm not a PHP developer — I just came across this issue during Hacktoberfest.

From my point of view, there are three indicators that confirm this is correct:

  1. The open issue states it very clearly: (Improve finfo_file documentation to state that the file must be local #4803)
    “Suggested improvement: Clearly mention in the documentation that $filepath must be a local file and remote URLs are not accepted.”

  2. I asked ChatGPT about it, and it confirmed the same.

  3. A PHP colleague double-checked it and tested the function with an external URL — it didn’t work. However, using a local file worked correctly.

But if you don’t want to have it written that way in the documentation, feel free to just decline the PR.

Of course, I don’t want anything “incorrect” to be added either.
If you’d like, you can double-check it yourselves and adjust the wording however you think fits best 🙂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why it doesn't work with remote files, because it does use streams. Perhaps someone else more knowledge can review this PR.

</para>
</listitem>
</varlistentry>
Expand Down