Commit ff63faf9 authored by Patrick's avatar Patrick
Browse files

refs #3063495

- removed dblog dependencies
- removed php eval for pages
parent a64fda0f
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2,6 +2,4 @@ name: 'JSNLog'
type: module
description: 'Logging javascript messages.'
core: 8.x
dependencies:
- drupal:dblog
configure: jsnlog.settings.form
+0 −2
Original line number Diff line number Diff line
administer jsnlog:
  title: 'Administer the JSNLog module'
use php for jsnlog visibility:
  title: 'Administer the JSNLog module extra Permission to use PHP'
+0 −3
Original line number Diff line number Diff line
@@ -171,9 +171,6 @@ class AjaxLogAccess implements AccessInterface {
        // set to 1, it is displayed only on those pages listed in $pages.
        $page_match = !($visibility_request_path_mode xor $page_match);
      }
      elseif ($this->moduleHandler->moduleExists('php')) {
        $page_match = php_eval($visibility_request_path_pages);
      }
      else {
        $page_match = FALSE;
      }
+2 −5
Original line number Diff line number Diff line
@@ -189,9 +189,7 @@ class JsnlogSettingsForm extends ConfigFormBase {
      '#group' => 'page_scope',
    ];

    $php_access = $this->currentUser->hasPermission('use php for jsnlog visibility');
    if ($config->get('visibility.request_path_mode') == 2 && !$php_access) {
      // No permission to change PHP snippets, but keep existing settings.
    if ($config->get('visibility.request_path_mode') == 2) {
      $form['page_visibility_settings'] = [];
      $form['page_visibility_settings']['visibility_request_path_mode'] = ['#type' => 'value', '#value' => 2];
      $form['page_visibility_settings']['visibility_request_path_pages'] = ['#type' => 'value', '#value' => $visibility_request_path_pages];
@@ -262,8 +260,7 @@ class JsnlogSettingsForm extends ConfigFormBase {
   * {@inheritdoc}
   */
  public function validateForm(array &$form, FormStateInterface $form_state) {
    // Verify that every path is prefixed with a slash, but don't check PHP
    // code snippets and do not check for slashes if no paths configured.
    // Verify that every path is prefixed with a slash.
    if ($form_state->getValue('visibility_request_path_mode') != 2 && !empty($form_state->getValue('visibility_request_path_pages'))) {
      $pages = preg_split('/(\r\n?|\n)/', $form_state->getValue('visibility_request_path_pages'));
      foreach ($pages as $page) {