Your Time:
Our Time:
← Back to discussions

Version 5: warning – prepared statements are not working & UTF-8 issue

Need help with a different issue? Search the forums or open a new ticket.
Open a support ticket

This topic has 14 replies, 3 voices, and was last updated 10 years ago by Anonymous.

  • 2016-07-22 at 8:07 pm
    Supported
    #15545
    pddv
    Participant
    • Topics: 5
    • Replies: 23
    • Total posts: 28
    • Post count: 46

    Hi,

    1. the prepared statements are not working correctly. If you upload a php file instead a photo, then you are able to hijack the server. Please rework the prepared statements for the upload function and check if the file is a jpg, png or a gif-file. If the file is not a image file, then stop uploading the file.

    2. I localized the advanced testimonials manager into german language, but all special characters where not shown correctly, e.g. f�r instead of für, Vollst�ndige instead of Vollständige and so on. Could you please provide a solution?

    Thanks in advanced!

    Best regards
    Norman from pddv

    P.S.: I am able to upload a php file, e.g. a php file with phpinfo();
    Therefore I could do a lot of other things…
    http://www.bannersmonster.com/scripts/advtestm/upload/141113teste.php

    • This topic was modified 10 years, 1 month ago by pddv.
    • This topic was modified 10 years, 1 month ago by pddv.
    • This topic was modified 10 years, 1 month ago by pddv.
    2016-07-25 at 4:23 pm
    #15556
    Anonymous
    Inactive
    • Topics: 0
    • Replies: 3227
    • Total posts: 3227
    • Post count: 0

    For the upload function: We’ll consider adding a condition for the images to upload in the next future updates.
    For German Language:
    Add this line in header.php on line no#6

    2016-07-31 at 11:16 pm
    Supported
    #15669
    pddv
    Participant
    • Topics: 5
    • Replies: 23
    • Total posts: 28
    • Post count: 46

    Hi Pam Reddy,

    I see no code for the header.php on line no#6. Could you please provide the code?
    Thank you very much!

    Best regards,
    Norman

    2016-08-01 at 11:06 am
    #15680
    Anonymous
    Inactive
    • Topics: 0
    • Replies: 3227
    • Total posts: 3227
    • Post count: 0

    Sorry,
    Kindly replace this line <html xmlns="http://www.w3.org/1999/xhtml"> in header.php line#6
    with,
    <html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de"> // for german language

    2016-08-16 at 2:34 pm
    Supported
    #15982
    pddv
    Participant
    • Topics: 5
    • Replies: 23
    • Total posts: 28
    • Post count: 46

    Hi Pam Reddy,

    thank you for the code. I added it into all header.php (testimonial/header.php and admin/header.php).
    Now it is working for some areas, but not at all.

    I have attached a screenshot to get a better understanding.

    Could you please give me a hint, where I have to modify the code again to remove the latest german unicode bugs?

    Thank you very much in advance.

    Best regards,
    PDDV

    2016-08-16 at 2:46 pm
    #15984
    Fem
    Keymaster
    • Topics: 2
    • Replies: 5215
    • Total posts: 5217
    • Post count: 6003

    What is the font you are using? I see its a google font. Can I have the URL to your site too please.

    2016-08-16 at 2:54 pm
    Supported
    #15986
    pddv
    Participant
    • Topics: 5
    • Replies: 23
    • Total posts: 28
    • Post count: 46

    Hi Fem,

    i don’t think that I changed the fonts.
    Yes, of course:
    https://www.deutsch-vietnamesisch-dolmetscher.com/testimonials/index.php

    BR,
    Norman

    • This reply was modified 10 years, 1 month ago by pddv.
    2016-08-16 at 3:13 pm
    #15990
    Fem
    Keymaster
    • Topics: 2
    • Replies: 5215
    • Total posts: 5217
    • Post count: 6003

    I see you have a font Droid Serif in the header and Lato in the css kindly change those and choose a fonts with your prefered lang chars from google font and add in header file. You need to select the latin or extended latin from the specimen

    https://fonts.google.com/specimen/Lato?authuser=1&query=lato

    Use
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700&subset=latin-ext" rel="stylesheet">

    2016-08-16 at 3:32 pm
    Supported
    #15992
    pddv
    Participant
    • Topics: 5
    • Replies: 23
    • Total posts: 28
    • Post count: 46

    I tried your suggestion, but it does not help.
    If I would delete the google fonts implementation, then the system would use the fallback fonts, right?

    2016-08-16 at 4:08 pm
    #15993
    Fem
    Keymaster
    • Topics: 2
    • Replies: 5215
    • Total posts: 5217
    • Post count: 6003

    Try using the text editor and see. Are you using FTP editor for editing the characters or text? Coz everything is perfect i see few texts are not translated. If it was an issue with something the the utf8 or encoding then it should fall to all.

    2016-08-16 at 4:23 pm
    Supported
    #15994
    pddv
    Participant
    • Topics: 5
    • Replies: 23
    • Total posts: 28
    • Post count: 46

    I localized the text with poEdit. I edit all my pages local with notepadd++ in utf-8 without BOM and then upload it to the ftp with totalcmd. I converted all files from utf-8 to utf-8 without BOM. That is normally necessary to view all pages without ugly characters. But there are still ugly characters.

    Only the testimonial test entry is not translated.

    2016-08-16 at 9:22 pm
    Supported
    #16000
    pddv
    Participant
    • Topics: 5
    • Replies: 23
    • Total posts: 28
    • Post count: 46

    The images are too big in Internet Explorer. Could you please provide a CSS fix?

    2016-08-16 at 10:10 pm
    Supported
    #16002
    pddv
    Participant
    • Topics: 5
    • Replies: 23
    • Total posts: 28
    • Post count: 46

    please delete this comment. thanks

    • This reply was modified 10 years, 1 month ago by pddv. Reason: please delete this comment
    2016-08-16 at 10:45 pm
    Supported
    #16005
    pddv
    Participant
    • Topics: 5
    • Replies: 23
    • Total posts: 28
    • Post count: 46

    Please update testimonial/addnew.php after line 6 if ( $addtestmonial ) { and testimonials/admin/addnew.php after line 14 if ( $addtestmonial ) { with the following code to avoid hacking attacks through uploading php files or other files than images. Please adapt the error messages to the correct variables. It already should work. Feel free to implement and adapt the code for the next release

    
    	if (isset($_FILES["photo"]) AND ! $_FILES["photo"]["error"]  AND  ($_FILES["photo"]["size"] < 300000 )) {
    		$bildinfo = getimagesize($_FILES["photo"]["tmp_name"]);
    			if ($bildinfo === false) {
    				die("kein Bild");
    			} else {
    				$mime = $bildinfo["mime"];
    				$mimetypen = array (
    					"image/jpeg" => "jpg",
    					"image/gif" => "gif",
    					"image/png" => "png"
    				);
    		 if (!isset($mimetypen[$mime])) {
    		   die("nicht das richtige Format");
    		 } else {
    		   $endung = $mimetypen[$mime];
    		 }
    
    		 $neuername = basename($_FILES["photo"]["name"]);
    		 $neuername = preg_replace("/\.(jpe?g|gif|png)$/i", "", $neuername);  
    		 $neuername = preg_replace("/[^a-zA-Z0-9_-]/", "", $neuername);     
    		 $neuername .= ".$endung";
    		 $ziel = "upload/$neuername";
    		 while (file_exists($ziel)) {
    		   $neuername = "kopie_$neuername";
    		   $ziel = "upload/$neuername";
    		 }
    		  if (@move_uploaded_file($_FILES["photo"]["tmp_name"], $ziel)) {
    			echo "Dateiupload hat geklappt";
    		 } else {
    		   echo "Dateiupload hat nicht geklappt";
    		}
    	  }
    	}	
    
    • This reply was modified 10 years, 1 month ago by pddv.
    • This reply was modified 10 years, 1 month ago by pddv.
    2016-08-18 at 3:56 pm
    #16039
    Anonymous
    Inactive
    • Topics: 0
    • Replies: 3227
    • Total posts: 3227
    • Post count: 0

    Sure, we’ll implement this code in the next release.

You must be logged in to reply to this topic.