diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index 187e21832f0f30da19d7c1bfb0d2d96e7c8ede3d..a9030729b4862c33a06da3362f3dcd52830faead 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -40,7 +40,7 @@ module IconsHelper
   def file_type_icon_class(type, mode, name)
     if type == 'folder'
       icon_class = 'folder'
-    elsif mode == 0120000
+    elsif mode == '120000'
       icon_class = 'share'
     else
       # Guess which icon to choose based on file extension.
diff --git a/spec/helpers/icons_helper_spec.rb b/spec/helpers/icons_helper_spec.rb
index 0b1cf07b7b083cd23f912a7569daeba11fde8a2f..c052981fe734af82dcc37cbc48a8cb73af753f44 100644
--- a/spec/helpers/icons_helper_spec.rb
+++ b/spec/helpers/icons_helper_spec.rb
@@ -7,7 +7,7 @@ describe IconsHelper do
     end
 
     it 'returns share class' do
-      expect(file_type_icon_class('file', 0120000, 'link')).to eq 'share'
+      expect(file_type_icon_class('file', '120000', 'link')).to eq 'share'
     end
 
     it 'returns file-pdf-o class with .pdf' do