From 14136c87ff93731f764fd8b0c873eec4f5827739 Mon Sep 17 00:00:00 2001 From: elvill Date: Wed, 10 Oct 2018 18:50:43 +0200 Subject: [PATCH] F5450 - MySQL Exception: underline faulty area - #refs 5450 --- .../Resources/Public/icons/wavy-underline.gif | Bin 0 -> 815 bytes .../qfq/qfq/exceptions/AbstractException.php | 16 +++++++++++++++- less/qfq-bs.css.less | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 extension/Resources/Public/icons/wavy-underline.gif diff --git a/extension/Resources/Public/icons/wavy-underline.gif b/extension/Resources/Public/icons/wavy-underline.gif new file mode 100644 index 0000000000000000000000000000000000000000..b18243e7834c94a021c263453951a6e2843cb6c2 GIT binary patch literal 815 zcmXAov5gi`41+E1FF;}mq?Ff#L_@_X1Gwh~h!_PaV|ak{%#lG(ROUT+Mf57m@#nnc z_b;DcA9%tW{yzc&i~xcNA&dl)NFj{^iYTFs2AXK0jRA%jVT=WqSYdsXV8ViZCBc9K zjz9z>6yZojGE$L_LKLGE$7p1X{CKv2Ma2=0u`)Kg)33XN>#cFRjg8# zt5MBrRl5c?tWk|?QOjD@`lMK9S!Lfi!G;>{KnFY2;ZAh2Q=RTY7rWHuZgjI--R?mT zd(`7z^s-mIK4jW#tL=*j9BAMPOmIRIp2Q?4HR&l#aY|F3#x$oj?HSB)Ml+tpEN3A;go8H0}x3uMLY;#-N-oXxcwBudua#y=P4O(-pwQrR` zL#I`zOb$A98gRfn>C~ZhAi3z$N%jQlrdub4v%H5M9mmJ0mtGz9BWlyu`F;BH_;&-( Ycix-$_WmRM;qmtC$M2tyr+4`J7Z?49KL7v# literal 0 HcmV?d00001 diff --git a/extension/qfq/qfq/exceptions/AbstractException.php b/extension/qfq/qfq/exceptions/AbstractException.php index 8adbdca1..018618de 100644 --- a/extension/qfq/qfq/exceptions/AbstractException.php +++ b/extension/qfq/qfq/exceptions/AbstractException.php @@ -129,8 +129,22 @@ class AbstractException extends \Exception { $editForm = $this->buildFormLink($storeSystem); } + $arrMerged = OnArray::htmlentitiesOnArray(array_merge($arrMsg, $arrDebugShow)); + if (!empty($os = $arrMerged[ERROR_MESSAGE_OS])) { + $beforeMatch = htmlentities("the right syntax to use near '", ENT_QUOTES); + $afterMatch = htmlentities("' at line [0-9]*$", ENT_QUOTES); + if(preg_match("/mysqli: 1064.*$beforeMatch.*$afterMatch/", $os)) { + $match = explode("$beforeMatch", $os, 2)[1]; + $match = preg_split("/$afterMatch/", $match)[0]; + + $splitSql = explode($match, $arrMerged[EXCEPTION_SQL_FINAL]); + $match = Support::wrapTag('', $match); + $highlightedSql = implode($match, $splitSql); + $arrMerged[EXCEPTION_SQL_FINAL] = $highlightedSql; + } + } $htmlDebug = OnArray::arrayToHtmlTable( - array_merge(OnArray::htmlentitiesOnArray(array_merge($arrMsg, $arrDebugShow)), [ 'Edit' => $editForm ]), 'Debug', EXCEPTION_TABLE_CLASS); + array_merge($arrMerged, [ 'Edit' => $editForm ]), 'Debug', EXCEPTION_TABLE_CLASS); $htmlDebug = str_replace("\n", "
", $htmlDebug); $arrDebugHiddenClean = OnArray::htmlentitiesOnArray($arrDebugHidden); diff --git a/less/qfq-bs.css.less b/less/qfq-bs.css.less index a93cdce8..871f08b2 100644 --- a/less/qfq-bs.css.less +++ b/less/qfq-bs.css.less @@ -737,4 +737,8 @@ select.qfq-locked:invalid { .qfq-droplet-container.qfq-droplet-blue:before { border-color: transparent #25adf1 #25adf1 transparent; +} + +.qfq-wavy-underline { + background: url('../icons/wavy-underline.gif') bottom repeat-x } \ No newline at end of file -- GitLab