PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/component/scan/class-tokens.php +4 -1 5.6.0 → 6.3.0 View file →
@@ -64,11 +64,14 @@
64 64 *
65 65 * @return int The line number at the specified offset.
66 66 */
67 67 public static function get_line_from_offset( $content, $offset ): int {
68 + if ( '' === (string) $content ) {
69 + return 1;
70 + }
68 71 // Polyfill for PHP version < 8.0.
69 72 $offset = max( $offset, 1 );
70 - [ $before ] = str_split( $content, $offset );
73 + [ $before ] = str_split( (string) $content, $offset );
71 74
72 75 return strlen( $before ) - strlen( str_replace( PHP_EOL, '', $before ) ) + 1;
73 76 }
74 77