diff --git a/library/ZendAfi/Controller/Plugin/Manager/FileManager.php b/library/ZendAfi/Controller/Plugin/Manager/FileManager.php
index ee31d143ead4fa605bc470dfcd91681d5d3dbefa..9479b013176bf39b6dc3b1230fbc6eec8b25fc8f 100644
--- a/library/ZendAfi/Controller/Plugin/Manager/FileManager.php
+++ b/library/ZendAfi/Controller/Plugin/Manager/FileManager.php
@@ -46,7 +46,7 @@ class ZendAfi_Controller_Plugin_Manager_FileManager extends ZendAfi_Controller_P
              },
              'label' => $this->_('Sélectionner "%s"', $model->getName()),
              'anchorOptions' => array_filter(['title' => $this->_('Sélectionner "%s"', $model->getName()),
-                                              'onclick' => "$(this).selectItemForCKEditor('" . Class_Url::relative(str_replace(["'", '"'], ['%27', '%22'], $model->getId())) . "');"])],
+                                              'onclick' => "$(this).selectItemForCKEditor('" . str_replace(["'", '"'], ['%27', '%22'], $model->getId()) . "');"])],
 
             ['url' => ['action' => 'create',
                        'into' => $model->getId()],
diff --git a/tests/application/modules/admin/controllers/FileManagerControllerTest.php b/tests/application/modules/admin/controllers/FileManagerControllerTest.php
index d3d0e8b9b125408d0652b1dc910d8dd38431632c..f77911a93a707890bba333303b24271a1a433206 100644
--- a/tests/application/modules/admin/controllers/FileManagerControllerTest.php
+++ b/tests/application/modules/admin/controllers/FileManagerControllerTest.php
@@ -1561,7 +1561,7 @@ class FileManagerControllerWithSpecialCharTest extends FileManagerControllerTest
 
   /** @test */
   public function selectButtonShouldBePresent() {
-    $this->assertXPathContentContains('//div//a[contains(@onclick, "$(this).selectItemForCKEditor(")][contains(@onclick, "/userfiles/my %27direct%22ory/new%27_ima%22ge.jpg")]', 'Sélectionner');
+    $this->assertXPathContentContains('//div//a[contains(@onclick, "$(this).selectItemForCKEditor(")][contains(@onclick, "selectItemForCKEditor(\'userfiles/my %27direct%22ory/new%27_ima%22ge.jpg")]', 'Sélectionner');
   }