[www-doc] [Git][VideoLAN.org/websites][master] 5 commits: Properly convert string to int

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Tue Dec 2 12:45:56 UTC 2025



Jean-Baptiste Kempf pushed to branch master at VideoLAN organization / websites


Commits:
acbac864 by Marvin Scholz at 2025-12-02T13:45:38+01:00
Properly convert string to int

PHP 8 requires this to be done explicitly.

- - - - -
c4951695 by Marvin Scholz at 2025-12-02T13:45:38+01:00
Fix argument order

- - - - -
2522d97c by Marvin Scholz at 2025-12-02T13:45:38+01:00
Do not declare an optional parameter before other non-optional ones

This causes a warning in PHP 8.

- - - - -
161b5961 by Marvin Scholz at 2025-12-02T13:45:38+01:00
Do not use deprecated __autoload function

This was long deprecated and was removed in recent PHP 8.

- - - - -
7af09761 by Marvin Scholz at 2025-12-02T13:45:38+01:00
Make FeedWrite::uuid function static

It does not depend on any object state and is already used as a static
method elsewhere, which is now an error in recent PHP versions.

- - - - -


4 changed files:

- www.videolan.org/include/FeedWriter/FeedWriter.php
- www.videolan.org/include/header.php
- www.videolan.org/videolan/mirrors.php
- www.videolan.org/vlc/releases/3.0.12-update.php


Changes:

=====================================
www.videolan.org/include/FeedWriter/FeedWriter.php
=====================================
@@ -184,7 +184,7 @@
   * @param      string  an optional prefix
   * @return     string  the formated uuid
   */
-  public function uuid($key = null, $prefix = '') 
+  public static function uuid($key = null, $prefix = '')
   {
 	$key = ($key == null)? uniqid(rand()) : $key;
 	$chars = md5($key);
@@ -434,7 +434,6 @@
  } // end of class FeedWriter
  
 // autoload classes
-function __autoload($class_name) 
-{
-	require_once $class_name . '.php';
-}
+spl_autoload_register(function ($class) {
+    require_once $class_name . '.php';
+});


=====================================
www.videolan.org/include/header.php
=====================================
@@ -284,7 +284,7 @@ function start_head( $title,
 }
 
 /* Actual start of the body */
-function start_body( $body_color, $language, $b_show_donate = true, $nobanner, $alternate_lang, $new_design_class, $show_sponsors_carousel )
+function start_body( $body_color, $language, $b_show_donate, $nobanner, $alternate_lang, $new_design_class, $show_sponsors_carousel )
 {
     echo "<body class='$new_design_class'>";
     echo "<div id='bodyInner' class='$body_color'>";


=====================================
www.videolan.org/videolan/mirrors.php
=====================================
@@ -21,7 +21,7 @@
    $timestamp = 0;
    $ts = @fopen($timestamp_tmp, 'a+');
    if ($ts)
-        $timestamp = fread($ts, 16);
+        $timestamp = intval(fread($ts, 16));
 
    // Try to fetch the mirrors list
    if (time() - $timestamp > $refresh_min_interval)


=====================================
www.videolan.org/vlc/releases/3.0.12-update.php
=====================================
@@ -59,7 +59,7 @@ function make_elements(&$documents, $language)
         else
             $elements[] = "<a href=\"3.0.12-update.".$key.".html\">".$value["lang"]."</a>";
     }
-    return implode($elements, " | ");
+    return implode(" | ", $elements);
 }
 
 $additional_inline_css = array("



View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/compare/a038e9de6d614656dd1aa4b3687df722ea17c2ec...7af0976199ebc09a00d05d43fa7fc60d1409a423

-- 
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/compare/a038e9de6d614656dd1aa4b3687df722ea17c2ec...7af0976199ebc09a00d05d43fa7fc60d1409a423
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the www-doc mailing list