Commit f9e91a89 authored by catch's avatar catch
Browse files

Issue #3337254 by harivansh, lucassc: Replace Updater.php intval() functions...

Issue #3337254 by harivansh, lucassc: Replace Updater.php intval() functions with their relevant type casting operators
parent 04e2c71a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -340,12 +340,12 @@ public function prepareInstallDirectory(&$filetransfer, $directory) {
          // Probably still not writable. Try to chmod and do it again.
          // @todo Make a new exception class so we can catch it differently.
          try {
            $old_perms = substr(sprintf('%o', fileperms($parent_dir)), -4);
            $old_perms = fileperms($parent_dir) & 0777;
            $filetransfer->chmod($parent_dir, 0755);
            $filetransfer->createDirectory($directory);
            $this->makeWorldReadable($filetransfer, $directory);
            // Put the permissions back.
            $filetransfer->chmod($parent_dir, intval($old_perms, 8));
            $filetransfer->chmod($parent_dir, $old_perms);
          }
          catch (FileTransferException $e) {
            $message = t($e->getMessage(), $e->arguments);
@@ -372,8 +372,8 @@ public function prepareInstallDirectory(&$filetransfer, $directory) {
  public function makeWorldReadable(&$filetransfer, $path, $recursive = TRUE) {
    if (!is_executable($path)) {
      // Set it to read + execute.
      $new_perms = substr(sprintf('%o', fileperms($path)), -4, -1) . "5";
      $filetransfer->chmod($path, intval($new_perms, 8), $recursive);
      $new_perms = fileperms($path) & 0777 | 0005;
      $filetransfer->chmod($path, $new_perms, $recursive);
    }
  }