http://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692013-06-17T15:47:32ZTYPO3 ForgeTYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1697012013-06-17T15:47:32ZChris topher
<ul><li><strong>Subject</strong> changed from <i>ElementBrowser.php line 1867 - PHP Warning: rtrim() expects parameter 1 to be string</i> to <i>PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867</i></li></ul><p>This is the PHP code:<br /><code class="php syntaxhl" data-language="php"><span class="nf">isReadOnlyFolder</span><span class="p">(</span><span class="nv">$folder</span><span class="p">)</span> <span class="p">{</span>
<span class="k">return</span> <span class="nv">$GLOBALS</span><span class="p">[</span><span class="s1">'FILEMOUNTS'</span><span class="p">][</span><span class="nv">$this</span><span class="o">-></span><span class="n">fileProcessor</span><span class="o">-></span><span class="nf">checkPathAgainstMounts</span><span class="p">(</span><span class="nb">rtrim</span><span class="p">(</span><span class="nv">$folder</span><span class="p">,</span> <span class="s1">'/'</span><span class="p">)</span> <span class="mf">.</span> <span class="s1">'/'</span><span class="p">)][</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">==</span> <span class="s1">'readonly'</span><span class="p">;</span>
</code></p>
<p>Here <code>$folder</code> is a <code>folder object</code> from TYPO3\CMS\Core\Resource\Folder. But instead, it should be a string with an absolute filepath.</p>
<p>Backtrace:<br /><pre>
#0 TYPO3\CMS\Recordlist\Browser\ElementBrowser->isReadOnlyFolder(TYPO3\CMS\Core\Resource\Folder Object (
[] => TYPO3\CMS\Core\Resource\ResourceStorage Object (
[] => TYPO3\CMS\Core\Resource\Driver\LocalDriver Object (
[] => /var/www/fileadmin/,
[] => Array ([0] => sha1,
[1] => md5),
[] => fileadmin/,
[] => ,
[] => TYPO3\CMS\Core\Resource\ResourceStorage Object (
*RECURSION*,
[] => ,
[] => TYPO3\CMS\Core\Resource\Folder Object (
*RECURSION*,
[] => Array (
[basePath] => fileadmin/,
[pathType] => relative
),
[] => getFileList_itemCallback,
[] => getFolderList_itemCallback,
[] => 7
),
[] => Array (
[uid] => 1,
[pid] => 0,
[tstamp] => 1371345593,
[crdate] => 1371345593,
[cruser_id] => 0,
[deleted] => 0,
[hidden] => 0,
[name] => fileadmin/,
[description] => Das lokale fileadmin/ Verzeichnis.,
[driver] => Local,
[configuration] => fileadmin/ relative ,
[is_browsable] =>
..........
#1 TYPO3\CMS\Recordlist\Browser\ElementBrowser->main_file() called at [~/typo3_src-6.0.6/typo3/sysext/recordlist/Classes/Controller/ElementBrowserController.php:145]
#2 TYPO3\CMS\Recordlist\Controller\ElementBrowserController->main() called at [~/typo3_src-6.0.6/typo3/browse_links.php:49]
</pre></p>
<p>So it is in fact TYPO3\CMS\Recordlist\Browser\ElementBrowser::main_file(), which gives the wrong argument to isReadOnlyFolder().</p>
<p>The problem is line 1138, where the code even says that <code>$fileOrFolderObject</code>, an object, will be put into the variable:</p>
<code class="php syntaxhl" data-language="php"><span class="nv">$fileOrFolderObject</span> <span class="o">=</span> <span class="nc">\TYPO3\CMS\Core\Resource\ResourceFactory</span><span class="o">::</span><span class="nf">getInstance</span><span class="p">()</span><span class="o">-></span><span class="nf">retrieveFileOrFolderObject</span><span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="n">expandFolder</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$fileOrFolderObject</span> <span class="k">instanceof</span> <span class="nc">\TYPO3\CMS\Core\Resource\Folder</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// It's a folder</span>
<span class="nv">$this</span><span class="o">-></span><span class="n">selectedFolder</span> <span class="o">=</span> <span class="nv">$fileOrFolderObject</span><span class="p">;</span>
<span class="mf">...</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="n">selectedFolder</span> <span class="o">&&</span> <span class="o">!</span><span class="nv">$this</span><span class="o">-></span><span class="nf">isReadOnlyFolder</span><span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="n">selectedFolder</span><span class="p">))</span> <span class="p">{</span>
</code> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1774052013-08-12T11:44:30ZErnesto Baschnyeb@cron.eu
<ul><li><strong>Category</strong> set to <i>File Abstraction Layer (FAL)</i></li><li><strong>Priority</strong> changed from <i>Should have</i> to <i>Must have</i></li></ul> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1774402013-08-12T15:59:06ZErnesto Baschnyeb@cron.eu
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Accepted</i></li></ul><p>At the end we need to replace the usage of the (deprecated) BasicFileUtility (which is $this->fileProcessor in ElementBrowser) by the new BE_USERS->getFileStorages() and then call isWithinFileMountBoundaries instead of the old-school methods of BasicFileUtility.</p>
<p>This will not only solve this bug, but fix a deprecation policy violation, that we currently have, where we init BasicFileUtility which is deprecated since 6.0.</p> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1898792013-11-13T03:49:11ZMarkus Kleinmarkus.klein@typo3.org
<ul><li><strong>Is Regression</strong> set to <i>No</i></li></ul><p>$GLOBALS['FILEMOUNTS'] is always empty now.</p> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1898802013-11-13T03:53:47ZGerrit Code Review
<ul><li><strong>Status</strong> changed from <i>Accepted</i> to <i>Under Review</i></li></ul><p>Patch set 1 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/25358">https://review.typo3.org/25358</a></p> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1903032013-11-16T08:19:20ZSteffen Ritterinfo@rs-websystems.de
<ul><li><strong>Target version</strong> set to <i>next-patchlevel</i></li></ul> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1919052013-11-27T23:27:05ZGerrit Code Review
<ul></ul><p>Patch set 2 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/25358">https://review.typo3.org/25358</a></p> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1919102013-11-28T01:45:58ZGerrit Code Review
<ul></ul><p>Patch set 3 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/25358">https://review.typo3.org/25358</a></p> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1969122013-12-18T11:31:14ZMarkus Kleinmarkus.klein@typo3.org
<ul><li><strong>Status</strong> changed from <i>Under Review</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="[BUGFIX] Remove ElementBrowser::isReadOnlyFolder ElementBrowser::isReadOnlyFolder is not require..." href="http://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/e8a2b21e913e4c309f80ca809b23876c79adad49">e8a2b21e913e4c309f80ca809b23876c79adad49</a>.</p> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1969132013-12-18T11:49:38ZGerrit Code Review
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Under Review</i></li></ul><p>Patch set 1 for branch <strong>TYPO3_6-1</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/26467">https://review.typo3.org/26467</a></p> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1969142013-12-18T11:50:41ZGerrit Code Review
<ul></ul><p>Patch set 1 for branch <strong>TYPO3_6-0</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/26468">https://review.typo3.org/26468</a></p> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=1969202013-12-18T12:31:11ZMarkus Kleinmarkus.klein@typo3.org
<ul><li><strong>Status</strong> changed from <i>Under Review</i> to <i>Resolved</i></li></ul><p>Applied in changeset <a class="changeset" title="[BUGFIX] Remove ElementBrowser::isReadOnlyFolder ElementBrowser::isReadOnlyFolder is not require..." href="http://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/e8978f9d8c70febb6fb8ec0f6181f533f2523ccf">e8978f9d8c70febb6fb8ec0f6181f533f2523ccf</a>.</p> TYPO3 Core - Bug #47648: PHP Warning: rtrim() expects parameter 1 to be string in ElementBrowser.php line 1867http://forge.typo3.org/issues/47648?journal_id=3841042018-10-02T12:13:49ZBenni Mackbenni@typo3.org
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>