Skip to content
Permalink
Browse files

Escape dash literals in regex patterns for php 7.3 usage

  • Loading branch information
HammenWS committed Sep 23, 2019
1 parent 6b6bc80 commit fc9841f86dda4daa867b72c0112c071735423197
Showing with 12 additions and 3 deletions.
  1. +9 −0 README.md
  2. +2 −2 includes/libraries/PhpSimple/simplehtmldom_1_5/simple_html_dom.php
  3. +1 −1 simply-static.php
@@ -0,0 +1,9 @@
# Simply Static

Simply Static is a static site generator for WordPress that helps you create a static site that you can serve separately from your WordPress installation.

This repository is a fork of version 2.1.0 of the Simply Static plugin found in the WordPress Subversion repository.

## Why did we fork the plugin

The original plugin is not compatible with PHP 7.3. This fork will support it.
@@ -693,7 +693,7 @@ protected function parse_selector($selector_string) {
// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
// farther study is required to determine of this should be documented or removed.
// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
$pattern = "/([\w\-:\*]*)(?:\#([\w\-]+)|\.([\w\-]+))?(?:\[@?(!?[\w\-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
if (is_object($debugObject)) {$debugObject->debugLog(2, "Matches Array: ", $matches);}

@@ -1375,7 +1375,7 @@ protected function read_tag()
return true;
}

if (!preg_match("/^[\w-:]+$/", $tag)) {
if (!preg_match("/^[\w\-:]+$/", $tag)) {
$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>');
if ($this->char==='<') {
$this->link_nodes($node, false);
@@ -8,7 +8,7 @@
* Plugin Name: Simply Static
* Plugin URI: http://simplystatic.co/
* Description: Produces a static HTML version of your WordPress install and adjusts URLs accordingly.
* Version: 2.1.0
* Version: 3.0.0
* Author: Code of Conduct LLC
* Author URI: http://codeofconduct.co/
* License: GPL-2.0+

0 comments on commit fc9841f

Please sign in to comment.
You can’t perform that action at this time.