fix: system message can contain quotes and no longer inserts BOM

This commit is contained in:
Martin Ambrus
2017-10-20 01:31:58 +02:00
parent 33143e9405
commit f46b94b832
3 changed files with 13 additions and 31 deletions
+5 -24
View File
@@ -10,34 +10,15 @@
#################################################################################
$txt="World Wonder Construction Plans
$txt="dobrá modrá nedotknutá mliečna krava s rosnatými rohmi a bacuľatými kostičkami
καλή γαλάζια παρθένα γαλακτοπαραγωγική αγελάδα με καυτά κέρατα και κούτσουρα
Many moons ago the tribes of Travian were surprised by the unforeseen return of the Natars. This tribe from immemorial times surpassing all in wisdom, might and glory was about to trouble the free ones again. Thus they put all their efforts in preparing a last war against the Natars and vanquishing them forever. Many thought about the so-called 'Wonders of the World', a construction of many legends, as the only solution. It was told that it would render anyone invincible once completed. Ultimately making the constructors the rulers and conquerors of all known Travian.
azgın boynuzları ve tombul chubs ile iyi mavi temiz kuru süt ineği
However, it was also told that one would need construction plans to construct such a building. Due to this fact, the architects devised cunning plans about how to store these safely. After a while, one could see temple-like buildings in many a city and metropolis - the Treasure Chambers (Treasuries).
хороша синя незаймана молочна корова з роговими рогами і пухкими чуваками
Sadly, no one - not even the wise and well versed - knew where to find these construction plans. The harder people tried to locate them, the more it seemed as if they where only legends.
Today, however, this last secret will be revealed. Deprivations and endeavors of the past will not have been in vain, as today scouts of several tribes have successfully obtained the whereabouts of the construction plans. Well guarded by the Natars, they lie hidden in several oases to be found all over Travian. Only the most valiant heroes will be able to secure such a plan and bring it home safely so that the construction can begin.
In the end, we will see whether the free tribes of Travian can once again outwit the Natars and vanquish them once and for all. Do not be so foolish as to assume that the Natars will leave without a fight, though!
To steal a set of Construction Plans from the Natars, the following things must happen:
- You must Attack the village (NOT Raid!)
- You must WIN the Attack
- You must DESTROY the Treasure Chamber (Treasury)
- Your Hero MUST be in that attack, as he is the only one who may carry the Construction Plans
- An empty level 10 Treasure Chamber (Treasury) MUST be in the village where that attack came from
NOTE: If the above criteria is not met during the attack, the next attack on that village which does meet the above criteria will take the Construction Plans.
To build a Treasure Chamber (Treasury), you will need a Main Building level 10 and the village MUST NOT be contain a World Wonder.
To build a World Wonder, you must own the Construction Plans yourself (you = the World Wonder Village Owner) from level 0 to 50, and then from level 51 to 100 you will need an additional set of Construction Plans in your Alliance! Two sets of Construction Plans in the World Wonder Village Account will not work!";
良好的藍色原始乳白色牛與角角和胖胖的小孩";
//bbcode = html code
$txt = preg_replace("/\[b\]/is",'<b>', $txt);
+4 -2
View File
@@ -40,8 +40,10 @@ if (@isset($_POST['confirm']))
$myFile = "Templates/text.tpl";
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: templates/text.tpl");
$text = file_get_contents("Templates/text_format.tpl");
$text = preg_replace("'%TEKST%'",$_SESSION['m_message'] ,$text);
$text = utf8_encode($text);
$text = preg_replace("'%TEKST%'",str_replace('"', '\\"', $_SESSION['m_message']) ,$text);
// the following is not really needed and results in fhe file starting with BOM which gets displayed when the message is shown
// ... also, this very much depends on the underlying system and utf8_encode() is only good if the system is defaulted to ISO-8859-1
// $text = utf8_encode($text);
fwrite($fh, $text);
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
+4 -5
View File
@@ -1,4 +1,4 @@
- just so it's really visible => exchange md5 for something more secure
- just so it's really visible => exchange md5 for something more secure (probably password_hash() using bcrypt)
- change title for each page, so it fits with H1 (or history will always show a lot of "TravianZ" entries without a way to know where that history entry leads)
... same in Admin panel
- fix deleting users (need to delete their villages (+alliances/construction plans/...?) after a while)
@@ -6,17 +6,16 @@
- add PayPal listener to verify gold transactions imediatelly
- add combat Simulator link to options for a village/oasis (Centre map, Raid, Send Troops...)
- don't show Support & Taskmaster in stats
- add Support + Taskmaster login possibility into the game
- add Support login possibility into Admin (ask for password during installation, create Support messages section)
- allow sending Mass Message + System Message from Admin
- fix editing current task from Taskmaster -> number never match the edited quest after save
- remove <br /> tags from profile description and replace them by real new lines when editing players in Admin
- cannot delete a single medal in admin
- add back buttons to Admin where there are not (like editing a user)
- disallow installation if existing data are in place, or world map would end up screwed and villages not showing (because there can be multiple villages/oasis generated for one square then)
- when editing Additional Information for user and adjusting gold, sometimes the first time will not record the new gold amount
- update password hashes (I believe they are md5 only now)
- when editing Additional Information for user and adjusting gold, sometimes the first time will not record the new gold amount (when pressing Enter)
- allow to redirect Support messages to admin's nickname (for when there's only a single admin and doesn't like switching between Support and themselves)
- disallow Support to play (single cookie for Admin and the game means support gets no village and lots of warnings when they switch to game now)
- make messages work with apostrophes
- resetting res bonus in admin actually says that bonus was given after OK is pressed
- pagination in attacks goes to "All" reports instead of staying in "Attacks"
- quest image should glow red when new task is ready to be read (now it's only red when page is refreshed)