diff --git a/core/modules/block/lib/Drupal/block/BlockAccessController.php b/core/modules/block/lib/Drupal/block/BlockAccessController.php index 85f449e..7c61bc6 100644 --- a/core/modules/block/lib/Drupal/block/BlockAccessController.php +++ b/core/modules/block/lib/Drupal/block/BlockAccessController.php @@ -106,9 +106,6 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A // listed in $block->pages. $page_match = !($visibility['path']['visibility'] xor $page_match); } - elseif (module_exists('php')) { - $page_match = php_eval($visibility['path']['pages']); - } // If there are page visibility restrictions and this page does not // match, deny access. diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php index b2fa783..3915315 100644 --- a/core/modules/block/lib/Drupal/block/BlockFormController.php +++ b/core/modules/block/lib/Drupal/block/BlockFormController.php @@ -157,14 +157,6 @@ public function form(array $form, array &$form_state) { ); $description = $this->t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %user for the current user's page and %user-wildcard for every user page. %front is the front page.", array('%user' => 'user', '%user-wildcard' => 'user/*', '%front' => '')); - if ($this->moduleHandler->moduleExists('php') && $access) { - $options += array(BLOCK_VISIBILITY_PHP => $this->t('Pages on which this PHP code returns TRUE (experts only)')); - $title = $this->t('Pages or PHP code'); - $description .= ' ' . $this->t('If the PHP option is chosen, enter PHP code between %php. Note that executing incorrect PHP code can break your Drupal site.', array('%php' => '')); - } - else { - $title = $this->t('Pages'); - } $form['visibility']['path']['visibility'] = array( '#type' => 'radios', '#title' => $this->t('Show block on specific pages'), @@ -173,7 +165,7 @@ public function form(array $form, array &$form_state) { ); $form['visibility']['path']['pages'] = array( '#type' => 'textarea', - '#title' => '' . $title . '', + '#title' => '' . $this->t('Pages') . '', '#default_value' => !empty($visibility['path']['pages']) ? $visibility['path']['pages'] : '', '#description' => $description, ); diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php index 24d3aa0..d24042a 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterSecurityTest.php @@ -20,7 +20,7 @@ class FilterSecurityTest extends WebTestBase { * * @var array */ - public static $modules = array('node', 'php', 'filter_test'); + public static $modules = array('node', 'filter_test'); /** * A user with administrative permissions. diff --git a/core/modules/php/config/filter.format.php_code.yml b/core/modules/php/config/filter.format.php_code.yml deleted file mode 100644 index 289ab21..0000000 diff --git a/core/modules/php/lib/Drupal/php/Plugin/Condition/Php.php b/core/modules/php/lib/Drupal/php/Plugin/Condition/Php.php deleted file mode 100644 index ca097e5..0000000 diff --git a/core/modules/php/lib/Drupal/php/Plugin/Filter/Php.php b/core/modules/php/lib/Drupal/php/Plugin/Filter/Php.php deleted file mode 100644 index 53b7a5e..0000000 diff --git a/core/modules/php/lib/Drupal/php/Plugin/views/argument_default/Php.php b/core/modules/php/lib/Drupal/php/Plugin/views/argument_default/Php.php deleted file mode 100644 index 84f1c76..0000000 diff --git a/core/modules/php/lib/Drupal/php/Plugin/views/argument_validator/Php.php b/core/modules/php/lib/Drupal/php/Plugin/views/argument_validator/Php.php deleted file mode 100644 index 2dfab78..0000000 diff --git a/core/modules/php/lib/Drupal/php/Tests/Condition/PhpConditionTest.php b/core/modules/php/lib/Drupal/php/Tests/Condition/PhpConditionTest.php deleted file mode 100644 index 13c339a..0000000 diff --git a/core/modules/php/lib/Drupal/php/Tests/PhpAccessTest.php b/core/modules/php/lib/Drupal/php/Tests/PhpAccessTest.php deleted file mode 100644 index 10d2b75..0000000 diff --git a/core/modules/php/lib/Drupal/php/Tests/PhpFilterTest.php b/core/modules/php/lib/Drupal/php/Tests/PhpFilterTest.php deleted file mode 100644 index 02f4981..0000000 diff --git a/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php b/core/modules/php/lib/Drupal/php/Tests/PhpTestBase.php deleted file mode 100644 index 80649a0..0000000 diff --git a/core/modules/php/lib/Drupal/php/Tests/Plugin/views/PhpArgumentValidatorTest.php b/core/modules/php/lib/Drupal/php/Tests/Plugin/views/PhpArgumentValidatorTest.php deleted file mode 100644 index 29f59ca..0000000 diff --git a/core/modules/php/php.info.yml b/core/modules/php/php.info.yml deleted file mode 100644 index 1bfd050..0000000 diff --git a/core/modules/php/php.install b/core/modules/php/php.install deleted file mode 100644 index a88fe6a..0000000 diff --git a/core/modules/php/php.module b/core/modules/php/php.module deleted file mode 100644 index 9baffe7..0000000 diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php index c939630..0d11b98 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php @@ -35,7 +35,7 @@ function testDrupalGetFilename() { // does not exist. $this->assertFalse(drupal_container()->has('keyvalue'), 'The container has no keyvalue service.'); // Retrieving the location of a module. - $this->assertIdentical(drupal_get_filename('module', 'php'), 'core/modules/php/php.module', 'Retrieve module location.'); + $this->assertIdentical(drupal_get_filename('module', 'xmlrpc'), 'core/modules/xmlrpc/xmlrpc.module', 'Retrieve module location.'); // Retrieving the location of a theme. $this->assertIdentical(drupal_get_filename('theme', 'stark'), 'core/themes/stark/stark.info.yml', 'Retrieve theme location.'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php index 7fc2b1c..c7c4566 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php @@ -138,9 +138,9 @@ function testModuleEnableOrder() { // - forum depends on taxonomy, comment, datetime, history, and ban (via module_test) // - taxonomy depends on options // - options depends on number - // - ban depends on php (via module_test) + // - ban depends on xmlrpc (via module_test) // The correct enable order is: - $expected_order = array('php', 'ban', 'datetime', 'comment', 'history', 'number', 'options', 'taxonomy', 'forum'); + $expected_order = array('xmlrpc', 'ban', 'datetime', 'comment', 'history', 'number', 'options', 'taxonomy', 'forum'); // Enable the modules through the UI, verifying that the dependency chain // is correct. @@ -148,7 +148,7 @@ function testModuleEnableOrder() { $edit['modules[Core][forum][enable]'] = 'forum'; $this->drupalPostForm('admin/modules', $edit, t('Save configuration')); $this->assertModules(array('forum'), FALSE); - $this->assertText(t('You must enable the History, Taxonomy, Options, Number, Comment, Datetime, Ban, PHP Filter modules to install Forum.')); + $this->assertText(t('You must enable the History, Taxonomy, Options, Number, Comment, Datetime, Ban, XML-RPC modules to install Forum.')); $edit['modules[Core][history][enable]'] = 'history'; $edit['modules[Core][options][enable]'] = 'options'; $edit['modules[Core][number][enable]'] = 'number'; @@ -156,9 +156,9 @@ function testModuleEnableOrder() { $edit['modules[Core][comment][enable]'] = 'comment'; $edit['modules[Core][datetime][enable]'] = 'datetime'; $edit['modules[Core][ban][enable]'] = 'ban'; - $edit['modules[Core][php][enable]'] = 'php'; + $edit['modules[Core][xmlrpc][enable]'] = 'xmlrpc'; $this->drupalPostForm('admin/modules', $edit, t('Save configuration')); - $this->assertModules(array('forum', 'ban', 'php', 'datetime', 'comment', 'history', 'taxonomy', 'options', 'number'), TRUE); + $this->assertModules(array('forum', 'ban', 'xmlrpc', 'datetime', 'comment', 'history', 'taxonomy', 'options', 'number'), TRUE); // Check the actual order which is saved by module_test_modules_enabled(). $module_order = \Drupal::state()->get('system_test.module_enable_order') ?: array(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php index d2d65bc..8ca5379 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php @@ -160,7 +160,7 @@ function testDependencyResolution() { $this->assertTrue(module_exists('module_test'), 'Test module is enabled.'); $this->assertFalse(module_exists('forum'), 'Forum module is disabled.'); $this->assertFalse(module_exists('ban'), 'Ban module is disabled.'); - $this->assertFalse(module_exists('php'), 'PHP module is disabled.'); + $this->assertFalse(module_exists('xmlrpc'), 'XML-RPC module is disabled.'); // First, create a fake missing dependency. Forum depends on ban, which // depends on a made-up module, foo. Nothing should be installed. @@ -171,26 +171,26 @@ function testDependencyResolution() { $this->assertFalse(module_exists('forum'), 'module_enable() aborts if dependencies are missing.'); // Now, fix the missing dependency. Forum module depends on ban, but ban - // depends on the PHP module. module_enable() should work. + // depends on the XML-RPC module. module_enable() should work. \Drupal::state()->set('module_test.dependency', 'dependency'); drupal_static_reset('system_rebuild_module_data'); $result = module_enable(array('forum')); $this->assertTrue($result, 'module_enable() returns the correct value.'); // Verify that the fake dependency chain was installed. - $this->assertTrue(module_exists('ban') && module_exists('php'), 'Dependency chain was installed by module_enable().'); + $this->assertTrue(module_exists('ban') && module_exists('xmlrpc'), 'Dependency chain was installed by module_enable().'); // Verify that the original module was installed. $this->assertTrue(module_exists('forum'), 'Module installation with unlisted dependencies succeeded.'); // Finally, verify that the modules were enabled in the correct order. $module_order = \Drupal::state()->get('system_test.module_enable_order') ?: array(); - $this->assertEqual($module_order, array('php', 'ban', 'forum'), 'Modules were enabled in the correct order by module_enable().'); + $this->assertEqual($module_order, array('xmlrpc', 'ban', 'forum'), 'Modules were enabled in the correct order by module_enable().'); - // Now, disable the PHP module. Both forum and ban should be disabled as + // Now, disable the XML-RPC module. Both forum and ban should be disabled as // well, in the correct order. - module_disable(array('php')); + module_disable(array('xmlrpc')); $this->assertTrue(!module_exists('forum') && !module_exists('ban'), 'Depedency chain was disabled by module_disable().'); - $this->assertFalse(module_exists('php'), 'Disabling a module with unlisted dependents succeeded.'); + $this->assertFalse(module_exists('xmlrpc'), 'Disabling a module with unlisted dependents succeeded.'); $disabled_modules = \Drupal::state()->get('module_test.disable_order') ?: array(); - $this->assertEqual($disabled_modules, array('forum', 'ban', 'php'), 'Modules were disabled in the correct order by module_disable().'); + $this->assertEqual($disabled_modules, array('forum', 'ban', 'xmlrpc'), 'Modules were disabled in the correct order by module_disable().'); // Disable a module that is listed as a dependency by the installation // profile. Make sure that the profile itself is not on the list of @@ -205,25 +205,25 @@ function testDependencyResolution() { $this->assertTrue(in_array('comment', $disabled_modules), 'Comment module is in the list of disabled modules.'); $this->assertFalse(in_array($profile, $disabled_modules), 'The installation profile is not in the list of disabled modules.'); - // Try to uninstall the PHP module by itself. This should be rejected, + // Try to uninstall the XML-RPC module by itself. This should be rejected, // since the modules which it depends on need to be uninstalled first, and // that is too destructive to perform automatically. - $result = module_uninstall(array('php')); + $result = module_uninstall(array('xmlrpc')); $this->assertFalse($result, 'Calling module_uninstall() on a module whose dependents are not uninstalled fails.'); - foreach (array('forum', 'ban', 'php') as $module) { + foreach (array('forum', 'ban', 'xmlrpc') as $module) { $this->assertNotEqual(drupal_get_installed_schema_version($module), SCHEMA_UNINSTALLED, format_string('The @module module was not uninstalled.', array('@module' => $module))); } // Now uninstall all three modules explicitly, but in the incorrect order, // and make sure that drupal_uninstal_modules() uninstalled them in the // correct sequence. - $result = module_uninstall(array('ban', 'php', 'forum')); + $result = module_uninstall(array('ban', 'xmlrpc', 'forum')); $this->assertTrue($result, 'module_uninstall() returns the correct value.'); - foreach (array('forum', 'ban', 'php') as $module) { + foreach (array('forum', 'ban', 'xmlrpc') as $module) { $this->assertEqual(drupal_get_installed_schema_version($module), SCHEMA_UNINSTALLED, format_string('The @module module was uninstalled.', array('@module' => $module))); } $uninstalled_modules = \Drupal::state()->get('module_test.uninstall_order') ?: array(); - $this->assertEqual($uninstalled_modules, array('forum', 'ban', 'php'), 'Modules were uninstalled in the correct order by module_uninstall().'); + $this->assertEqual($uninstalled_modules, array('forum', 'ban', 'xmlrpc'), 'Modules were uninstalled in the correct order by module_uninstall().'); // Uninstall the profile module from above, and make sure that the profile // itself is not on the list of dependent modules to be uninstalled. @@ -235,25 +235,25 @@ function testDependencyResolution() { $this->assertFalse(in_array($profile, $uninstalled_modules), 'The installation profile is not in the list of uninstalled modules.'); // Enable forum module again, which should enable both the ban module and - // php module. But, this time do it with ban module declaring a dependency - // on a specific version of php module in its info file. Make sure that - // module_enable() still works. + // XML-RPC module. But, this time do it with ban module declaring a + // dependency on a specific version of XML-RPC module in its info file. Make + // sure that module_enable() still works. \Drupal::state()->set('module_test.dependency', 'version dependency'); drupal_static_reset('system_rebuild_module_data'); $result = module_enable(array('forum')); $this->assertTrue($result, 'module_enable() returns the correct value.'); // Verify that the fake dependency chain was installed. - $this->assertTrue(module_exists('ban') && module_exists('php'), 'Dependency chain was installed by module_enable().'); + $this->assertTrue(module_exists('ban') && module_exists('xmlrpc'), 'Dependency chain was installed by module_enable().'); // Verify that the original module was installed. $this->assertTrue(module_exists('forum'), 'Module installation with version dependencies succeeded.'); // Finally, verify that the modules were enabled in the correct order. $enable_order = \Drupal::state()->get('system_test.module_enable_order') ?: array(); - $php_position = array_search('php', $enable_order); + $xmlrpc_position = array_search('xmlrpc', $enable_order); $ban_position = array_search('ban', $enable_order); $forum_position = array_search('forum', $enable_order); - $php_before_ban = $php_position !== FALSE && $ban_position !== FALSE && $php_position < $ban_position; + $xmlrpc_before_ban = $xmlrpc_position !== FALSE && $ban_position !== FALSE && $xmlrpc_position < $ban_position; $ban_before_forum = $ban_position !== FALSE && $forum_position !== FALSE && $ban_position < $forum_position; - $this->assertTrue($php_before_ban && $ban_before_forum, 'Modules were enabled in the correct order by module_enable().'); + $this->assertTrue($xmlrpc_before_ban && $ban_before_forum, 'Modules were enabled in the correct order by module_enable().'); } /** diff --git a/core/modules/system/tests/modules/module_test/module_test.module b/core/modules/system/tests/modules/module_test/module_test.module index fd1d2e6..4e36d9b 100644 --- a/core/modules/system/tests/modules/module_test/module_test.module +++ b/core/modules/system/tests/modules/module_test/module_test.module @@ -31,8 +31,8 @@ function module_test_system_info_alter(&$info, $file, $type) { $info['dependencies'][] = 'ban'; } elseif ($file->name == 'ban') { - // Make ban depend on php module. - $info['dependencies'][] = 'php'; + // Make ban depend on xmlrpc module. + $info['dependencies'][] = 'xmlrpc'; } } elseif (Drupal::state()->get('module_test.dependency') == 'version dependency') { @@ -41,11 +41,11 @@ function module_test_system_info_alter(&$info, $file, $type) { $info['dependencies'][] = 'ban'; } elseif ($file->name == 'ban') { - // Make ban depend on a specific version of php module. - $info['dependencies'][] = 'php (1.x)'; + // Make ban depend on a specific version of xmlrpc module. + $info['dependencies'][] = 'xmlrpc (1.x)'; } - elseif ($file->name == 'php') { - // Set php module to a version compatible with the above. + elseif ($file->name == 'xmlrpc') { + // Set xmlrpc module to a version compatible with the above. $info['version'] = '8.x-1.0'; } } diff --git a/core/modules/text/text.module b/core/modules/text/text.module index ecc0767..85cea7a 100644 --- a/core/modules/text/text.module +++ b/core/modules/text/text.module @@ -51,11 +51,10 @@ function text_help($path, $arg) { * @param $text * The content for which a summary will be generated. * @param $format - * The format of the content. If the PHP filter is present and $text contains - * PHP code, we do not split it up to prevent parse errors. If the line break - * filter is present then we treat newlines embedded in $text as line breaks. - * If the htmlcorrector filter is present, it will be run on the generated - * summary (if different from the incoming $text). + * The format of the content. If the line break filter is present then we + * treat newlines embedded in $text as line breaks. If the htmlcorrector + * filter is present, it will be run on the generated summary (if different + * from the incoming $text). * @param $size * The desired character length of the summary. If omitted, the default value * will be used. Ignored if the special delimiter is present in $text. @@ -93,13 +92,6 @@ function text_summary($text, $format = NULL, $size = NULL) { } } - // We check for the presence of the PHP evaluator filter in the current - // format. If the body contains PHP code, we do not split it up to prevent - // parse errors. - if (isset($format) && $filters->has('php_code') && $filters->get('php_code')->status && strpos($text, '