Skip to content

Fix bad-string-token to return null from get_token_value()#226

Open
Copilot wants to merge 5 commits intotrunkfrom
copilot/fix-bad-string-token-value
Open

Fix bad-string-token to return null from get_token_value()#226
Copilot wants to merge 5 commits intotrunkfrom
copilot/fix-bad-string-token-value

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Per the CSS tokenization spec, bad-string-token carries no associated data. CSSProcessor::get_token_value() was incorrectly returning the partial string content up to the breaking codepoint instead of null.

Fixes #225.

Changes

  • CSS/class-cssprocessor.php: Splits TOKEN_BAD_STRING out of the shared TOKEN_STRING/TOKEN_URL case in get_token_value(), giving it a dedicated case that returns null. Also removes a no-op self-assignment ($this->token_value = $this->token_value).
  • Tests/CSSProcessorTest.php: Adds test_bad_string_token_value_is_null() covering the exact scenario from the issue report.
$p = CSSProcessor::create( "'str\ning'" );
$p->next_token();
// Before: returned 'str' — After: returns null
assert( $p->get_token_type() === CSSProcessor::TOKEN_BAD_STRING );
assert( $p->get_token_value() === null );

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/882b8c947ada27eb002870fe77fee9ce0a454cdb
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/7f1e3eccb87d731d01341fde07171ab735218c5c
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8da41e9a9fe4cc14d23cf7fcef3b80476f54e511
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader (http block)
  • https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/e9cf5e4bbf7eeaf9ef5db34938942602838fc2b1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader (http block)
  • https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/d2421de7cec3274ae622c22c744de9a62c7925af
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/c758753e8f9dac251fed396a73c8305af3f17922
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/doctrine/instantiator/zipball/0daa7cfba7b009aa3c95ae585322fb596a4ca2ae
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader (http block)
  • https://api.github.com/repos/nikic/PHP-Parser/zipball/f7c23a43eee861070ab4e88819a4e76a611c7e4f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/phar-io/manifest/zipball/65f90285728eae4eae313b8b6ba11b2f5436038e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader (http block)
  • https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader (http block)
  • https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/phpstan/phpstan/zipball/fcf8b71aeab4e1a1131d1783cef97b23a51b87a9
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader (http block)
  • https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0448d60087a382392a1b2a1abe434466e03dcc87
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/38b24367e1b340aa78b96d7cab042942d917bb84
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/l6ed8z /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/dcf66f408d3f1a953a099503455b65e2616f1285
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ff553e7482dcee39fa4acc2b175d6ddeb0f7bc25
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/slevomat/coding-standard/zipball/2b801e950ae1cceb30bb3c0373141f553c99d3c3
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2
    • Triggering command: /usr/local/bin/php php /usr/bin/composer install --no-interaction --no-progress --optimize-autoloader -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed -e 1s/^X// -e ]\)/\\\1/g 1s/^X// -e ]\)/\\\1/g /usr/bin/sed (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/e5cBhW /usr/bin/composer install --no-scripts (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix CSS Processor bad-string-token to report null value Fix bad-string-token to return null from get_token_value() Apr 7, 2026
Copilot AI requested a review from sirreal April 7, 2026 20:15
Comment on lines +714 to +718
case self::TOKEN_BAD_STRING:
// Bad-string-token has no associated value per the CSS spec.
$this->token_value = null;
break;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This can use the default case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — removed the explicit TOKEN_BAD_STRING case in 4f57878, it now falls through to the default case which already returns null.

Copilot AI requested a review from sirreal April 8, 2026 07:46
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This URL fragment seems to be stale. Update it to https://www.w3.org/TR/css-syntax-3/#tokenization.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 1cc2e56.

Copilot AI requested a review from sirreal April 8, 2026 08:00
sirreal
sirreal previously approved these changes Apr 8, 2026
Copy link
Copy Markdown
Member

@sirreal sirreal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right to me. I would like @adamziel to sign off in case it's intentional or important to keep the token value for bad-string.

See #225 for details.

* - For other tokens: null
*
* @see https://www.w3.org/TR/css-syntax-3/#token-value
* @see https://www.w3.org/TR/css-syntax-3/#tokenization
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL used a fragment that isn't present. The updated URL links to an appropriate section.

break;

case self::TOKEN_STRING:
case self::TOKEN_BAD_STRING:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the essential fix 👍

$this->token_value_starts_at,
$this->token_value_length
);
$this->token_value = $this->token_value;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look like a redundant line 👍

@sirreal sirreal requested a review from adamziel April 8, 2026 08:56
@sirreal sirreal marked this pull request as ready for review April 8, 2026 08:57
@sirreal
Copy link
Copy Markdown
Member

sirreal commented Apr 8, 2026

@copilot Fix the failing test cases where bad-string tokens should always have a null value.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 8, 2026

@copilot Fix the failing test cases where bad-string tokens should always have a null value.

Fixed in 4382fe0 — updated css-test-cases.json to set "value": null for all 6 bad-string-token entries (in tests/bad-string/0001, 0003, 0005, and tests/string/0003).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/882b8c947ada27eb002870fe77fee9ce0a454cdb
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/7f1e3eccb87d731d01341fde07171ab735218c5c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8da41e9a9fe4cc14d23cf7fcef3b80476f54e511
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wv6ja1 /usr/bin/composer install (http block)
  • https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/e9cf5e4bbf7eeaf9ef5db34938942602838fc2b1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wv6ja1 /usr/bin/composer install (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wv6ja1 /usr/bin/composer install (http block)
  • https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/d2421de7cec3274ae622c22c744de9a62c7925af
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/c758753e8f9dac251fed396a73c8305af3f17922
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/doctrine/instantiator/zipball/0daa7cfba7b009aa3c95ae585322fb596a4ca2ae
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wv6ja1 /usr/bin/composer install (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wv6ja1 /usr/bin/composer install (http block)
  • https://api.github.com/repos/nikic/PHP-Parser/zipball/f7c23a43eee861070ab4e88819a4e76a611c7e4f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/phar-io/manifest/zipball/65f90285728eae4eae313b8b6ba11b2f5436038e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wv6ja1 /usr/bin/composer install (http block)
  • https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wv6ja1 /usr/bin/composer install (http block)
  • https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/phpstan/phpstan/zipball/fcf8b71aeab4e1a1131d1783cef97b23a51b87a9
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Wv6ja1 /usr/bin/composer install (http block)
  • https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0448d60087a382392a1b2a1abe434466e03dcc87
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/38b24367e1b340aa78b96d7cab042942d917bb84
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/dcf66f408d3f1a953a099503455b65e2616f1285
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ff553e7482dcee39fa4acc2b175d6ddeb0f7bc25
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/slevomat/coding-standard/zipball/2b801e950ae1cceb30bb3c0373141f553c99d3c3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/9zUiwq /usr/bin/composer install --quiet (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from sirreal April 8, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS Processor bad-string-token should report null value

2 participants