Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F13131567
D3869.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3869.diff
View Options
diff --git a/workspaces/src/Engines/I18n/TextFileMessage.php b/workspaces/src/Engines/I18n/TextFileMessage.php
--- a/workspaces/src/Engines/I18n/TextFileMessage.php
+++ b/workspaces/src/Engines/I18n/TextFileMessage.php
@@ -47,7 +47,7 @@
//Finds relevant files
$files = scandir($folder);
foreach ($files as $file) {
- if (string_starts_with($file, $filename . '-') && get_extension($file) == 'txt') {
+ if (str_starts_with($file, $filename . '-') && get_extension($file) == 'txt') {
$lang = substr($file, strlen($filename) + 1, -4);
if (strpos($lang, '-') !== false) {
//The user have quux-lang.txt and quux-foo-lang.txt files
diff --git a/workspaces/src/includes/GlobalFunctions.php b/workspaces/src/includes/GlobalFunctions.php
--- a/workspaces/src/includes/GlobalFunctions.php
+++ b/workspaces/src/includes/GlobalFunctions.php
@@ -40,22 +40,6 @@
return substr($file, 0, $dotPosition);
}
-/*
- * Determines if a string starts with specified substring
- * @param string $haystack the string to check
- * @param string $needle the substring to determines if it's the start
- * @param boolean $case_sensitive determines if the search must be case sensitive
- * @return boolean true if $haystack starts with $needle ; otherwise, false.
- */
-function string_starts_with ($haystack, $needle, $case_sensitive = true) {
- if (!$case_sensitive) {
- $haystack = strtoupper($haystack);
- $needle = strtoupper($needle);
- }
- if ($haystack == $needle) return true;
- return strpos($haystack, $needle) === 0;
-}
-
////////////////////////////////////////////////////////////////////////////////
/// ///
/// URL helpers functions ///
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 20, 12:29 (17 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3188135
Default Alt Text
D3869.diff (1 KB)
Attached To
Mode
D3869: Switch to PHP 8 str_starts_with
Attached
Detach File
Event Timeline
Log In to Comment