Skip to content

Commit

Permalink
Issue CollaboraOnline#56: Simplify strStartsWith().
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Nov 12, 2024
1 parent b5545d1 commit 2fe1584
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Cool/CoolRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ function getWopiSrcUrl($discovery_parsed, $mimetype) {
* @see str_starts_with()
*/
function strStartsWith($haystack, $needle) {
$pos = strrpos($haystack, $needle);
return !is_bool($pos) && $pos == 0;
return strrpos($haystack, $needle) === 0;
}

/**
Expand Down

0 comments on commit 2fe1584

Please sign in to comment.