Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write HTML - NOTICE Uninitialized string offset - XXXX on Otl.php #2023

Closed
1 task done
jzafrilla opened this issue Jun 13, 2024 · 1 comment
Closed
1 task done

Write HTML - NOTICE Uninitialized string offset - XXXX on Otl.php #2023

jzafrilla opened this issue Jun 13, 2024 · 1 comment

Comments

@jzafrilla
Copy link

Guidelines

Description of the bug

This notice appears on this line:

$a = (ord($this->ttfOTLdata[$this->_pos]) << 8) + ord($this->ttfOTLdata[$this->_pos + 1]);

maybe it can be fixed with (or no...):
if (isset($this->ttfOTLdata[$this->_pos]) && isset($this->ttfOTLdata[$this->_pos + 1])) { $a = (ord($this->ttfOTLdata[$this->_pos]) << 8) + ord($this->ttfOTLdata[$this->_pos + 1]); } else { $a = 0; }

StackTrace: 
Uninitialized string offset: 40456 [APP/Vendor/mpdf/mpdf/src/Otl.php, line 5906

Mpdf\Otl::read_ushort() - APP/Vendor/mpdf/mpdf/src/Otl.php, line 5906
Mpdf\Otl::_applyGSUBsubtable() - APP/Vendor/mpdf/mpdf/src/Otl.php, line 1778
Mpdf\Otl::_applyGSUBrules() - APP/Vendor/mpdf/mpdf/src/Otl.php, line 1317
Mpdf\Otl::applyOTL() - APP/Vendor/mpdf/mpdf/src/Otl.php, line 974
Mpdf\Mpdf::WriteHTML() - APP/Vendor/mpdf/mpdf/src/Mpdf.php, line 13595
ReportsController::generateReportView() - APP/Plugin/Report/Controller/ReportsController.php, line 523
ReportsController::viewReport() - APP/Plugin/Report/Controller/ReportsController.php, line 437

mPDF version

8.2.x

PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

7.4.3

Reproducible PHP+CSS+HTML snippet suffering by the error

<style type="text/css">
        .tg {
                border-collapse: collapse;
                border-spacing: 0;
                width: 100%;
        }

        .tg td {
                font-family: Arial, sans-serif;
                font-size: 11px;
                padding: 5px;
                border-style: solid;
                border-width: 1px;
                overflow: hidden;
                word-break: normal;
                border-color: #888888;
        }

        .tg th {
                font-family: Arial, sans-serif;
                font-size: 12px;
                font-weight: normal;
                padding: 5px;
                border-style: solid;
                border-width: 1px;
                overflow: hidden;
                word-break: normal;
                text-align: left;
                border-color: #888888;
        }

        .tg .tg-yw4l {
                vertical-align: top;
                word-wrap: break-word;
        }

        .tg .cabecera {
                background: lightgray;
                text-align: left;
                font-weight: bold;
                padding: 5px;
                font-size: 14px;
        }

        .tg #resumen {
                font-size: 12px;
                margin: 5px 0;
        }

        .tg .title {
                text-align: right!important;
                font-weight: bold;
                font-size: 14px;
                border-color: transparent;
                padding-bottom: 0;
        }

        .tg .subtitle {
                text-align: right!important;
                font-size: 12px;
                border-left-color: transparent;
                border-right-color: transparent;
        }

        .tg .logo {
                border-top-color: transparent;
                border-left-color: transparent;
                border-right-color: transparent;
        }

        .cabeceraColumnas {
        background-color: #89CCE2;
        color: #FFFFFF;
    }
</style>


<table class="tg" style="word-wrap: break-word; width: 100%;">
        <tbody>
        <tr>
                <td style="border: none;" class="logo" rowspan="2" colspan="3">
                        <img src="img/header_logo/traceusbynunsys2.png" />
                </td>
                <td class="title" colspan="8">COLEGIO PRUEBAS</td>
        </tr>
        <tr>
                <td style="border: none;" class="subtitle" colspan="8">Estado de Alumnos y Paradas – 13/06/2024</td>
        </tr>
        <tr class="cabeceraColumnas"><td class="tg-yw4l" style="word-wrap: break-word;"><b>Hora Registro</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Hora Paso Prevista</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Ruta</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Parada</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Referencia</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Nombre Alumno</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Grupo</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Evento</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Tipo Registro</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Anotaciones</b></td><td class="tg-yw4l" style="word-wrap: break-word;"><b>Observaciones</b></td></tr><tr><td colspan="11">No existen datos a mostrar</td></tr>       </tbody>
</table>

<form action="reports/viewReport" method="GET" id="pdf_form">
        <input type="hidden" name="report" value="alumnos_estado">
        <input type="hidden" name="view_mode" value="PDF_HORIZONTAL">
</form>

<form action="reports/viewReport" method="GET" id="excel_form">
        <input type="hidden" name="report" value="alumnos_estado">
        <input type="hidden" name="view_mode" value="EXCEL">
</form>

@finwe
Copy link
Member

finwe commented Jun 13, 2024

Unable to reproduce, show the PHP code. Can reopen then.

@finwe finwe closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants