[TASK] Remove function usage ctype_alnum in PageRenderer 73/17773/2
authorIngo Pfennigstorf <i.pfennigstorf@gmail.com>
Fri, 7 Dec 2012 15:18:44 +0000 (16:18 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 28 Jan 2013 18:18:38 +0000 (19:18 +0100)
This fixes the problem that on some servers the PHP ctype extension
is not installed by default and results in a blank backend screen
when trying to edit a page.

Fixes: #43726
Releases: 6.1, 6.0

Change-Id: Icb029a39107c092c06c9e70bbde0b2217e5860f7
Reviewed-on: https://review.typo3.org/17773
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/core/Tests/Unit/Page/PageRendererTest.php

index c0b3f02..6e81892 100644 (file)
@@ -1507,7 +1507,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface {
                if ($source === 'local' && !in_array($version, $this->availableLocalJqueryVersions)) {
                        throw new \UnexpectedValueException('The requested jQuery version is not available in the local filesystem.', 1341505305);
                }
-               if (!ctype_alnum($namespace)) {
+               if (!preg_match('/^[a-zA-Z0-9]+$/', $namespace)) {
                        throw new \UnexpectedValueException('The requested namespace contains non alphanumeric characters.', 1341571604);
                }
                $this->jQueryVersions[$namespace] = array(
index 7317d5e..93e2966 100644 (file)
@@ -407,7 +407,7 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * @expectedException UnexpectedValueException
+        * @expectedException \UnexpectedValueException
         * @test
         */
        public function includingNotAvailableLocalJqueryVersionThrowsException() {
@@ -416,7 +416,7 @@ class PageRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
-        * @expectedException UnexpectedValueException
+        * @expectedException \UnexpectedValueException
         * @test
         */
        public function includingJqueryWithNonAlphnumericNamespaceThrowsException() {