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] ValueError's previous exception is now set in password_hash() #4235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexandre-daubois
Copy link
Contributor

Part of #2796

<entry>
<function>password_hash</function> now sets the underlying
<classname>\Random\RandomException</classname> as the previous exception when
a <classname>ValueError</classname> is thrown if the salt generation fails.
Copy link
Member

Choose a reason for hiding this comment

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

I think both <classname> be <exceptionname>. Also:

Suggested change
a <classname>ValueError</classname> is thrown if the salt generation fails.
a <classname>ValueError</classname> is thrown because the salt generation fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated!

Copy link
Member

Choose a reason for hiding this comment

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

Ah, one other thing is I think you don't need the leading \ on the exception name or it won't get linked up properly. I haven't tested this, though.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, one other thing is I think you don't need the leading \ on the exception name or it won't get linked up properly. I haven't tested this, though.

Indeed.

Comment on lines 193 to 195
<function>password_hash</function> now sets the underlying
<exceptionname>\Random\RandomException</exceptionname> as the previous exception when
a <exceptionname>ValueError</exceptionname> is thrown because the salt generation fails.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<function>password_hash</function> now sets the underlying
<exceptionname>\Random\RandomException</exceptionname> as the previous exception when
a <exceptionname>ValueError</exceptionname> is thrown because the salt generation fails.
<function>password_hash</function> now sets the underlying
<exceptionname>\Random\RandomException</exceptionname> as the previous exception when a
<exceptionname>ValueError</exceptionname> is thrown due to a failure in salt generation.

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

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

The description correctly describes the change that happened. I'll defer the English phrasing to other reviewers.

<entry>8.3.0</entry>
<entry>
<function>password_hash</function> now sets the underlying
<exceptionname>\Random\RandomException</exceptionname> as the previous exception when
Copy link
Member

Choose a reason for hiding this comment

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

Should previous perhaps be a <literal>$previous</previous>?

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer <property>Exception::$previous</property> then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with your suggestion

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.

5 participants