]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/htmloutputter.php
ksort on commands array to avoid converting to numerical array
[quix0rs-gnu-social.git] / lib / htmloutputter.php
index b1aae16fad7a0819b634c4069b60d85837a92c52..3409ff8f9252bd4473dca6db39b7cd10ca141e7f 100644 (file)
@@ -198,6 +198,14 @@ class HTMLOutputter extends XMLOutputter
         }
         $attrs['id'] = $id;
         $attrs['name'] = is_null($name) ? $id : $name;
+        if (array_key_exists('placeholder', $attrs) && (is_null($attrs['placeholder']) || $attrs['placeholder'] === '')) {
+            // If placeholder is type-aware equal to '' or null, unset it as we apparently don't want a placeholder value
+            unset($attrs['placeholder']);
+        } else {
+            // If the placeholder is set use it, or use the label as fallback.
+            $attrs['placeholder'] = isset($attrs['placeholder']) ? $attrs['placeholder'] : $label;
+        }
+
         if (!is_null($value)) { // value can be 0 or ''
             $attrs['value'] = $value;
         }
@@ -386,11 +394,11 @@ class HTMLOutputter extends XMLOutputter
 
                 if (strpos($src, 'plugins/') === 0 || strpos($src, 'local/') === 0) {
 
-                    $src = common_path($src, StatusNet::isHTTPS()) . '?version=' . GNUSOCIAL_VERSION;
+                    $src = common_path($src, GNUsocial::isHTTPS()) . '?version=' . GNUSOCIAL_VERSION;
 
                 } else {
 
-                    if (StatusNet::isHTTPS()) {
+                    if (GNUsocial::isHTTPS()) {
 
                         $sslserver = common_config('javascript', 'sslserver');
 
@@ -493,7 +501,7 @@ class HTMLOutputter extends XMLOutputter
                 if(file_exists(Theme::file($src,$theme))){
                    $src = Theme::path($src, $theme);
                 }else{
-                    $src = common_path($src, StatusNet::isHTTPS());
+                    $src = common_path($src, GNUsocial::isHTTPS());
                 }
                 $src.= '?version=' . GNUSOCIAL_VERSION;
             }