diff --git a/lib/weblib.php b/lib/weblib.php
index 0f34de8..fcd94f1 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -5157,17 +5157,19 @@ function update_mymoodle_icon() {
     global $CFG, $USER;
 
     if (!empty($USER->editing)) {
-        $string = get_string('updatemymoodleoff');
+        $string = get_string('turneditingoff');
         $edit = '0';
     } else {
-        $string = get_string('updatemymoodleon');
+        $string = get_string('turneditingon');
         $edit = '1';
     }
 
-    return "<form $CFG->frametarget method=\"get\" action=\"$CFG->wwwroot/my/index.php\">".
-           "<div>".
-           "<input type=\"hidden\" name=\"edit\" value=\"$edit\" />".
-           "<input type=\"submit\" value=\"$string\" /></div></form>";
+    return '<form '.$CFG->frametarget.' method="get" action="'.$CFG->wwwroot.'/my/index.php">'.
+           '<div>'.
+           '<input type="hidden" name="edit" value="'.$edit.'" />'.
+           '<input type="hidden" name="sesskey" value="'.sesskey().'" />'.
+           '<input type="submit" value="'.$string.'" />'.
+           '</div></form>';
 }
 
 /**
diff --git a/my/pagelib.php b/my/pagelib.php
index 3ed3f6a..b671679 100644
--- a/my/pagelib.php
+++ b/my/pagelib.php
@@ -30,9 +30,7 @@ class page_my_moodle extends page_base {
 
         global $USER, $CFG;
 
-        $replacements = array(
-                              '%fullname%' => get_string('mymoodle','my')
-        );
+        $replacements = array( '%fullname%' => get_string('mymoodle','my'));
         foreach($replacements as $search => $replace) {
             $title = str_replace($search, $replace, $title);
         }
