Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: php/php-src
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: iFixit/php-src
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ifixit-production
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 9 commits
  • 23 files changed
  • 3 contributors

Commits on Mar 31, 2020

  1. Update NEWS for PHP 7.4.5RC1

    derickr committed Mar 31, 2020
    Configuration menu
    Copy the full SHA
    855f008 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2020

  1. Merge branch 'PHP-7.3' into PHP-7.4

    * PHP-7.3:
      Fix bug #79465 - use unsigneds as indexes.
      Fix bug #79330 - make all execution modes consistent in rejecting \0
    smalyshev authored and derickr committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    4f606b5 View commit details
    Browse the repository at this point in the history
  2. Update NEWS

    derickr committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    f10c944 View commit details
    Browse the repository at this point in the history
  3. Update header

    derickr committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    e5c5832 View commit details
    Browse the repository at this point in the history
  4. Update NEWS for PHP 7.4.5

    derickr committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    787a173 View commit details
    Browse the repository at this point in the history
  5. Update versions for PHP 7.4.5

    derickr committed Apr 14, 2020
    Configuration menu
    Copy the full SHA
    ab4d189 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2020

  1. Configuration menu
    Copy the full SHA
    f5c85f1 View commit details
    Browse the repository at this point in the history
  2. PHP Templates: add optional autescaping to echo/<?=

    Background
    ==========
    PHP doesn't have any mechanism to inject logic between templating
    and final output. There is no way to filter or alter the content
    that comes from code in templates like: <?= $someVar ?>
    
    To use php as a robust templataing language, we must inject *some*
    logic between templates and their output. We have chosen to make
    all <?=, echo, and print statements subject to an optional
    trip through escape_html_entitiles.
    
    The functionality can be toggled with `ini_set('__auto_escape')`
    and configured with `__auto_escape_flags` and
    `__auto_escape_exempt_class` (see commit
    2dae5d1 for info about the class
    name based auto-escaping exemption.
    
    Methodology
    ===========
    T_ECHO (echo, <?=), T_PRINT (print) now both emit a
    ZEND_AST_ECHO_ESCAPE node in the syntax tree.
    
    That's compiled to a function which emits a ZEND_ECHO_ESCAPE op code.
    
    The op code interpretation is a dupe of ZEND_ECHO except with some
    if() statements that switch the underlying function from `zend_write`
    to `zend_write_escape` based on the ini settings.
    
    zend_write_escape is a new function pointer that points to
    php_escape_write.
    
    php_escape_write is a new function that passes it's string argument
    through php_escape_html_entities() (with __auto_escape_flags) before
    calling the underlying php_output_write.
    
    Use
    ===
    This functionality allows us to safely use php straight as a
    templating language with no template compilation step (as many
    other templating libraries have).
    
    See the included tests for more usage information.
    
    Exempt Class
    ============
    It is useful to allow some utility functions and helpers to produce
    html and have it passed straight through in the template (without
    being double-encoded). We accomplish this by *tagging* strings
    as being HTML.
    
        class HtmlString implements JsonSerializable {
           protected $html = '';
    
           public function __construct($html) {
              $this->html = $html;
           }
    
           public function __toString() {
              return (string)$this->html;
           }
    
           public function jsonSerialize() {
              return $this->html;
           }
        }
    
    The auto-escaping system can be configured with an:
    __auto_escape_exempt_class="HtmlString"
    
    Which allows instances of `HtmlString` to pass straight through a
    template without being modified (skipping the html_entities call).
    Helper functions can now return html safely and consumers don't have
    to care if it is HTML or not because the auto-escaping system knows
    what to do.
    
    squash with big commit
    danielbeardsley committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    cb6eb5c View commit details
    Browse the repository at this point in the history
  3. Auto-generated files: update

    The previous commit updated zend_vm_def and others that are used as
    inputs to these auto-generated files.
    
    Run php Zend/zend_vm_gen.php and commit the result.
    danielbeardsley committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    2fa338f View commit details
    Browse the repository at this point in the history
Loading