Ver Fonte

Use negative index to access a character

Visman há 4 anos atrás
pai
commit
10d2eb7aa9
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 1 1
      app/Core/File.php
  2. 1 1
      app/Core/Lang.php

+ 1 - 1
app/Core/File.php

@@ -140,7 +140,7 @@ class File
             $matches[3] = $this->ext;
         } elseif (
             '(' === $matches[3][0]
-            && ')' === $matches[3][\strlen($matches[3]) - 1]
+            && ')' === $matches[3][-1]
         ) {
             $matches[3] = \explode('|', \substr($matches[3], 1, -1));
 

+ 1 - 1
app/Core/Lang.php

@@ -284,7 +284,7 @@ class Lang
         if (
             isset($line[1])
             && '"' == $line[0]
-            && '"' == $line[\strlen($line) - 1]
+            && '"' == $line[-1]
         ) {
             $line = \substr($line, 1, -1);
         }